Two renders of the same robot inspection setup can use different light settings even when the referenced asset file is identical. Before changing the asset, read the actual value on the composed review stage. Then inspect the property stack to see where the review's override came from.
An OpenUSD attribute may receive opinions from several layers. Get resolves its value at the requested time code. GetPropertyStack lists the contributing property specs in strength order for diagnosis. A spec may provide metadata without providing the requested value. Use the resolved value for the measurement and the stack to locate the layers worth inspecting.
Test a temporary inspection override
This in-memory example defines a custom scalar on a reusable lamp. The review references the lamp and authors an override in the review stage's session layer. The scalar is a test value without physical illumination units, so the check does not require a renderer.
from pxr import Sdf, Usd
rig = Usd.Stage.CreateInMemory()
lamp = rig.DefinePrim("/Lamp", "Xform")
lamp.CreateAttribute("testLevel", Sdf.ValueTypeNames.Float).Set(0.4)
rig.SetDefaultPrim(lamp)
review = Usd.Stage.CreateInMemory()
mounted = review.DefinePrim("/ReviewLamp", "Xform")
assert mounted.GetReferences().AddReference(
rig.GetRootLayer().identifier
)
level = mounted.GetAttribute("testLevel")
def reading():
return round(level.Get(), 3)
assert reading() == 0.4
with Usd.EditContext(review, review.GetSessionLayer()):
assert level.Set(0.7)
assert reading() == 0.7
assert level.GetPropertyStack()[0].layer == review.GetSessionLayer()
assert level.Clear()
assert reading() == 0.4
print(reading())
The assertions pass in OpenUSD 0.26.11. The review reads 0.4 from the referenced asset before the override. It reads 0.7 while the session opinion is present, and the session spec appears first in the stack. Clearing that value in the session edit target lets the reference's 0.4 resolve again. The example queries the default value because both opinions are authored as defaults.
Apply the check to a review stage
Start with the stage the renderer or inspector actually opens. Record the attribute path, asset revision and session state. For animation, query the numeric time code that produced the image. A call with no time argument queries the default and can miss time-sampled behavior. When the value differs from the expected one, log the resolved value and inspect the property stack at the same time. If a review-specific layer supplies the override, identify that opinion before making a durable asset edit.
Keep the stage setup, the exact time code and the resolved attribute value with the inspection image. Render again from the same configuration after correcting the relevant opinion. Matching the scalar establishes that the expected setting resolved on the scene. Check exposure, light geometry and renderer settings separately if the resulting image still differs.
Sources
OpenUSD UsdAttribute API reference, reading and clearing values
https://openusd.org/release/api/class_usd_attribute.html
OpenUSD UsdProperty API reference, strength-ordered property stack diagnostics
https://openusd.org/release/api/class_usd_property.html