| 439 | } |
| 440 | |
| 441 | void |
| 442 | PrecompNodePrivate::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 | |
| 489 | NodePtr |
| 490 | PrecompNodePrivate::getWriteNodeFromPreComp() const |
nothing calls this directly
no test coverage detected