Hi All!
I’m trying to standardize a process for taking thumbnail images of USD scenes. Once hiccup I’ve run into is when the scene has a different up axis. I’d like to standardize this process to always adjust the incoming scene to be Y-up. It seems to me there is a simple way of using references or sublayers with an Xform to do this but I can’t find it. Here is what I’ve tried and where I’m at right now:
- Idea: Sublayering: I’ve tried sublayering the Z-up file in a new USD file, and adding a defaultPrim which performs the rotation I want
- Result: this ends up rotating the stage itself to open correctly (Y-up) but the geometry stays in it’s original orientation
- Idea: Creating a root Xform to wrap all top layer prims: I’ve taken all top level prims and put them in a new Root Xform prim that performs the rotation
- Result: the geometry ends up correct in this case however all my material references become broken because my material binding paths are all broken. The USD files I’m currently working through come from Blender which exports all the materials in a _materials node at the top level, so I’m also putting this _materials node under Root so my bindings look like
rel material:binding = </_materials/myMaterial>
but the path is wrong and should berel material:binding = </Root/_materials/myMaterial>
- Idea: Exclude top level materials from the root node: I tried to do the same as Idea 2. but exclude the _materials node, thinking that then all my bindings would still be correct.
- Result: This did not work and I get this error when opening up my stage in usdview:
Warning: ...</Root/myGeometry.material:binding>: The relationship target </_materials/myMaterial> from </myGeometry.material:binding> in layer @Z-up.usdz@ refers to a path outside the scope of the reference from </Root/myGeometry>. Ignoring. (getting targets for relationship </Root/myGeometry.material:binding> on stage @y_up.usda@)
- Idea: Do the same thing as 2, but find all the material references and fix them (prepend Root to them):
- Result: This approach is working but feels inefficient and wrong because _materials won’t always be at the top level, but searching for all of those also seems like overkill
Am I missing some usage / syntax of referencing or sublayering that would fit nicely here?
Thanks for any help!