MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / findNode

Method findNode

source/MaterialXGraphEditor/Graph.cpp:1414–1441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412}
1413
1414int Graph::findNode(const std::string& name, const std::string& type)
1415{
1416 int count = 0;
1417 for (size_t i = 0; i < _state.nodes.size(); i++)
1418 {
1419 if (_state.nodes[i]->getName() == name)
1420 {
1421 if (type == "node" && _state.nodes[i]->getNode() != nullptr)
1422 {
1423 return count;
1424 }
1425 else if (type == "input" && _state.nodes[i]->getInput() != nullptr)
1426 {
1427 return count;
1428 }
1429 else if (type == "output" && _state.nodes[i]->getOutput() != nullptr)
1430 {
1431 return count;
1432 }
1433 else if (type == "nodegraph" && _state.nodes[i]->getNodeGraph() != nullptr)
1434 {
1435 return count;
1436 }
1437 }
1438 count++;
1439 }
1440 return -1;
1441}
1442
1443int Graph::findUpstreamNode(mx::InputPtr input)
1444{

Callers

nothing calls this directly

Calls 7

getNodeGraphMethod · 0.80
getIdMethod · 0.80
sizeMethod · 0.45
getNameMethod · 0.45
getNodeMethod · 0.45
getInputMethod · 0.45
getOutputMethod · 0.45

Tested by

no test coverage detected