HExp12-3|Houdini Expression functions全集之Class屬性類(lèi):


1、點(diǎn)屬性系列

float point?(string surface_node, float?point_number, string?attribute, float?index)
返回一個(gè)點(diǎn)屬性的值。<surface_node>是曲面節(jié)點(diǎn)的路徑,例如 "/obj/geo1/grid1",可通過(guò)復(fù)制節(jié)點(diǎn)獲取其路徑。<point_number>是要讀取屬性的點(diǎn)序號(hào)。<attribute>是屬性的名稱(chēng)(例如,Cd表示漫反射顏色),存在兩個(gè)特殊屬性:P和Pw,它們均表示點(diǎn)在空間中的位置(Pw允許您訪問(wèn)該位置的W項(xiàng),即四維空間位置中的 w維)。<index>指定在多元素屬性中的哪一個(gè)元素,例如,若屬性是一種顏色,則索引值0返回紅色分量,1返回綠色分量,2返回藍(lán)色分量。
提示:如果<point_number>是分?jǐn)?shù),例如3.35,將獲取點(diǎn)3與點(diǎn)4之間的插值。
string?points (string?surface_node, float?point_number, string?attribute)
返回一個(gè)點(diǎn)屬性的值。該屬性應(yīng)為字符串屬性。
string?pointsmap (string?surface_node,?string?attribute,?float?index)
返回指定點(diǎn)屬性的值。該屬性為字符串類(lèi)型。
float?pointsnummap?(string?surface_node,?string?attribute)
返回指定點(diǎn)屬性的值的數(shù)量。
string?pointattriblist?(string?surface_node)????????????????????
返回點(diǎn)屬性的名稱(chēng)列表。
float?pointattribtype (string?surface_node, string?attribute)
返回一個(gè)點(diǎn)屬性的數(shù)據(jù)類(lèi)型。如果未找到指定節(jié)點(diǎn)或?qū)傩裕瑒t返回-1。屬性的數(shù)據(jù)類(lèi)型代號(hào)如下:?
-1 - Unknown/Invalid 未知的/無(wú)效的;
0 - Integer 整型;
1 - Float 浮點(diǎn)型;
2 - String 字符串型;
3 - Array of integers?整數(shù)數(shù)組;
4 - Array of floats 浮點(diǎn)數(shù)數(shù)組;
5 - Array of strings?字符串?dāng)?shù)組;
6 - Dictionary 專(zhuān)業(yè)術(shù)語(yǔ);
7 - Array of dictionaries 專(zhuān)業(yè)術(shù)語(yǔ)組;
float?pointattribsize (string?surface_node,?string?attribute)
返回一個(gè)點(diǎn)屬性中元素的數(shù)量。
string?pointgrouplist (string?surface_node)?????????????
返回點(diǎn)編組的名稱(chēng)列表。
string?pointgroupmask (string?surface_node, string?pattern)
返回按一定條件檢索出的點(diǎn)編組的名稱(chēng)列表。<pattern>為需要檢索的組的名稱(chēng)的一部分。
string?pointlist (string?surface_node,?string?group_name)????
返回點(diǎn)編組內(nèi)包含的所有點(diǎn)的序號(hào)列表。
float?pointdist?(string?surface_node,?float?point_num,?string?surface_node,?float?prim_num,?float?return_type)
給定一個(gè)點(diǎn)和一個(gè)面,此函數(shù)會(huì)查找該點(diǎn)和面上最近點(diǎn)之間的距離。如果<prim_num>為-1,則可以找到與任何面最近的距離。<return_type> = 0 返回最小距離。= 1 返回最小距離點(diǎn)處的u參數(shù)值。?= 2 返回最小距離點(diǎn)處的v參數(shù)值。 = 3 返回最接近的面數(shù)
string?pointneighbours?(string?surface_node,?float?point_num,?float?num_shared_prims)??
此函數(shù)列出了與指定點(diǎn)至少共享指定面數(shù)的所有點(diǎn)的序號(hào)列表。也可以說(shuō)有哪些與我共面的點(diǎn),這些點(diǎn)里面有哪些與我共享兩個(gè)面或一個(gè)面等。
float?pointavg?(string?surface_node, string?attribute, float?index)?
該函數(shù)的工作原理與點(diǎn)函數(shù)非常相似,只是它返回指定曲面節(jié)點(diǎn)中一個(gè)點(diǎn)屬性中一個(gè)元素的所有值的平均值。
string?pointpattern?(string?surface_node, string?pattern)
返回與指定條件匹配的點(diǎn)的列表。示例如下:
> pointpattern ("/obj/model/sphere1", "2-5 10-12")
返回2 3 4 5 10 11 12,假設(shè)指定的曲面節(jié)點(diǎn)存在并且有那么多點(diǎn)。
> pointpattern("/obj/model/group1", "10 group1 20")
返回名為group1的組中所有點(diǎn)的列表,以及10和20。不保證返回點(diǎn)數(shù)的順序。
2、頂點(diǎn)屬性系列

