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

Method initializeKnobs

Gui/MultiInstancePanel.cpp:458–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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