Skip to content

Commit e38fcf8

Browse files
committed
Fix up node creation and node instance interface input value assignment.
1 parent 655bd40 commit e38fcf8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

source/MaterialXGenShader/ShaderGraph.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,14 @@ ShaderGraphPtr ShaderGraph::create(const ShaderGraph* parent, const string& name
576576
if (nodeInput)
577577
{
578578
ValuePtr value = nodeInput->getResolvedValue();
579+
if (!value)
580+
{
581+
InputPtr interfaceInput = nodeInput->getInterfaceInput();
582+
if (interfaceInput)
583+
{
584+
value= interfaceInput->getResolvedValue();
585+
}
586+
}
579587
if (value)
580588
{
581589
const string& valueString = value->getValueString();

source/MaterialXGenShader/ShaderNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void ShaderNode::initialize(const Node& node, const NodeDef& nodeDef, GenContext
349349
InputPtr interfaceInput = nodeInput->getInterfaceInput();
350350
if (interfaceInput)
351351
{
352-
portValue = interfaceInput->getValue();
352+
portValue = interfaceInput->getResolvedValue();
353353
}
354354
}
355355
const string& valueString = portValue ? portValue->getValueString() : EMPTY_STRING;

0 commit comments

Comments
 (0)