float?vertex?(string?surface_node,?float?primitive_number,?float?vertex_number,?string?attribute,?float?index)
返回一個(gè)頂點(diǎn)屬性的值。用法同"?point"。
string?vertexs?(string?surface_node,?float?primitive_number,?float?vertex_number,?string?attribute)
返回一個(gè)頂點(diǎn)屬性的值。該屬性應(yīng)為字符串類(lèi)型。
string?vertexsmap (string?surface_node,?string?attribute,?float?index)
返回指定頂點(diǎn)屬性的值。該屬性為字符串類(lèi)型。
float?vertexsnummap?(string?surface_node,?string?attribute)
返回指定頂點(diǎn)屬性的值的數(shù)量。
string?vertexattriblist?(string?surface_node)????????????????????
返回頂點(diǎn)屬性的名稱(chēng)列表。
float?vertexattribtype (string?surface_node,?string?attribute)
返回一個(gè)頂點(diǎn)屬性的數(shù)據(jù)類(lèi)型。如果未找到指定節(jié)點(diǎn)或?qū)傩?,則返回-1。屬性的數(shù)據(jù)類(lèi)型代號(hào)參見(jiàn)"pointattribtype"。
float?vertexattribsize (string?surface_node,?string?attribute)
返回一個(gè)頂點(diǎn)屬性中元素的數(shù)量。
string?vertexgrouplist (string?surface_node)?????????????
返回頂點(diǎn)編組的名稱(chēng)列表。
string?vertexgroupmask (string?surface_node,?string?pattern)
返回按一定條件檢索出的頂點(diǎn)編組的名稱(chēng)列表。<pattern>為需要檢索的組的名稱(chēng)的一部分。
3、面屬性系列

float?prim?(string?surface_node,?float?prim_number,?string?attribute,?float?index)
返回一個(gè)面屬性的值。當(dāng)給定P或Pw屬性時(shí),返回面的中心位置。
string?prims (string?surface_node,?float?primitive_number,?string?attribute)
返回一個(gè)面屬性的值。該屬性應(yīng)為字符串屬性。
string?primsmap (string?surface_node,?string?attribute,?float?index)
返回指定面屬性的值。該屬性為字符串類(lèi)型。
float?primsnummap?(string?surface_node,?string?attribute)
返回指定面屬性的值的數(shù)量。
string?primattriblist?(string?surface_node)????????????????????
返回面屬性的名稱(chēng)列表。
float?primattribtype (string?surface_node,?string?attribute)
返回一個(gè)面屬性的數(shù)據(jù)類(lèi)型。屬性的數(shù)據(jù)類(lèi)型代號(hào)參見(jiàn)"pointattribtype"。
float?primattribsize (string?surface_node,?string?attribute)
返回一個(gè)面屬性中元素的數(shù)量。
string?primgrouplist (string?surface_node)?????????????
返回面編組的名稱(chēng)列表。
string?primgroupmask (string?surface_node,?string?pattern)
返回按一定條件檢索出的面編組的名稱(chēng)列表。<pattern>為需要檢索的組的名稱(chēng)的一部分。
string?primlist (string?surface_node,?string?group_name)????
返回面點(diǎn)編組內(nèi)包含的所有面的序號(hào)列表。
float?primdist?(string?surface_node,?float?prim1_num,?string?surface_node,?float?prim2_num,?float?return_type)
返回兩個(gè)面之間的最小距離和最近點(diǎn)。<return_type> = 0 返回最小距離;= 1 返回prim1上最近點(diǎn)處的u參數(shù)值;?= 2 返回prim1上最近點(diǎn)處的v參數(shù)值; = 3 返回prim2上最近點(diǎn)處的u參數(shù)值;=4?返回prim2上最近點(diǎn)處的v參數(shù)值;
提示:僅適用于面、曲線(xiàn)和樣條曲線(xiàn)曲面。其他類(lèi)型的面將始終返回0。
string?primneighbours?(string?surface_node,?float?prim_num,?float?num_shared_pts)
列出與指定的面至少共享給定數(shù)量點(diǎn)的所有面。也可以說(shuō)有哪些與我共點(diǎn)的面,這些面里面有哪些與我共享兩個(gè)點(diǎn)或一個(gè)點(diǎn)等。
float primuv?(string?surface_node, float?prim_num, string?attrib_name, float?attrib_index,?float?u, float?v)
返回某個(gè)UV位置處的面屬性的值。當(dāng)給定P或Pw屬性時(shí),將返回(u,v)域點(diǎn)的x、y或z圖像。如果面是面類(lèi)型或圓,則忽略v。如果面是多邊形或網(wǎng)格,則u和v分別根據(jù)頂點(diǎn)數(shù)、行數(shù)或列數(shù)進(jìn)行定義。目前,只能評(píng)估二次曲面的位置屬性。
float?primduv?(string?surface_node, float?prim_num, string?attrib_name, float?attrib_index,?float?u, float?v, float?du, float?dv)
返回基元屬性的(偏)導(dǎo)數(shù)。如果面是面類(lèi)型,則忽略v和dv。如果du和dv都為0,那么就等同于primuv。
4、Detail屬性系列

