UsdStage save prim

Hi everyone, I am trying to save USD. I set some prims to deactivated, and the exported prims will not exist in the USD scene graph. What can I do to save the deactivated prims to the scene graph?

I may be wrong! :slight_smile:

A deactivated prim is pruned from the stage and will not be included. The USD stage represents the composed result - hence it will also remove variants (if I recall correctly?), etc. because it’s just the “result” of the composition. Anything not actively there thus is not exported.

If you do not want to save the resulting stage after composition but want your layer’s changes then you should instead save or export the Sdf.Layer which does not represent the composed result.

1 Like

thank you very much! :+1:

PS. UsdStage.Save() will attempt to save all mutated layers that contribute to the composed Stage, so you don’t need to hunt them down or use the SdfLayer API’s directly.

1 Like