Hi,
In order to control the visibility and transform of all prims from a usd stage in Hydra 2.0, we use a UsdImagingRootOverridesSceneIndex and we add a HdFlatteningSceneIndex (only for visibility and xform) to apply this to all prims of the stage.
The problem we get is that this adds a visibility and xform attributes to all kinds of primitives from the stage, including materials, which doesn’t make sense in this case.
This should be applied to any primitive that supports xform attributes (geometries, camera, lights etc).
Anyone sees a way to do this properly in Hydra 2.0 ?
We cannot add a filtering scene index that would remove the primitives that don’t make sense since the scene index chain continues and more scene indices are applied after these scene indices.
I am thinking about subclassing the flattening scene index to ignore some types of primitives. Unfortunately my experience with checking a primitive type is that it proved to be very slow as we must call GetPrim to get the prim and check its type, which triggers the whole chain in cascade calling the GetPrim and possibly re-applying changes if they are not cached and with a consequent scene indices chain, this has proven to be very slow…
Regards,
David