AcademySoftwareFoundation / MaterialX

MaterialX is an open standard for the exchange of rich material and look-development content across applications and renderers.
http://www.materialx.org/
Apache License 2.0
1.87k stars 352 forks source link

MaterialXGenShader(ShaderGraph) : Enumeration values do not remap to integers #1268

Closed MasayaNikaido closed 1 year ago

MasayaNikaido commented 1 year ago

When ShaderGraph::create() calls with an element of type Node, enumeration input values do not remap to integers. Is remapEnumeration() necessary here? https://github.com/AcademySoftwareFoundation/MaterialX/blob/b24e9dd16624fe2d09aa167f03a8154b8589b24e/source/MaterialXGenShader/ShaderGraph.cpp#L730-L737

MasayaNikaido commented 1 year ago

Additionally, addDefaultGeomNode() is required here, but inputSocket->makeConnection() is not required in this case.

https://github.com/AcademySoftwareFoundation/MaterialX/blob/b24e9dd16624fe2d09aa167f03a8154b8589b24e/source/MaterialXGenShader/ShaderGraph.cpp#L759-L763

niklasharrysson commented 1 year ago

Thank you @MasayaNikaido for reporting these issues. I can reproduce the problem and I'm working on a fix.

MasayaNikaido commented 1 year ago

Thank you for your quick improvement. It's working as expected.

jstone-lucasfilm commented 1 year ago

Thanks to @MasayaNikaido for this report, and to @niklasharrysson for the fix!