Skip to content

Commit

Permalink
Merge branch 'RB-2.3' into RB-2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Apr 17, 2021
2 parents 7be15df + bbf95aa commit 38d9de0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
6 changes: 6 additions & 0 deletions Engine/RotoContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,12 @@ RotoContext::onItemLockedChanged(const RotoItemPtr& item,
Q_EMIT itemLockedChanged( (int)reason );
}

void
RotoContext::onItemGloballyActivatedChanged(const RotoItemPtr& item)
{
Q_EMIT itemGloballyActivatedChanged(item);
}

void
RotoContext::onItemScriptNameChanged(const RotoItemPtr& item)
{
Expand Down
2 changes: 2 additions & 0 deletions Engine/RotoContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ class RotoContext
**/
std::string getRotoNodeName() const;

void onItemGloballyActivatedChanged(const RotoItemPtr& item);
void onItemScriptNameChanged(const RotoItemPtr& item);
void onItemLabelChanged(const RotoItemPtr& item);

Expand Down Expand Up @@ -437,6 +438,7 @@ class RotoContext

void itemLockedChanged(int reason);

void itemGloballyActivatedChanged(const RotoItemPtr&);
void itemScriptNameChanged(const RotoItemPtr&);
void itemLabelChanged(const RotoItemPtr&);

Expand Down
1 change: 1 addition & 0 deletions Engine/RotoItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ RotoItem::setGloballyActivated(bool a,
isDrawable->incrementNodesAge();
}
c->evaluateChange();
c->onItemGloballyActivatedChanged(shared_from_this());
}
}

Expand Down
25 changes: 11 additions & 14 deletions Gui/RotoPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,6 @@ struct RotoPanelPrivate

void insertSelectionRecursively(const RotoLayerPtr & layer);

void setChildrenActivatedRecursively(bool activated, QTreeWidgetItem* item);

void setChildrenLockedRecursively(bool locked, QTreeWidgetItem* item);

bool itemHasKey(const RotoItemPtr& item, double time) const;
Expand Down Expand Up @@ -507,6 +505,7 @@ RotoPanel::RotoPanel(const NodeGuiPtr& n,
QObject::connect( _imp->context.get(), SIGNAL(itemScriptNameChanged(RotoItemPtr)), this, SLOT(onItemScriptNameChanged(RotoItemPtr)) );
QObject::connect( _imp->context.get(), SIGNAL(itemLabelChanged(RotoItemPtr)), this, SLOT(onItemLabelChanged(RotoItemPtr)) );
QObject::connect( _imp->context.get(), SIGNAL(itemLockedChanged(int)), this, SLOT(onItemLockChanged(int)) );
QObject::connect( _imp->context.get(), SIGNAL(itemGloballyActivatedChanged(RotoItemPtr)), this, SLOT(onItemGloballyActivatedChanged(RotoItemPtr)) );
const QSize medButtonSize( TO_DPIX(NATRON_MEDIUM_BUTTON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_SIZE) );
const QSize medButtonIconSize( TO_DPIX(NATRON_MEDIUM_BUTTON_ICON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_ICON_SIZE) );

Expand Down Expand Up @@ -1482,9 +1481,7 @@ RotoPanel::onItemClicked(QTreeWidgetItem* item,
TreeItems::iterator found = _imp->findItem(selected[i]);
assert( found != _imp->items.end() );
found->rotoItem->setGloballyActivated(activated, true);
_imp->setChildrenActivatedRecursively(activated, found->treeItem);
}
_imp->context->emitRefreshViewerOverlays();
break;
}

Expand Down Expand Up @@ -1575,16 +1572,6 @@ RotoPanel::onItemColorDialogEdited(const QColor & color)
}
}

void
RotoPanelPrivate::setChildrenActivatedRecursively(bool activated,
QTreeWidgetItem* item)
{
item->setIcon(COL_ACTIVATED, activated ? iconVisible : iconUnvisible);
for (int i = 0; i < item->childCount(); ++i) {
setChildrenActivatedRecursively( activated, item->child(i) );
}
}

void
RotoPanel::onItemLockChanged(int reason)
{
Expand All @@ -1599,6 +1586,16 @@ RotoPanel::onItemLockChanged(int reason)
}
}

void
RotoPanel::onItemGloballyActivatedChanged(const RotoItemPtr& item)
{
TreeItems::iterator found = _imp->findItem(item);
if ( found != _imp->items.end() ) {
found->treeItem->setIcon(COL_ACTIVATED, item->isGloballyActivated() ? _imp->iconVisible : _imp->iconUnvisible);
}
_imp->context->emitRefreshViewerOverlays();
}

void
RotoPanelPrivate::setChildrenLockedRecursively(bool locked,
QTreeWidgetItem* item)
Expand Down
1 change: 1 addition & 0 deletions Gui/RotoPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public Q_SLOTS:

void onItemColorDialogEdited(const QColor & color);

void onItemGloballyActivatedChanged(const RotoItemPtr& item);
void onItemLabelChanged(const RotoItemPtr& item);
void onItemScriptNameChanged(const RotoItemPtr& item);

Expand Down

0 comments on commit 38d9de0

Please sign in to comment.