partial sublayering

   2352   6   0
User Avatar
Member
26 posts
Joined: June 2022
Offline
hi,

not sure if im overlooking something simple but im struggling to come up with a good solution to layer
overrides selectively.

say i have a sphere and a cube and im making the sphere red and cube green. thats the first layer.
the second layer has an override to make the sphere green and cube blue.
is there a way to sublayer the second layer in a way that makes the cube blue but leaves the sphere red?
a way to block the property coming in from the second layer based on a primitive pattern.

i could achieve that with the graft branches, but id like to avoid flattening. not sure if thats possible.

thanks.
User Avatar
Member
7849 posts
Joined: Sept. 2011
Offline
Use a reference to get only the primitive you want from the layer.
User Avatar
Member
26 posts
Joined: June 2022
Offline
thanks for the suggestion. i tried that, but it seems the reference node wont read my layer if it contains only overs?
User Avatar
Staff
4458 posts
Joined: July 2005
Offline
There is no problem referencing in pure "over" prims. Just make sure to put the reference on /cube, and also set the "reference prim" (the root of the scene graph to reference onto /cube) to /cube.
User Avatar
Member
26 posts
Joined: June 2022
Offline
Thanks Mark, working and this makes total sense. Now i cant figure out how to remove the opinion from the sublayer so the reference would be strong enough to overrride it.

https://www.sidefx.com/forum/topic/74892/ [www.sidefx.com]

was searching around and found that. Is that relevant to this as well, meaning there is not a node based way to remove the property?

Load layer and referencing the original layer in works. But i guess a python lop is the only way to make it work with a sublayer node?
Edited by spektra - July 9, 2022 08:35:21
User Avatar
Staff
4458 posts
Joined: July 2005
Offline
Right. Opinion strength is definitely going to make this more complicated. There's no single answer to this, because it depends very much on what you want the ouput of this process to be. But I am fairly sure that other thread is not relevant. You don't want to have to "knock out" opinions on eac prim before adding the reference. This isn't even going to be possible if the original prim is coming from disk.

So either you need to load the "base" prim definition through a reference instead of a sublayer (to make the base opinions weaker), or you need to find some way to make the overlay opinions stronger. The latter probably can work in more situation with only local modifications to your pipeline, so I'll only talk about that. I think the best thing to do would actually be to use a sublayer LOP to load the whole layer of overlay opinions, but don't put that inline with the real stage. Instead, use a Graft Branches LOP to "graft" the opinions from one prim of the overlay layer into the main stage. Opinions brought in through Graft Branches will be of sublayer strength and so should override the base opinions.

The downsides of this approach are that it is slower than letting USD do the reference, and when you save the USD to disk (if you need to save it to disk), the grafted opinions will be saved into a new layer. The connection to the original overlay layer will be lost. If you change the overlay layer, you'll need to re-run the LOP network to apply those new overlay opinions to the output USD that feeds down the pipeline. Of course this doesn't matter if you are going straight to rendering from this LOP network.

The upside is that it will give you the result you want
User Avatar
Member
26 posts
Joined: June 2022
Offline
Got it. We will go with the base layer as reference option. Thanks a lot for the explanation.
  • Quick Links