# Material bindings disappear in scene indices

**URL:** <https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939>\
**Category:** Hydra\
**Created:** [October 24, 2024, 1:16pm UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939 "2024-10-24T13:16:37Z")\
**Posts on this page:** 5\
**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:** [October 24, 2024, 1:16pm UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939/1 "2024-10-24T13:16:37Z")

</div>

Hi,

Summary :  
I have a problem when assigning a material to a usd prim that didn’t have any material previously, the material bindings get removed by a scene index.

More context :  
This is with usd 24.08 with Hydra 2.0 under Windows.  
Under maya, I create a usd stage with one geometry and I am assigning a usd preview surface to it. I use Storm as the renderer in maya-hydra.  
It gives the following stage :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/bb957ca3a74258c75b3deec201dbdfc7c23f66c3.png)

The problem I get is that the material is not displayed under Storm because the material bindings (usd and hydra) are “eaten” by one of the scene indices.

To convert the usd stage to hydra with scene indices, I call UsdImagingCreateSceneIndices and use an overridesSceneIndexCallback where we add a UsdImagingRootOverridesSceneIndex.  
The code can be seen in :

> <https://github.com/Autodesk/maya-hydra/blob/a85ac84f425224463201718a16490c4f37101c98/lib/flowViewport/API/perViewportSceneIndicesData/fvpDataProducerSceneIndexDataBase.cpp#L98>

The problem I see when looking at the stage through the Hydra scene brower is that the material bindings are missing :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/40bb1473d19ab2d881e19312f8b749faed6a54ab.png)

We use quite a big scene index chain which can be seen on :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/a0a5f5354987c2f0f5028536ec69e8637375c3e5.png)

And by going through them one by one starting at the UsdImagingStageSceneIndex, I can see that the direct material bindings are present :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/19c4e9b162fe144665a441f1acaba909a4323bac.png)

There are still present in the chain until UsdImaging\_NiPrototypeSceneIndex, then they disappear in the Flattening scene index which is highlighted :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/7a68589768c20c7f5ecdb4a717bd1beacdf2b9ea.png)

And they are no longer present in the chain after that scene index :

 ![image](https://us1.discourse-cdn.com/flex016/uploads/aousd/original/1X/2104a051d7e2f2fa8853c8f3a3fa640bb4b5db43.png)

Is there a way for us to prevent the material bindings from being removed ?  
I haven’t found a way to be sure where this problem comes from, I mean if it could be caused by some of the scene indices we use in maya hydra. I removed the rootoverride scene index and custom prefixing scene index, but it didn’t change anything.

Would someone have any clue about how to fix this ?  
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:** [November 18, 2024, 10:28am UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939/2 "2024-11-18T10:28:12Z")

</div>

I am guessing this is somehow related to UsdShadeTokens-\>strongerThanDescendants / UsdShadeTokens-\>weakerThanDescendants …

---

<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:** [November 18, 2024, 1:11pm UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939/3 "2024-11-18T13:11:19Z")

</div>

I confirm that the fix is to call :  
`UsdShadeMaterialBindingAPI::SetMaterialBindingStrength(usdrelationship, UsdShadeTokens->strongerThanDescendants);`  
before :  
` auto bindingAPI = UsdShadeMaterialBindingAPI::Apply(prim);`

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:** [June 10, 2025, 12:23pm UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939/4 "2025-06-10T12:23:14Z")

</div>

Currently we still have no solution for this problem as changing the relationship with strongerThanDescendants is not a viable solution, we shouldn’t have to do that.

---

<div class="post-metadata">

**Author:** ![CyrilADSK](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@CyrilADSK](https://forum.aousd.org/u/CyrilADSK)\
**Post date:** [June 25, 2025, 9:18am UTC](https://forum.aousd.org/t/material-bindings-disappear-in-scene-indices/1939/5 "2025-06-25T09:18:04Z")

</div>

Hi David,

I logged a similar issue here, [Missing material binding on propagated prototype · Issue #3690 · PixarAnimationStudios/OpenUSD · GitHub](https://github.com/PixarAnimationStudios/OpenUSD/issues/3690). It happens only when the USD prim is marked instanceable.
