NodeGraph inputs not triggering Material refresh in Hydra

I encountered issue described on github Missing refresh after changing NodeGraph attribute value · Issue #2128 · PixarAnimationStudios/OpenUSD · GitHub
where changing NodeGraph input inside Material is not triggering Hydra refresh.

Example Material with NodeGraph:

#usda 1.0

def Capsule "Capsule1" (
    prepend apiSchemas = ["MaterialBindingAPI"]
    rel material:binding = </mtl/UsdPreviewSurface1>

def Scope "mtl"
    def Material "UsdPreviewSurface1"
        token outputs:surface.connect = </mtl/UsdPreviewSurface1/NodeGraph1.outputs:surface>
        def NodeGraph "NodeGraph1"
            color3f inputs:diffuseColor = (0.872, 0.5327, 0)
            token outputs:surface.connect = </mtl/UsdPreviewSurface1/NodeGraph1/UsdPreviewSurface1.outputs:surface>
            def Shader "UsdPreviewSurface1"
                uniform token info:id = "UsdPreviewSurface"
                color3f inputs:diffuseColor.connect = </mtl/UsdPreviewSurface1/NodeGraph1.inputs:diffuseColor>
                token outputs:surface

Without the fix from the github another way to make Material update is to connect NodeGraph inputs to Material inputs.

The question I have is whether other studios use nested NodeGraphs with inputs? If yes, it’s strange that this went unnoticed for long time. Is this USD structure looks sensible or another Material structures were designed to be used?

– ievgen

Hi ievgen,

Thanks for pointing this out; we’ll take a look at the issue and try to get this fixed.

There are a lot of ways to structure material networks in USD, depending on how you want to encapsulate things. We don’t want to be prescriptive, but it does mean there are lots of edge cases to chase down.