Hello,
I am trying to find a way to reparent a prim under another prim in a loaded stage. Basically, I want to insert a new Xform in the middle of the hierarchy, so I am trying to define the new Prim and the reparent all the children under the new Prim, but I cannot find any function to reparent a prim with the python API.
Is there a way to do it? If it’s not in Python, is there a way in C++ to do it?
And I ask because in USD 24.05 you can, in python, create a Usd.NamespaceEditor object for your stage that will allow you to reparent, move, and rename prims defined in any layer of your root layerStack. And soon, that “root layerStack” restriction will be lifted.
Thanks a lot spiff!
I am using blender 4.1 which contains USD 23.11 and all the prims are in the root layer, it’s a pretty simple case.
Is there a way to do those operations in that version of USD?
Hi,
If you are using USD/Hydra 2.0 with scene indices (instead of scene delegates), there is a scene index named “UsdImagingRootOverridesSceneIndex” which has been designed to add a transform and visibility attributes which will propagate to all prims from another child scene index.
Regards,
David
Note that these will start changing PrimSpec opinions across the layers, and hence may influence many layers - potentially spanning across layers, references, payloads, etc.