-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
SpriteFrames Editor: Fix FPS applied to two animations when switching animation #79692
Conversation
Animation/assets-pipeline meeting: can you split up your PR, each PR fixing one bug (if possible?)? Thanks! |
0118889
to
2f1e135
Compare
SpriteFrames
editor
@adamscott Done! |
autoplay->set_pressed_no_signal(false); | ||
} else { | ||
autoplay->set_pressed(String(edited_anim) == autoplay_name); | ||
autoplay->set_pressed_no_signal(String(edited_anim) == autoplay_name); |
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.
Just leaving a note that this doesn't seem to result in any change in behavior, because the connected method _autoplay_pressed
doesn't run if updating
is true
. So this should be fine.
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.
And the same applies to anim_speed
and anim_loop
.
@@ -1705,7 +1698,8 @@ SpriteFramesEditor::SpriteFramesEditor() { | |||
sub_vb->add_child(animations); | |||
animations->set_v_size_flags(SIZE_EXPAND_FILL); | |||
animations->set_hide_root(true); | |||
animations->connect("cell_selected", callable_mp(this, &SpriteFramesEditor::_animation_selected)); | |||
// HACK: The cell_selected signal is emitted before the FPS spinbox loses focus and applies the change. | |||
animations->connect("cell_selected", callable_mp(this, &SpriteFramesEditor::_animation_selected), CONNECT_DEFERRED); |
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.
Regarding the hack itself (and the same applies to #79872 really): we could probably avoid this if we store which item was selected when focus was gained, and on focus loss we update that item, and not the current item.
What do you think about that?
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.
This will work, but I think it's about the same hack as this one, but also requires adding an unnecessary variable with duplicate content, a callback, and a connection to the LineEdit
signal. I would prefer to keep it as is until #79695 is fixed or if we find any problems with this solution.
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 left a comment suggesting how to avoid relying on the order of operations, but I'm also approving this in case we are okay as is, because the fix works from my testing (and other changes seem good).
Thanks! |
Fix Animation FPS change applied to two animations when switching animation while editing spinbox FPS value.
Minor changes:
*_no_signal()
methods in_update_library()
for FPS and Loop controls.