# Scene index chain question

**URL:** <https://forum.aousd.org/t/scene-index-chain-question/626>\
**Category:** Hydra\
**Created:** [September 8, 2023, 9:34am UTC](https://forum.aousd.org/t/scene-index-chain-question/626 "2023-09-08T09:34:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlanier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dlanier/32/166_2.png) [@dlanier](https://forum.aousd.org/u/dlanier)\
**Post date:** [September 8, 2023, 9:34am UTC](https://forum.aousd.org/t/scene-index-chain-question/626/1 "2023-09-08T09:34:02Z")

</div>

Hi,

I was wondering what are the best practices with a scene index chain in the following case :  
SceneIndexA --\>FilteringSceneIndexB --\>FilteringSceneIndexC  
So scene index A provides some Rprims, and Scene index B and C are filtering scene indices.  
So the only one having been added to the render index is FilteringSceneIndexC as it’s the end of the chain.

And, say FilteringSceneIndexB is provided by a custom maya node from an HdSceneIndexPlugin::\_AppendSceneIndex callback.  
When my maya node gets deleted, I would expect not to see any impact any more from it in the rendering. So FilteringSceneIndexB should be disabled or deleted/null’ed.  
But what happens if I delete/null it ? I think it will break the chain, right.  
And if in another case I delete FilteringSceneIndexC everything will be removed from from the renderin index, right ?  
So, is that a rule of thumb to say we should rather disable FilteringScene Indices but never remove them from a chain ?  
Thank you.  
Regards,  
David

---

<div class="post-metadata">

**Author:** ![dlanier](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/dlanier/32/166_2.png) [@dlanier](https://forum.aousd.org/u/dlanier)\
**Post date:** [September 8, 2023, 12:45pm UTC](https://forum.aousd.org/t/scene-index-chain-question/626/2 "2023-09-08T12:45:17Z")

</div>

1. Working on this and trying to disable a filtering scene index with a custom bool member variable.  
How when it’s enabled/disabled can I tell the scene index that everything that is filtered needs to be dirtied ? I can store the filtered prims list but which locator should I use for the \_DirtyPrims call ?  
I am not supposed to know the prim type though I could store it as well.

2. Kind of a similar question to the first post in this thread. If instead of a filtering scene index I have a maya node that holds a retained scene index which injects new prims in the rendering. When it gets deleted, in term of performance : what is the best way to disable/remove the prims from it ?  
a) Remove the scene index from the render index ?  
b) Set its prims as invisible with an attribute ?  
c) Remove the prims from the scene index but leave the scene index in the render index ? As if the user does an undo on the deleted maya node, I will have to re-enable everything in the rendering.  
d) Any other option you can see ?

Thank you.  
Regards,  
David
