Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion source/MaterialXCore/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,19 @@ vector<NodePtr> getShaderNodes(NodePtr materialNode, const string& nodeType, con
NodePtr shaderNode = input->getConnectedNode();
if (shaderNode && !shaderNodeSet.count(shaderNode))
{
if (!nodeType.empty() && shaderNode->getType() != nodeType)
bool inputMatchesOutputType = !nodeType.empty() && shaderNode->getType() == nodeType;

if (shaderNode->isMultiOutputType())
{
const vector<OutputPtr>& activeOutputs = shaderNode->getActiveOutputs();
bool multiOutputMatches = std::any_of(activeOutputs.begin(), activeOutputs.end(), [&nodeType](const OutputPtr& output)
{
return output->getType() == nodeType;
});
inputMatchesOutputType = multiOutputMatches || inputMatchesOutputType;
}

if (!inputMatchesOutputType)
{
continue;
}
Expand Down