Skip to content

Commit

Permalink
Restore Node class
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinbhat committed Oct 16, 2024
1 parent c97d2a6 commit 6df3979
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions source/MaterialXCore/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,8 @@ NodeDefPtr Node::getNodeDef(const string& target, bool allowRoughMatch) const
}
vector<NodeDefPtr> nodeDefs = getDocument()->getMatchingNodeDefs(getQualifiedName(getCategory()));
vector<NodeDefPtr> secondary = getDocument()->getMatchingNodeDefs(getCategory());
nodeDefs.insert(nodeDefs.end(), secondary.begin(), secondary.end());

// Recurse to data library if present.
if (getDocument()->hasDataLibrary())
{
vector<NodeDefPtr> libraryNodeDefs = getDocument()->getDataLibrary()->getMatchingNodeDefs(getQualifiedName(getCategory()));
vector<NodeDefPtr> librarySecondardNodeDefs = getDocument()->getDataLibrary()->getMatchingNodeDefs(getCategory());
nodeDefs.insert(nodeDefs.end(), libraryNodeDefs.begin(), libraryNodeDefs.end());
nodeDefs.insert(nodeDefs.end(), librarySecondardNodeDefs.begin(), librarySecondardNodeDefs.end());
}

vector<NodeDefPtr> roughMatches;
nodeDefs.insert(nodeDefs.end(), secondary.begin(), secondary.end());
for (NodeDefPtr nodeDef : nodeDefs)
{
if (!targetStringsMatch(nodeDef->getTarget(), target) ||
Expand Down Expand Up @@ -724,18 +714,6 @@ NodeDefPtr NodeGraph::getNodeDef() const
}
}
}

// Check data library if available
if (!nodedef && getDocument()->hasDataLibrary())
{
for (auto impl : getDocument()->getDataLibrary()->getImplementations())
{
if (impl->getNodeGraph() == getQualifiedName(getName()))
{
nodedef = impl->getNodeDef();
}
}
}
return nodedef;
}

Expand Down

0 comments on commit 6df3979

Please sign in to comment.