I'm making optimizations to our USD scene structure, and the asset structure goes something like this:
asset (assembly, instanceable)
- payload_a (component)
- payload_b (some other component)
In the main stage, I would reference these assets in. And within Houdini, I start with a Configure Stage to load nothing at first, then using another Configure Stage, I try loading the component with a prim pattern "%kind:component". This works great for non-instanceable prims, but it stops working when the prims are instanceable. The traversal seems to stop at the instances.
I did a quick experiment in Python, and it shows the desired behavior is possible via a modified traversal predicate:
rules = Usd.StageLoadRules.LoadNone() predicate = Usd.PrimIsActive & Usd.PrimIsDefined predicate = Usd.TraverseInstanceProxies(predicate) for prim in stage.Traverse(predicate): model = Usd.ModelAPI(prim) if model.GetKind() == "component" and prim.HasPayload(): rules.LoadWithDescendants(prim.GetPath()) stage.SetLoadRules(rules)
This works well on very complicated stages as well. It took only about 0.1 second. I included the full script in the attachment.
Does anyone know if something like this possible in Solaris? I could do this via a Python node, but the stage seems to remember the rules for other nodes as well. Thanks!