Skip to content

Commit

Permalink
AnimationEditor : Fix changing of frame by click & drag
Browse files Browse the repository at this point in the history
We mustn't edit the context returned by the ContextTracker - nobody is tracking it for changes, it is intended to be const, and other UI components might be using it in other threads. Instead we just use the ScriptNode context in the AnimationEditor as before.

This is the most minimal change needed to fix the bug. You could argue the case for making the AnimationEditor genuinely focus-aware by accounting for TimeWarps between the node being viewed and the node being edited. That would require a lot of work though, and it's not clear that it's worth it, or that it can be done without an ABI break.
  • Loading branch information
johnhaddon committed Nov 5, 2024
1 parent c5d6d2e commit e47bd2d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Fixes
- Render, InteractiveRender : Added default node name arguments to the compatibility shims for removed subclasses such as ArnoldRender.
- GafferUITest : Fixed `assertNodeUIsHaveExpectedLifetime()` test for invisible nodes.
- OpDialogue : Fixed `postExecuteBehaviour` handling.
- AnimationEditor : Fixed changing of the current frame by dragging the frame indicator or clicking on the time axis.

API
---
Expand Down
5 changes: 1 addition & 4 deletions python/GafferUI/AnimationEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def __init__( self, scriptNode, **kw ) :

# Set up the widget responsible for actual curve drawing
self.__animationGadget = GafferUI.AnimationGadget()
self.__animationGadget.setContext( scriptNode.context() )

# Set up signals needed to update selection state in PathListingWidget
editable = self.__animationGadget.editablePlugs()
Expand Down Expand Up @@ -222,10 +223,6 @@ def _updateFromSet( self ) :
self.__pathChangedConnection = self.__curveList.getPath().pathChangedSignal().connect( Gaffer.WeakMethod( self.__updateGadgetSets ), scoped = True )
self.__updateGadgetSets()

def _updateFromContext( self, modifiedItems ) :

self.__animationGadget.setContext( self.context() )

def __updateGadgetSets( self, unused = None ) :

visiblePlugs = set()
Expand Down

0 comments on commit e47bd2d

Please sign in to comment.