A robot inspection task can keep the same OpenUSD relationship target while the camera behind it changes. This happens when the task targets another relationship instead of the camera prim directly. Checking only the first path can make two different camera setups look identical in a scene audit.
A USD relationship can point to a prim or property by scene path. If it points to another relationship, forwarding lets a consumer follow that indirection to the ultimate targets. GetTargets returns the composed immediate paths. GetForwardedTargets follows relationship targets and returns the terminal paths. Use both when a task references a station-level camera assignment.
Exercise the indirection
The following in-memory stage defines two cameras and two custom relationships. The review task always points to the inspection station's activeCamera relationship. The loop retargets that station relationship and checks what the review task sees.
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateInMemory()
stage.DefinePrim("/Cell", "Xform")
station = stage.DefinePrim("/Cell/Inspection", "Xform")
task = stage.DefinePrim("/Cell/Review", "Xform")
near = UsdGeom.Camera.Define(stage, "/Cell/NearCamera")
wide = UsdGeom.Camera.Define(stage, "/Cell/WideCamera")
active = station.CreateRelationship("activeCamera")
selected = task.CreateRelationship("inspectionCamera")
assert selected.SetTargets([active.GetPath()])
for camera in (near, wide):
assert active.SetTargets([camera.GetPath()])
direct = selected.GetTargets()
final = selected.GetForwardedTargets()
assert direct == [active.GetPath()]
assert final == [camera.GetPath()]
assert stage.GetPrimAtPath(final[0]).IsA(UsdGeom.Camera)
print(str(direct[0]), str(final[0]))
In OpenUSD 0.26.11, the immediate path is /Cell/Inspection.activeCamera for both iterations. The terminal path is /Cell/NearCamera on the first iteration and /Cell/WideCamera on the second. The last assertion confirms that the resolved path names a camera prim. The custom relationships are scene data for this test. An application has to read them for them to influence an inspection or a render.
Check the resolved target against the task contract
Open the composed stage that the review consumes, including the intended layers and variant selections. Read the task relationship and record both sets of paths. If the task requires a single camera, check that it resolves to exactly one target and that the target has the camera schema. Compare its path against the camera expected for that fixture configuration. A final path on its own does not verify that the object still exists or has the right type.
When the immediate path is unchanged but the camera differs, inspect the intermediate relationship on the inspection station. If the terminal target is missing or empty, inspect both the forwarding link and the relationship that is meant to supply the camera. Preserve the immediate and terminal paths in the review so a later export can be compared without guessing which camera produced the inspection view.
Sources
OpenUSD UsdRelationship API reference for immediate and forwarded target queries
https://openusd.org/release/api/class_usd_relationship.html
OpenUSD terms and concepts glossary, relationships and forwarding
https://openusd.org/release/glossary.html