Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodesk: Fix MaterialX shader generation for simple surface shaders like "ND_convert_color3_surfaceshader" #3045

Conversation

erikaharrison-adsk
Copy link
Contributor

Description of Change(s)

"ND_convert_color3_surfaceshader" MaterialX node fails shader generation in HdStorm

The usda file with a material fixed by this code change:

#usda 1.0

def Capsule "Capsule1" (
    prepend apiSchemas = ["MaterialBindingAPI"]
)
{
    rel material:binding = </mtl/standard_surface1>
}

def Scope "mtl"
{
    def Material "standard_surface1" (
        prepend apiSchemas = ["NodeGraphNodeAPI"]
        customData = {
            dictionary Autodesk = {
                string ldx_inputPos = "177 300.5"
                string ldx_outputPos = "955 301"
            }
        }
    )
    {
        token outputs:mtlx:surface (
            sdrMetadata = {
                string uiorder = "3"
            }
        )
        token outputs:mtlx:surface.connect = </mtl/standard_surface1/convert1.outputs:out>
        uniform float2 ui:nodegraph:node:pos = (0.055555556, 0.055555556)

        def Shader "convert1" (
            prepend apiSchemas = ["NodeGraphNodeAPI"]
        )
        {
            uniform token info:id = "ND_convert_color3_surfaceshader"
            color3f inputs:in = (1, 0, 0)
            token outputs:out
            uniform float2 ui:nodegraph:node:pos = (2.586111, 1.0666667)
        }
    }
}

Fixes Issue(s)

  • N/A
  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

…e for example "ND_convert_color3_surfaceshader"
@dgovil
Copy link
Collaborator

dgovil commented Apr 17, 2024

This would be great to land in USD. I put up a similar fix here #3016 but yours is more thorough.

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-9559

@jesschimein
Copy link
Contributor

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pixar-oss pixar-oss merged commit 8c572d1 into PixarAnimationStudios:dev Apr 29, 2024
5 checks passed
@erikaharrison-adsk erikaharrison-adsk deleted the adsk/bugfix/ND_convert_color3_surfaceshader_Fix branch July 10, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants