diff --git a/source/MaterialXCore/Node.cpp b/source/MaterialXCore/Node.cpp index 451828451e..e7b499ae31 100644 --- a/source/MaterialXCore/Node.cpp +++ b/source/MaterialXCore/Node.cpp @@ -74,13 +74,11 @@ NodeDefPtr Node::getNodeDef(const string& target, bool allowRoughMatch) const { return resolveNameReference(getNodeDefString()); } - - // Collect document nodes vector nodeDefs = getDocument()->getMatchingNodeDefs(getQualifiedName(getCategory())); vector secondary = getDocument()->getMatchingNodeDefs(getCategory()); nodeDefs.insert(nodeDefs.end(), secondary.begin(), secondary.end()); - // Collect data library nodes if available + // Recurse to data library if present. if (getDocument()->hasDataLibrary()) { vector libraryNodeDefs = getDocument()->getDataLibrary()->getMatchingNodeDefs(getQualifiedName(getCategory())); @@ -90,7 +88,6 @@ NodeDefPtr Node::getNodeDef(const string& target, bool allowRoughMatch) const } vector roughMatches; - for (NodeDefPtr nodeDef : nodeDefs) { if (!targetStringsMatch(nodeDef->getTarget(), target) ||