MCPcopy Create free account
hub / github.com/MrKepzie/Natron / findNodeInternal

Method findNodeInternal

Engine/NodeGroup.cpp:754–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

752} // autoConnectNodes
753
754NodePtr
755NodeCollectionPrivate::findNodeInternal(const std::string& name,
756 const std::string& recurseName) const
757{
758 QMutexLocker k(&nodesMutex);
759
760 for (NodesList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
761 if ( (*it)->getScriptName_mt_safe() == name ) {
762 if ( !recurseName.empty() ) {
763 NodeGroup* isGrp = (*it)->isEffectGroup();
764 if (isGrp) {
765 return isGrp->getNodeByFullySpecifiedName(recurseName);
766 } else {
767 NodesList children;
768 (*it)->getChildrenMultiInstance(&children);
769 for (NodesList::iterator it2 = children.begin(); it2 != children.end(); ++it2) {
770 if ( (*it2)->getScriptName_mt_safe() == recurseName ) {
771 return *it2;
772 }
773 }
774 }
775 } else {
776 return *it;
777 }
778 }
779 }
780
781 return NodePtr();
782}
783
784NodePtr
785NodeCollection::getNodeByName(const std::string & name) const

Callers 2

getNodeByNameMethod · 0.80

Calls 6

emptyMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getScriptName_mt_safeMethod · 0.45

Tested by

no test coverage detected