Usage ¶
getMaterialNodeIdsOnFaces(session
: hapi.Session, geometry_node_id
: int
, part_id
: int
, start
: int
, length
: int
) → (bool
, list
of int
)
Get material ids by face/primitive. The material ids returned will be valid as long as the asset is alive. You should query this list after every cook to see if the material assignments have changed. You should also query each material individually using hapi.getMaterialInfo to see if it is dirty and needs to be re-imported.
session
The session of Houdini you are interacting with. See hapi.Session for more on sessions. Pass None to just use the default in-process session.
geometry_node_id
The geometry node id.
part_id
The part id.
start
The starting index into the list of faces from which you wish to get the material ids from. Note that this should be less than hapi.PartInfo.faceCount.
length
The number of material ids you wish to get. Note that
this should be at most:
hapi.PartInfo.faceCount - start
.
Returns a tuple of (are_all_the_same, material_ids_array).