MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / checkTreeCanRender_internal

Function checkTreeCanRender_internal

Engine/ViewerInstance.cpp:698–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696} // ViewerInstance::renderViewer
697
698static bool
699checkTreeCanRender_internal(Node* node,
700 std::list<Node*>& marked)
701{
702 if ( std::find(marked.begin(), marked.end(), node) != marked.end() ) {
703 return true;
704 }
705
706 marked.push_back(node);
707
708 // check that the nodes upstream have all their nonoptional inputs connected
709 int maxInput = node->getNInputs();
710 for (int i = 0; i < maxInput; ++i) {
711 NodePtr input = node->getInput(i);
712 bool optional = node->getEffectInstance()->isInputOptional(i);
713 if (optional) {
714 continue;
715 }
716 if (!input) {
717 return false;
718 } else {
719 bool ret = checkTreeCanRender_internal(input.get(), marked);
720 if (!ret) {
721 return false;
722 }
723 }
724 }
725
726 return true;
727}
728
729/**
730 * @brief Returns false if the tree has unconnected mandatory inputs

Callers 1

checkTreeCanRenderFunction · 0.85

Calls 8

getEffectInstanceMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
getNInputsMethod · 0.45
getInputMethod · 0.45
isInputOptionalMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected