Hello,
I'm not sure where to find this info: is it possible, using only Python, to build a stage similar to the way stages are defined in a LOP network, where one can build and layer anonymous layers and then save them all to separate explicit paths using the USD ROP?
Here is what I would like to do:
- take the Solaris stage as an argument to a script in a Python LOP
- on this stage object, import various files, and create a USD layer for each. Add an explicit save path to each (but don't save yet!).
- build a hierarchy of layers using these imported files
- take the resulting stage output of the Python LOP, then save everything with a USD ROP
What I have tried to do so far in Python for each created layer is:
- create an anonymous layer and add prims
- create a "HoudiniLayerInfo" prim in the anonymous layer
- set the attribute "HoudiniSaveControl" to "explicit"
- set the "HoudiniSavePath" to my desired path
I hoped this parlor trick would convince Solaris to save my custom layers, but it did not seem to do so. The USD ROP just saved my root layer and ignored the anonymous ones, even though they had the save info prim embedded.
Is there a better way to do this? I'm aware I can just save the layers as I create them, but wanted to utilize the LOP output processors.
Creating explicit save layers with Python
392 2 1- jparker
- Member
- 285 posts
- Joined:
- Offline
- mtucker
- Staff
- 4438 posts
- Joined: July 2005
- Offline
One more thing you need to do to get the USD ROP to save your anonymous layers: create the anonymous layer with a "tag" argument of "LOP". This is how the USD ROP identifies layers as having been authored by the LOP network.
Note that everything else you're doing here is correct, and in fact there is a python method loputils.createPythonLayer that encapsulates all this so you don't actually need to know all these details. Just pass it the hou.LopNode that is creating the layer (hou.pwd() when inside a Python LOP) and pass in a save path where you want the layer to be saved.
Note that everything else you're doing here is correct, and in fact there is a python method loputils.createPythonLayer that encapsulates all this so you don't actually need to know all these details. Just pass it the hou.LopNode that is creating the layer (hou.pwd() when inside a Python LOP) and pass in a save path where you want the layer to be saved.
- jparker
- Member
- 285 posts
- Joined:
- Offline
-
- Quick Links