@@ -277,6 +277,9 @@ void AnimationPlayer::_blend_playback_data(double p_delta, bool p_started) {
277277 // Finally, if not end the animation, do blending.
278278 if (end_reached) {
279279 playback.blend .clear ();
280+ if (end_notify) {
281+ finished_anim = playback.assigned ;
282+ }
280283 return ;
281284 }
282285 List<List<Blend>::Element *> to_erase;
@@ -306,6 +309,8 @@ bool AnimationPlayer::_blend_pre_process(double p_delta, int p_track_count, cons
306309 end_reached = false ;
307310 end_notify = false ;
308311
312+ finished_anim = StringName ();
313+
309314 bool started = playback.started ; // The animation may be changed during process, so it is safer that the state is changed before process.
310315 if (playback.started ) {
311316 playback.started = false ;
@@ -326,6 +331,10 @@ void AnimationPlayer::_blend_capture(double p_delta) {
326331}
327332
328333void AnimationPlayer::_blend_post_process () {
334+ if (!finished_anim.is_empty ()) {
335+ emit_signal (SceneStringName (animation_finished), finished_anim);
336+ }
337+
329338 if (end_reached) {
330339 // If the method track changes current animation, the animation is not finished.
331340 if (tmp_from == playback.current .from ->animation ->get_instance_id ()) {
@@ -342,7 +351,6 @@ void AnimationPlayer::_blend_post_process() {
342351 playing = false ;
343352 _set_process (false );
344353 if (end_notify) {
345- emit_signal (SceneStringName (animation_finished), playback.assigned );
346354 emit_signal (SNAME (" current_animation_changed" ), " " );
347355 if (movie_quit_on_finish && OS::get_singleton ()->has_feature (" movie" )) {
348356 print_line (vformat (" Movie Maker mode is enabled. Quitting on animation finish as requested by: %s" , get_path ()));
0 commit comments