Is there a way to make edits to a USD scene in Houdini and then bake those changes into the original USD file that was referenced, rather than saving them out as a separate layer? Or if not, can layers be flattened together in a way that bakes in the changes from one layer to the other but still preserves the references beneath them?
I'm hoping to use USD as a common interchange format so I can read, edit, and write scenes to the same set of files in Maya, UE4 and Houdini. In UE4 you can load a USD scene, move objects around, and then save the USD scene and those changes will baked into the layer, so I'm hoping I can do the same thing in Houdini. I want to preserve references to USD asset files though, so right-clicking on a node and hitting Save > Flattened Stage isn't the solution I'm looking for. I am very new to USD and I am only just barely starting to wrap my head around it, so any help with this would be greatly appreciated!
Destructive Layer Editing And/Or Flattening Override Layers
4530 5 2-
- JacobReuling
- Member
- 2 posts
- Joined: Jan. 2019
- Offline
-
- jsmack
- Member
- 8177 posts
- Joined: Sept. 2011
- Online
-
- tamte
- Member
- 9362 posts
- Joined: July 2007
- Offline
I'm not sure you want to do that
how would you handle animated usd files? Saving into the same file that you are streaming from? using Cache LOP maybe, but it's always risky to overwrite your source file
for static ones it may work, did you try?
USD ROP has options for Save Style to choose how to flatten the layers and whether to preserve references
how would you handle animated usd files? Saving into the same file that you are streaming from? using Cache LOP maybe, but it's always risky to overwrite your source file
for static ones it may work, did you try?
USD ROP has options for Save Style to choose how to flatten the layers and whether to preserve references
Edited by tamte - March 4, 2020 19:01:16
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- JacobReuling
- Member
- 2 posts
- Joined: Jan. 2019
- Offline
jsmackThe load layer node did the trick! It brings in the .usd file without grouping it under a reference layer, so right-clicking and hitting Save > Active Layer on a node downstream will write the whole layer to disk rather than just the changes made to it as a separate one. Thank you!
I think the stage manager, load layer, and edittargetlayer can help with the kind of destructive edits that preserve reference arcs.
tamte
I'm not sure you want to do that
how would you handle animated usd files? Saving into the same file that you are streaming from? using Cache LOP maybe, but it's always risky to overwrite your source file
for static ones it may work, did you try?
USD ROP has options for Save Style to choose how to flatten the layers and whether to preserve references
Right now, I just want to learn how to use USD for constructing a scene before I actually do anything with it like animation. I'm thinking of it like deleting Construction History in Maya; it's not always needed, especially when I'm still in the middle of modeling, and when it isn't helping it just bogs things down. I'm aiming for a workflow where I can model props and setpieces in Maya, use Houdini for set dressing with its nifty physical movement tool which I need to learn how to work, and use UE4 for realtime lookdev/lighting, every program modifying the same file or set of files until I have an environment fully fleshed out and ready to animate in. Then I will start using the layering system properly, but for now I am just one person so I don't need every tweak I make to a scene as I'm creating it to be fully procedural and sequestered into its own file.
Edited by JacobReuling - March 4, 2020 19:25:13
-
- tamte
- Member
- 9362 posts
- Joined: July 2007
- Offline
that makes sense, but still I'd refrain from saving to the same file, whether animated or not
since lops are procedural it doesn't make sense to overwrite your source files
the same way as you may not want to read geo in SOPs modify and output to the same file (except for specific feedback cases)
anyway, as mentioned Flattening options are there for you if you wish to “delete history” of the LOPs editing
since lops are procedural it doesn't make sense to overwrite your source files
the same way as you may not want to read geo in SOPs modify and output to the same file (except for specific feedback cases)
anyway, as mentioned Flattening options are there for you if you wish to “delete history” of the LOPs editing
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- ubietyworld
- Member
- 21 posts
- Joined: Nov. 2022
- Offline
I'm building a giant library of materialx materials, and I finally got it all to the point where it's perfectly organized as visible in the stage context geometry spreadsheet. It's organized into a big hierarchy of material types, for instance I might have something like Military>Metal>Painted>Dark>"A Material Appropriate For this Surface" or Civilian>Fabric>Patterned>Dark>"Another Material Appropriate For This Other Surface", which allows me to batch apply varied materials to a whole bunch of vehicles and have it grab the surface materials from the appropriate material type and still get a decent amount of variation.
I'm using ComfyUI to build out a very large library of such materials, all based on the seed of the material structures that exist across various free assets.
Anyways so as I was saying I was able to get all completely organized, and I did that by using a "Restructure Scene Graph" node to do the various organizational operations that I needed (reparent, duplicate, delete, etc), exporting it with a USD ROP to a USDA file and immediately re-loading it back in at the top of the operation somewhat frequently, because the whole situation is quite unstable and I was dealing with a whole lot of crashes and file corruptions that meant that I couldn't actually do this whole thing procedurally in one single flow since any procedural network at this scale would randomly destroy itself or at the very least fail to save until I deleted particular nodes (the worst offender was the "restructure scene graph". Even one of those things inside the project would make it impossible to save it. The second you delete it, it saves fine).
I slogged through it all and then when I export it from the USD ROP for what I thought was the last time, making sure to use the "Flatten Stage (Collapse all Sublayers and References)" option, which I took to mean that it would get rid of all the history and less strong layers, and then I open up the USDA file I end up with something like 12 million lines in the file, and then when I dive in I notice that there are like 20k references for individual materials. For example I have 19818 references to my "japanese_zelkova_bark" material, which is way beyond what can possibly be necessary and I can only assume it's because it's still recording every single operation despite me telling it to "Flatten Stage" when I'm saving these things out? and the result is an exponential increase in references to the one thing? I can't find anything else on the USD ROP that seems to indicate that it would get rid of the editing history, and your post above seems to indicate that there should be and in fact the "Flatten Stage" is the right one to use. Any guess as to what I'm doing wrong here?
I'm using ComfyUI to build out a very large library of such materials, all based on the seed of the material structures that exist across various free assets.
Anyways so as I was saying I was able to get all completely organized, and I did that by using a "Restructure Scene Graph" node to do the various organizational operations that I needed (reparent, duplicate, delete, etc), exporting it with a USD ROP to a USDA file and immediately re-loading it back in at the top of the operation somewhat frequently, because the whole situation is quite unstable and I was dealing with a whole lot of crashes and file corruptions that meant that I couldn't actually do this whole thing procedurally in one single flow since any procedural network at this scale would randomly destroy itself or at the very least fail to save until I deleted particular nodes (the worst offender was the "restructure scene graph". Even one of those things inside the project would make it impossible to save it. The second you delete it, it saves fine).
I slogged through it all and then when I export it from the USD ROP for what I thought was the last time, making sure to use the "Flatten Stage (Collapse all Sublayers and References)" option, which I took to mean that it would get rid of all the history and less strong layers, and then I open up the USDA file I end up with something like 12 million lines in the file, and then when I dive in I notice that there are like 20k references for individual materials. For example I have 19818 references to my "japanese_zelkova_bark" material, which is way beyond what can possibly be necessary and I can only assume it's because it's still recording every single operation despite me telling it to "Flatten Stage" when I'm saving these things out? and the result is an exponential increase in references to the one thing? I can't find anything else on the USD ROP that seems to indicate that it would get rid of the editing history, and your post above seems to indicate that there should be and in fact the "Flatten Stage" is the right one to use. Any guess as to what I'm doing wrong here?
tamte
that makes sense, but still I'd refrain from saving to the same file, whether animated or not
since lops are procedural it doesn't make sense to overwrite your source files
the same way as you may not want to read geo in SOPs modify and output to the same file (except for specific feedback cases)
anyway, as mentioned Flattening options are there for you if you wish to "delete history" of the LOPs editing
Edited by ubietyworld - Oct. 14, 2025 16:55:58
-
- Quick Links


