An inspection workflow can target a conveyor group and still omit every part underneath it. In OpenUSD, an authored collection target is an input to membership calculation. When a downstream tool consumes the collection, check the resulting member paths before interpreting an inspection image.

The expansion rule controls how a relationship-based collection treats descendants of targeted prims. The explicitOnly rule includes the specified prim paths without automatically including their children. The expandPrims rule includes those prims and expands their descendants, subject to exclusions. This distinction matters when a workcell exporter names a group and the review expects individual parts beneath it.

Test the inspection collection

The example creates a line with a workpiece, a bracket, and a calibration block. It targets the line in both cases. First it verifies that the explicit rule includes only the group. Then it expands the group and excludes the calibration block.

from pxr import Usd

stage = Usd.Stage.CreateInMemory()

cell = stage.DefinePrim("/Cell", "Xform")

line = stage.DefinePrim("/Cell/Line", "Xform")

stage.DefinePrim("/Cell/Line/Workpiece", "Xform")

stage.DefinePrim("/Cell/Line/Bracket", "Xform")

stage.DefinePrim("/Cell/Line/CalibrationBlock", "Xform")

review = Usd.CollectionAPI.Apply(cell, "inspection")

review.CreateIncludesRel().SetTargets([line.GetPath()])

rule = review.CreateExpansionRuleAttr()

def members():

query = review.ComputeMembershipQuery()

return {str(p) for p in Usd.CollectionAPI.ComputeIncludedPaths(query, stage)}

rule.Set(Usd.Tokens.explicitOnly)

assert members() == {"/Cell/Line"}

rule.Set(Usd.Tokens.expandPrims)

review.CreateExcludesRel().SetTargets(["/Cell/Line/CalibrationBlock"])

assert members() == {

"/Cell/Line", "/Cell/Line/Workpiece", "/Cell/Line/Bracket"

}

print(sorted(members()))

In OpenUSD 0.26.11, the first query returns only /Cell/Line. The second returns the line, the workpiece, and the bracket. The calibration block still exists on the stage. Only its membership in this collection changes. This example uses placeholder transforms and does not render the scene.

Check the paths used downstream

Run the membership query on the composed workcell stage used by the inspection tool. Save the collection path, expansion rule, and resolved member paths alongside the inspection configuration. Compare the actual list to the expected paths for the current fixture revision. A count alone can miss a swap where one included object replaces another. If the consumer needs geometry rather than group nodes, apply its geometry criteria to the resolved prims.

When a component is missing, check whether its parent was targeted without descendant expansion, or whether an exclusion covers its path. If the membership is correct but the object still does not appear, check whether the consuming tool uses that collection and whether visibility and render filters allow the object to appear. Collection membership establishes selection for a consumer that reads it.

Sources

OpenUSD UsdCollectionAPI reference, relationship expansion and membership queries

https://openusd.org/release/api/class_usd_collection_a_p_i.html

OpenUSD collections and patterns guide, relationship-based collections

https://openusd.org/release/user_guides/collections_and_patterns.html