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

Method populateWriteNodesChoice

Engine/PrecompNode.cpp:441–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441void
442PrecompNodePrivate::populateWriteNodesChoice(bool setPartOfPrecomp,
443 bool setWriteNodeChoice)
444{
445 KnobChoicePtr param = writeNodesKnob.lock();
446
447 if (!param) {
448 return;
449 }
450 std::vector<ChoiceOption> choices;
451 choices.push_back(ChoiceOption("None"));
452
453 NodesList nodes;
454 app.lock()->getProject()->getNodes_recursive(nodes, true);
455 PrecompNodePtr precomp;
456 if (setPartOfPrecomp) {
457 precomp = std::dynamic_pointer_cast<PrecompNode>( _publicInterface->shared_from_this() );
458 assert(precomp);
459
460 //extract all inputs of the tree
461 std::list<Project::NodesTree> trees;
462 Project::extractTreesFromNodes(nodes, trees);
463 for (std::list<Project::NodesTree>::iterator it = trees.begin(); it != trees.end(); ++it) {
464 for (std::list<Project::TreeInput>::iterator it2 = it->inputs.begin(); it2 != it->inputs.end(); ++it2) {
465 precompInputs.push_back(it2->node);
466 }
467 }
468 }
469
470
471 for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) {
472 if (setPartOfPrecomp) {
473 (*it)->setPrecompNode(precomp);
474 }
475 if ( (*it)->getEffectInstance()->isWriter() ) {
476 choices.push_back( ChoiceOption((*it)->getFullyQualifiedName() ));
477 }
478 }
479
480 param->populateChoices(choices);
481
482 if (setWriteNodeChoice) {
483 if (choices.size() > 1) {
484 param->setValue(1);
485 }
486 }
487}
488
489NodePtr
490PrecompNodePrivate::getWriteNodeFromPreComp() const

Callers

nothing calls this directly

Calls 15

ChoiceOptionFunction · 0.85
extractTreesFromNodesFunction · 0.85
getNodes_recursiveMethod · 0.80
getProjectMethod · 0.80
setPrecompNodeMethod · 0.80
getEffectInstanceMethod · 0.80
populateChoicesMethod · 0.80
lockMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
isWriterMethod · 0.45

Tested by

no test coverage detected