-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Update AnimationPlayer in real-time when bezier curve properties or bezier editor changes #96753
Update AnimationPlayer in real-time when bezier curve properties or bezier editor changes #96753
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider adding an update in _change_selected_keys_handle_mode
too since right-clicking and changing the handle mode currently does not trigger an update of the property.
I would also say that it is probably worth adding the update to the duplicate operation for good measure. |
f8cc757
to
07bcede
Compare
Updated with the required changes. I suppose the EditorUndoRedoManager is a queue, so the order of add calls matter. So I put the APE's update key frame adds above the queue_redraw adds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, found two more instances where we would also want to trigger the update: cutting and pasting.
To fix pasting, I think you should change line 1923 from:
undo_redo->commit_action();
queue_redraw();
to:
AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
if (ape) {
undo_redo->add_do_method(ape, "_animation_update_key_frame");
undo_redo->add_undo_method(ape, "_animation_update_key_frame");
}
undo_redo->add_do_method(this, "queue_redraw");
undo_redo->add_undo_method(this, "queue_redraw");
undo_redo->commit_action();
For cutting, add this below line 1845:
AnimationPlayerEditor *ape = AnimationPlayerEditor::get_singleton();
if (ape) {
undo_redo->add_do_method(ape, "_animation_update_key_frame");
undo_redo->add_undo_method(ape, "_animation_update_key_frame");
}
undo_redo->add_do_method(this, "queue_redraw");
undo_redo->add_undo_method(this, "queue_redraw");
This should solve the remaining edge cases.
07bcede
to
ca25b7a
Compare
@SaracenOne good catch. Force pushed the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
…ezier editor changes
ca25b7a
to
9d0944b
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
This was someone's first contribution? O_o |
It was mostly copying and pasting 😆 thanks for the help folks |
Cherry-picked for 4.3.1. |
I am unsure whether I should add the update to
AnimationBezierTrackEdit::duplicate_selected_key
as well.