Every geometry attribute contains a data id that is incremented whenever it is modified (by at least 1). To perform optimizations that depend on whether an attribute has changed, these data ids can be cached and then compared again to see if they match at some future point in time. If they do not match, then one should assume that the contents of the attribute is no longer the same as before.
If two attributes have matching data id values, then you can assume that their
contents are the same. To preserve data id values across geometry copies, set
the clone_data_ids
parameter on such methods to True
.
This is typically used in a Python SOP to optimize operations in conjunction with setting hou.SopNode.setManagesAttribDataIds to True.
Note
The values of data ids are only valid within the same session. They cannot be compared across sessions or different running Houdini processes.
Methods ¶
__init__()
Constructs an invalid data id. This can be used as a placeholder in a list of data id’s for attributes that don’t exist.
isValid()
→ bool
Return True if this is a valid data id.
vexAttribDataId()
→ tuple of int
Return the same list of integers that the attribdataid VEX function returns for this data id. This is provided for interoperability with VEX.
__getstate__()
→ tuple of int
Return a tuple of int
that can be used for the pickle module. Note that
data id values are only valid within the same session.
__setstate__(state)
Restore the state previously obtained by __getstate__
.