SOLARIS - editableStage() Namespace edits

   1866   2   1
User Avatar
Member
39 posts
Joined: Jan. 2012
Offline
I am working with the PythonLOP to do namespace edits in SOLARIS. Prunes, Renames, Re-parents etc.
I currently have this working using the below;

from pxr import Sdf

node = hou.pwd()
layer = node.editableLayer()

testEdits = [
    Sdf.NamespaceEdit('/cube1', Sdf.Path.emptyPath),
    Sdf.NamespaceEdit('/sphere1', Sdf.Path.emptyPath),
]

edit = Sdf.BatchNamespaceEdit(testEdits)
layer.Apply(edit)


This is great, and working, however, I am working within a code base using a lot of calls to pxr.Usd.
I can see in the docs they cannot be mixed in the one Pythonsop, Understandable.

More of a Usd centric question, but using the pxr.Usd libraries, is it possible to do namespace type edits? Or are the lower level API's required.

Cheers,
Aaron.
www.aaronauty.com
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
On a composed USD stage, you can't delete or rename primitives because there may be contributions from any number of layers, through any number of composition arcs. Renaming /a/b/c/d/e to /a/b/c/d/f could require editing 15 different USD layer files in very complicated ways. So there are no USD level APIs for performing this type of edit. You can make this kind of change with the Sdf APIs because they work on only a single USD layer file.
User Avatar
Member
39 posts
Joined: Jan. 2012
Offline
Yep, I get you, makes sense.

Thanks for the clarity.
www.aaronauty.com
  • Quick Links