diff --git a/source/MaterialXGenShader/ShaderGraph.cpp b/source/MaterialXGenShader/ShaderGraph.cpp index ae5bc11935..846f6df0f3 100644 --- a/source/MaterialXGenShader/ShaderGraph.cpp +++ b/source/MaterialXGenShader/ShaderGraph.cpp @@ -99,15 +99,15 @@ void ShaderGraph::createConnectedNodes(const ElementPtr& downstreamElement, // Handle defaultgeomprops // - const vector activeInputs = upstreamNode->getActiveInputs(); - for (const InputPtr& activeInput : activeInputs) + for (InputPtr activeInput : upstreamNode->getActiveInputs()) { if (!activeInput->hasInterfaceName() || activeInput->getConnectedNode()) { continue; } - const auto graphInput = activeInput->getInterfaceInput(); - // We have an input connected to an interface. See if it has defaultgeomprop + + // Handle interface inputs with default geometric properties. + InputPtr graphInput = activeInput->getInterfaceInput(); if (graphInput && graphInput->hasDefaultGeomPropString()) { ShaderInput* shaderInput = getNode(upstreamNode->getName())->getInput(activeInput->getName());