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 12, 2024
1 parent f48e544 commit 5bc6a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Fixes
- OpDialogue : Fixed `postExecuteBehaviour` handling.
- LocalDispatcher : Fixed job status update when a job was killed _immediately_ after being launched.
- `gaffer view` : Fixed default OpenColorIO display transform.
- AnimationEditor : Fixed changing of the current frame by dragging the frame indicator or clicking on the time axis.

API
---
Expand Down
9 changes: 8 additions & 1 deletion python/GafferUI/AnimationEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,14 @@ def _updateFromSet( self ) :

def _updateFromContext( self, modifiedItems ) :

self.__animationGadget.setContext( self.context() )
# Note that we're passing `scriptNode().context()` rather than
# `self.context()` because we don't want to use a ContextTracker-based
# context in the AnimationEditor.
## \todo It would be better if `AnimationGadget::setContext()` connected
# to `Context::changedSignal()` and updated automatically after that. We
# could also consider removing `setContext()` entirely and connecting to
# the ScriptNode's context in the AnimationGadget constructor.
self.__animationGadget.setContext( self.scriptNode().context() )

def __updateGadgetSets( self, unused = None ) :

Expand Down

0 comments on commit 5bc6a61

Please sign in to comment.