_hashPrim#
Fully qualified name: usd_optimize::_hashPrim
- size_t usd_optimize::_hashPrim(
- const PXR_NS::UsdStageWeakPtr &usdStage,
- const PXR_NS::UsdPrim &prim,
- HashCache *cache,
- const IncludeAttrValueFn &includeFn,
Calculate a hash for a prim.
Attempts to calculate the hash of a prim. The names of the prim and its children are not considered. All authored attributes are included, however connections are handled by hashing the connection property name and the hash of the prim the connection is to. This is intended to allow comparing e.g. shading networks that may be the same but have different internal relationship names etc.
An optional filter function can be specified to skip attribute values. This allows considering prims equal if they have the same attributes, in the case you don’t care what the values of those attributes are. Note that this affects what is put in the HashCache, so changing the includeFn but using the same cache instance would result in hashes that don’t match.
This function is recursive and will hash the prim along with all of its descendants.
- Parameters:
usdStage – The usd stage
prim – The prim to hash
cache – Optional cache to track prims that were already hashed
includeFn – Optional function to allow ignoring attribute values in the hash
- Returns:
The calculated hash