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

Method initializeKnobs

Gui/MultiInstancePanel.cpp:459–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void
460MultiInstancePanel::initializeKnobs()
461{
462 const std::vector<KnobIPtr> & mainInstanceKnobs = _imp->getMainInstance()->getKnobs();
463
464 for (U32 i = 0; i < mainInstanceKnobs.size(); ++i) {
465 _imp->createKnob(mainInstanceKnobs[i]);
466 }
467 ///copy page children
468 const std::vector<KnobIPtr> & knobs = getKnobs();
469 for (U32 i = 0; i < knobs.size(); ++i) {
470 KnobPage* isPage = dynamic_cast<KnobPage*>( knobs[i].get() );
471
472 if (isPage) {
473 ///find the corresponding knob in the main instance knobs
474 KnobIPtr other = _imp->getMainInstance()->getKnobByName( isPage->getName() );
475 assert(other);
476 if (!other) {
477 throw std::logic_error("MultiInstancePanel::initializeKnobs");
478 }
479 KnobPage* otherPage = dynamic_cast<KnobPage*>( other.get() );
480 assert(otherPage);
481
482 if (!otherPage) {
483 continue;
484 }
485 KnobsVec otherChildren = otherPage->getChildren();
486 bool isNodePage = otherPage->getName() == "Node";
487 for (U32 j = 0; j < otherChildren.size(); ++j) {
488 if ( !otherChildren[j]->isInstanceSpecific() ) {
489 KnobIPtr thisChild = getKnobByName( otherChildren[j]->getName() );
490 if (thisChild) {
491 isPage->addKnob(thisChild);
492 if ( isNodePage && !thisChild->isDeclaredByPlugin() ) {
493 thisChild->setAllDimensionsEnabled(false);
494 }
495 }
496 }
497 }
498 }
499 }
500 initializeExtraKnobs();
501}
502
503bool
504MultiInstancePanel::isGuiCreated() const

Callers

nothing calls this directly

Calls 11

getMainInstanceMethod · 0.80
getNameMethod · 0.80
isInstanceSpecificMethod · 0.80
isDeclaredByPluginMethod · 0.80
sizeMethod · 0.45
createKnobMethod · 0.45
getMethod · 0.45
getKnobByNameMethod · 0.45
getChildrenMethod · 0.45
addKnobMethod · 0.45

Tested by

no test coverage detected