How to extract lights to a single usd file?

   1449   3   0
User Avatar
Member
918 posts
Joined: March 2014
Offline
We have a stage where lights live in /lights but also with assets. E.g. /assets/lamp/lights

Now we're looking for a way to prune every thing else in the graph and write out a lights_all.usd
So far we've set a prune to prune by type lights and prune unselected. However, there remain primitives like /materials which is now empty. As a result, loading lights_all.usd into a stage this empty /materials primitive is layered over an existing /materials, causing all materials to disappear.

Any help and USD thoughts/mindset is very welcome.
User Avatar
Member
918 posts
Joined: March 2014
Offline
Alright, I managed to accomplish this by using a configure stage LOP.
It set it to populate primitive %type:Light and wrote to disk with USD ROP set to flatten the stage.
User Avatar
Staff
4444 posts
Joined: July 2005
Offline
If you are creating the lights in a LOP Network, you can use the Layer Break LOP to split out the light-containing layer into its own entity that can be written out by itself with a USD ROP.

If you already have a USD file with the lights, materials, and geometry merged together in a single layer, then the Configure Stage approach you mentioned is the right way to go.
User Avatar
Member
127 posts
Joined: Feb. 2021
Offline
If you want only the lights, and absolutely nothing else, you can also use the graft branches node with only the right side input, select the lights group, and write that out.
Another way in 19 is to use restructure scenegraph to get what you want.
Andreas Weidman
VFX Supervisor - Dupe VFX
www.dupevfx.com
  • Quick Links