getAllMatchingChildPrims#
Fully qualified name: isaacsim::foundation::utils::getAllMatchingChildPrims
- std::vector<std::string> isaacsim::foundation::utils::getAllMatchingChildPrims(
- const std::string &path,
- std::function<bool(const std::string&)> predicate,
- bool includeSelf = false,
- std::optional<std::size_t> maxDepth = std::nullopt,
Returns all prims in the subtree rooted at
pathfor whichpredicatereturnstrue.Performs a breadth-first traversal of the default stage starting at
path. Each visited prim is tested againstpredicate; those that pass are collected into the result.When
includeSelfisfalsethe root prim itself is skipped and traversal begins with its direct children (depth 1). WhenincludeSelfistruethe root is enqueued at depth 0.When
maxDepthis set, traversal stops as soon as the current prim’s depth exceedsmaxDepth. Because the deque is ordered by depth in BFS order, all remaining items at that point are at the same or greater depth, so the entire search halts immediately.See also
getFirstMatchingChildPrim()
- Parameters:
path – [in] USD path of the subtree root on the default stage.
predicate – [in] Callable invoked with the string path of each visited prim; return
trueto include the prim in the result.includeSelf – [in] Whether to test and potentially include
pathitself.maxDepth – [in] Maximum traversal depth relative to
path, wherepathitself is at depth 0 and its direct children at depth 1.std::nulloptmeans unlimited depth. Note that depth is always counted frompathregardless ofincludeSelf, somaxDepth=0combined withincludeSelf=falsevisits no prim at all: the direct children the traversal starts from are already at depth 1. UsemaxDepth=1to visit the direct children.
- Returns:
All prim paths in BFS order for which
predicatereturnedtrue.