OpenUSD
OpenUSD copied to clipboard
Autodesk: Fix MaterialX shader generation for simple surface shaders like "ND_convert_color3_surfaceshader"
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
- [X] I have verified that all unit tests pass with the proposed changes
- [X] I have submitted a signed Contributor License Agreement
This would be great to land in USD. I put up a similar fix here https://github.com/PixarAnimationStudios/OpenUSD/pull/3016 but yours is more thorough.
Filed as internal issue #USD-9559
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).