Feature request: usd_rop "Flatten Stage (Preserve all sublayers and references)"

   2456   2   1
User Avatar
Member
15 posts
Joined: March 2014
Offline
The usd_rop to have an additional "Save Style" called "Flatten Stage (Preserve all sublayers and references)" that flattens any node that isn't a sublayer or file reference inside the same saved USD stage file that has everything else referenced as sublayer or payload.

The current behavior:
Houdini is generating intermediate USDs that were never requested and references them in the final generated stage (this behavior is not recommended especially from a pipeline point of view), we have to have control on what files is getting generated and we have to be able to name them and decide where they will be saved before they do (and most importantly to have track of them - as with this current behavior, you don't know what are the intermediate files that will written out during the usd_rop evaluation).

The desired behavior:
usd_rop should have the ability to write just one USD stage, that has all references and sublayers written as references (not flattened), while every other user nodes like graft, transform... etc., should be flattened in the same USD stage file (rather than being written to external intermediate usd files).
Edited by Belal - Oct. 20, 2021 14:09:42
User Avatar
Staff
4452 posts
Joined: July 2005
Offline
In some sense the "Flatten Implicit Layers" is meant to provide this functionality. The problem you describe arises when you do, for example, cube -> sublayer -> sphere -> ROP. In this case, the cube and the sphere will be written to separate layers. I assume these are the unwanted intermediate layers you're referring to. The reason for this behavior is opinion strength. LOPs are designed so that LOPs further down the chain always have a stronger opinion that LOPs further up the chain. In the described setup, in order to ensure that the sphere LOP has a stronger opinion than the data loaded into the sublayer, which has a stronger opinion than the cube LOP, there _must_ be three layers.

Of course often you don't really care that much. In many situations the simpler rule is "all LOPs should have stronger opinions than all Sublayers loaded from disk. And you can do this by setting all your Sublayer LOPs to "Weakest Position" in the Sublayer Position parameter. If you do that, then unlike the normal rules of LOP strength, the cube and sphere will both have stronger opinions than the sublayer from disk. There will still be two separate layers for the sphere and cube, but they will be implicit layers that will be flattened together, and you'll only get one USD file on disk. You can also force this file-on-disk reordering after-the-fact using a Merge LOP set to "Separate Layers, File Layers Weakest" right before the USD ROP.

None of this is to deny that it might be a good idea to build this into the USD ROP. But our fear is that the strength reordering that happens only when writing out to disk might result in buggy-looking behavior when you load the file back in. At least by forcing you to do the reorderig with the Merge node you will be forced to see the effect of the strength reordering before you write the data to disk.
User Avatar
Member
15 posts
Joined: March 2014
Offline
Thanks for information, I see what you mean.

I believe that yes as you also mentioned, resolving and building all of it in the usd_rop itself would help, my aim was to be able to get a one clean scene description file that at least doesn't flatten the binary data from the incoming referenced usds/alembics into the new file for any reason but to keep them references to their original files on disk.
  • Quick Links