Skip to content

attribtype

If you know the attribute class ahead of time, using detailattribtype, primattribtype, pointattribtype, or vertexattribtype may be faster.

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

<geometry>

When running in the context of a node (such as a wrangle SOP), this argument can be an integer representing the input number (starting at 0) to read the geometry from.

Alternatively, the argument can be a string specifying a geometry file (for example, a .bgeo) to read from. When running inside Houdini, this can be an op:/path/to/sop reference.

attribclass

One of "detail" (or "global"), "point", "prim", or "vertex".

You can also use "primgroup", "pointgroup" or "vertexgroup" to read from groups.

Returns

A numeric code indicating the attribute type:

-1Attribute not found, or unknown type.
0Integer
1Float or vector
2String
3Array of integers (or integer tuples)
4Array of floats (or float tuples)
5Array of strings.
6Dictionary
7Array of Dictionaries

Examples

examples

// Get the type of the position attribute of "defgeo.bgeo"
int type = attribtype("defgeo.bgeo", "point", "P");