float?detail?(string?surface_node,?string?attribute,?float?index)
返回一個(gè)Detail屬性的值。用法同"?point"。如果<surface_node>是當(dāng)前烘焙節(jié)點(diǎn),則此表達(dá)式可能不起作用,嘗試指定上游節(jié)點(diǎn)。
string?details?(string?surface_node,?string?attribute)
返回一個(gè)Detail屬性的值。該屬性應(yīng)為字符串類(lèi)型。
string?detailsmap (string?surface_node,?string?attribute,?float?index)
返回指定Detail屬性的值。該屬性為字符串類(lèi)型。
float?detailsnummap?(string?surface_node,?string?attribute)
返回指定Detail屬性的值的數(shù)量。
string?detailattriblist?(string?surface_node)????????????????????
返回Detail屬性的名稱(chēng)列表。
float?detailattribtype (string?surface_node,?string?attribute)
返回一個(gè)Detail屬性的數(shù)據(jù)類(lèi)型。如果未找到指定節(jié)點(diǎn)或?qū)傩?,則返回-1。屬性的數(shù)據(jù)類(lèi)型代號(hào)參見(jiàn)"pointattribtype"。
float?detailattribsize (string?surface_node,?string?attribute)
返回一個(gè)Detail屬性中元素的數(shù)量。
5、Has函數(shù)系列

float?haspoint (string?group_name, string?surface_node, float?point_num)
如果指定的點(diǎn)在指定的組中,則返回1。
float?hasprim (string?group_name, string?surface_node, float?prim_num)
如果指定的面在指定的組中,則返回1。?
float?haspointattrib (string?surface_node, string?attribute)
如果指定的點(diǎn)屬性存在,則返回1。
float?hasprimattrib?(string?surface_node,?string?attribute)
如果指定的面屬性存在,則返回1。
float?hasvertexattrib?(string?surface_node,?string?attribute)
如果指定的頂點(diǎn)屬性存在,則返回1。
float?hasdetailattrib?(string?surface_node,?string?attribute)
如果指定的Detail屬性存在,則返回1。
6、N函數(shù)系列

float?npoints (string?surface_node)
返回幾何體中的點(diǎn)數(shù)。
float?nprims (string?name)
返回曲面節(jié)點(diǎn)中的面數(shù)。
float?nvertices (string?surface_node)
返回幾何體中的頂點(diǎn)數(shù)。
float?npointsgroup (string?surface_node, string?group_name)?
返回指定組中的點(diǎn)數(shù)。
float?nprimsgroup?(string?surface_node,?string?group_name)?
返回指定組中的面數(shù)。
float?nverticesgroup?(string?surface_node,?string?group_name)?
返回指定組中的頂點(diǎn)數(shù)。
7、全局變量屬性系列

float?bbox (string?surface_node, float?type)
返回曲面節(jié)點(diǎn)的邊界框信息。<type>可以是邊界框的相應(yīng)值D_XMIN、D_YMIN、D_ZMIN、D_XMAX、D_YMAX、D_ZMAX、D_XSIZE、D_YSIZE或D_ZSIZE之一。
float?centroid (string?surface_node, float?type)
返回曲面節(jié)點(diǎn)的中心位置信息。<type>可以是中心位的相應(yīng)分量D_X、D_Y或D_Z中的一個(gè)。中心是對(duì)象邊界框的中心,而不是點(diǎn)的平均位置。
string?attriblist (string?surface_node, float?class)
返回指定屬性的名稱(chēng)列表。<class>可以是屬性類(lèi)D_VERTEX、D_POINT、D_PRIITIVE或D_DETAIL之一。
HExp12-3|Houdini Expression functions全集之Class屬性類(lèi):的評(píng)論 (共 條)
