| 1608 | } |
| 1609 | |
| 1610 | void |
| 1611 | MultiInstancePanel::resetInstances(const std::list<Node*> & instances) |
| 1612 | { |
| 1613 | if ( instances.empty() ) { |
| 1614 | return; |
| 1615 | } |
| 1616 | |
| 1617 | std::list<Node*>::const_iterator next = instances.begin(); |
| 1618 | if ( next != instances.end() ) { |
| 1619 | ++next; |
| 1620 | } |
| 1621 | for (std::list<Node*>::const_iterator it = instances.begin(); |
| 1622 | it != instances.end(); |
| 1623 | ++it) { |
| 1624 | //invalidate the cache by incrementing the age |
| 1625 | (*it)->incrementKnobsAge(); |
| 1626 | if ( (*it)->areKeyframesVisibleOnTimeline() ) { |
| 1627 | (*it)->hideKeyframesFromTimeline( next == instances.end() ); |
| 1628 | } |
| 1629 | const std::vector<KnobIPtr> & knobs = (*it)->getKnobs(); |
| 1630 | for (U32 i = 0; i < knobs.size(); ++i) { |
| 1631 | KnobButton* isBtn = dynamic_cast<KnobButton*>( knobs[i].get() ); |
| 1632 | |
| 1633 | if ( !isBtn && (knobs[i]->getName() != kUserLabelKnobName) && (knobs[i]->getName() != kNatronOfxParamStringSublabelName) ) { |
| 1634 | knobs[i]->beginChanges(); |
| 1635 | int dims = knobs[i]->getDimension(); |
| 1636 | for (int j = 0; j < dims; ++j) { |
| 1637 | knobs[i]->resetToDefaultValue(j); |
| 1638 | } |
| 1639 | knobs[i]->endChanges(); |
| 1640 | } |
| 1641 | } |
| 1642 | |
| 1643 | // increment for next iteration |
| 1644 | if ( next != instances.end() ) { |
| 1645 | ++next; |
| 1646 | } |
| 1647 | } // for(it) |
| 1648 | |
| 1649 | instances.front()->getEffectInstance()->incrHashAndEvaluate(true, true); |
| 1650 | |
| 1651 | ///To update interacts, kinda hack but can't figure out where else put this |
| 1652 | getMainInstance()->getApp()->redrawAllViewers(); |
| 1653 | } |
| 1654 | |
| 1655 | void |
| 1656 | MultiInstancePanel::onButtonTriggered(KnobButton* button) |
nothing calls this directly
no test coverage detected