跳转到内容

nuniqueval

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

返回某个属性所有值中不重复值的数量。 您可以使用uniqueval来遍历这些唯一值集合。

<geometry>

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

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

attribclass

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

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

示例

测试点属性 foo的所有值是否都是唯一的

int test = nuniqueval(0, "point", "foo") == npoints(0)