소스 검색

fix animation freeze when playing animation from another AnimationPlayer

Donated by IMVU, Inc.

Fixes #31410
When we create an animation player with an animation from which we will start another AnimationPlayer's animation at the moment when that animation is already active - it will  be stopped.  When starting an animation with play() func all the 'outside' animations for animation player were removed (`_stop_playing_caches` func). This pr prevents this behaviour for the case when play is called for animation that's still active. This way the behaviour is the same between "Animation Playback track" and other tracks (tested with value track)
Unknown 6 년 전
부모
커밋
9d849c21cc
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      scene/animation/animation_player.cpp

+ 3 - 1
scene/animation/animation_player.cpp

@@ -1200,7 +1200,9 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float
 		}
 	}
 
-	_stop_playing_caches();
+	if (get_current_animation() != p_name) {
+		_stop_playing_caches();
+	}
 
 	c.current.from = &animation_set[name];