| 457 | } |
| 458 | |
| 459 | void |
| 460 | MultiInstancePanel::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 | |
| 503 | bool |
| 504 | MultiInstancePanel::isGuiCreated() const |
nothing calls this directly
no test coverage detected