Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationEditor : Fix changing of frame by click & drag #6134

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

johnhaddon
Copy link
Member

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.

@johnhaddon johnhaddon self-assigned this Nov 5, 2024
@murraystevenson
Copy link
Contributor

Thanks! I can confirm that this fixes the aforementioned bug, but unfortunately it exposes another. The AnimationGadget was reliant on the now removed setContext() call to dirty itself for rendering when the context changed, so it now doesn't update when the frame is changed on the playback slider unless you dirty it another way, such as by madly waving the mouse over the gadget during playback...

@johnhaddon
Copy link
Member Author

it now doesn't update when the frame is changed on the playback slider

Doh! Thanks for catching that. I've pushed another version which should fix both the old and the new problem. I've also added some notes about how we should do this better - we can't currently do that easily because it would mean adding a member to AnimationGadget, which would cause an ABI break.

Copy link
Contributor

@murraystevenson murraystevenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the todo! This looks good to merge after a rebase to fix the Changes.md conflict.

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.
@johnhaddon johnhaddon merged commit 3756a50 into GafferHQ:1.5_maintenance Nov 12, 2024
5 checks passed
@johnhaddon johnhaddon deleted the animationEditorFix branch December 10, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending release
Development

Successfully merging this pull request may close these issues.

2 participants