_resolvePrim#

Fully qualified name: usd_optimize::_resolvePrim

bool usd_optimize::_resolvePrim(
const PXR_NS::UsdStageWeakPtr &usdStage,
const PXR_NS::UsdPrim &prim,
std::set<PXR_NS::UsdPrim> *primsSet,
bool checkParents = true,
)#

This is a helper function for _resolveExpressionsToPrims.

It takes a specific prim and filters it out based on various conditions (invalid, /, a camera, etc). If it is valid it will be appended to prims. If specified, a uniqueness check will be done on primsSet to ensure duplicate prims are not added.

If enabled, checkParents will check all the ancestors of a prim to see if they are a type we would normally filter or prune, like a Camera or Light. These prims can have descendants that are meshes or xforms, but generally speaking, we don’t want to touch these in Usd Optimize operations. Note that this is expensive, so calling code that is already traversing and can prune should do that and disable this argument.

Parameters:
  • usdStage – The stage the prim exists in

  • prim – The prim

  • primsSet – Optional set for uniqueness

  • checkParents – If specified, check ancestors to see if they are a camera/light.

Returns:

Whether the prim was valid and added to prims.