跳转到内容

attribtype

如果提前知道属性类别,使用 detailattribtypeprimattribtypepointattribtypevertexattribtype 可能会更快。

int  attribtype(<geometry>geometry, string attribclass, string attribute_name)

<geometry>

在节点上下文(如 wrangle SOP)中运行时,此参数可以是一个整数,表示要读取几何体的输入编号(从0开始)。

或者,该参数也可以是一个指定几何体文件(例如 .bgeo)的字符串。在 Houdini 内部运行时,可以是 op:/path/to/sop 引用。

attribclass

可以是 "detail"(或 "global")、"point""prim""vertex" 之一。

也可以使用 "primgroup""pointgroup""vertexgroup"从组中读取

返回值

表示属性类型的数字代码:

-1未找到属性或未知类型
0整数
1浮点数或向量
2字符串
3整数数组(或整数元组)
4浮点数数组(或浮点数元组)
5字符串数组
6字典
7字典数组

示例

// 获取 "defgeo.bgeo" 中位置属性 P 的类型
int type = attribtype("defgeo.bgeo", "point", "P");