summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-02 12:24:06 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-02 12:24:06 +0100
commite9b67569f7c067d3fb3e5095697ef5ebcd293d90 (patch)
tree6e54d5c8880b06b572f8e5e896be3ae51cb21668
parent801080a6ab0c51c2b2de25a417339570d4052358 (diff)
parent962b6a3e8f9d91f92f2547e2da6ba8dbd5a661dc (diff)
Merge pull request #69474 from TokageItLab/fix-animation-cache-signal
Fix animation signal `caches_cleared` firing timing
-rw-r--r--scene/animation/animation_player.cpp3
-rw-r--r--scene/animation/animation_tree.cpp1
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 45eeff71f2..de047bf82e 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -1800,7 +1800,6 @@ double AnimationPlayer::get_current_animation_length() const {
void AnimationPlayer::_animation_changed() {
clear_caches();
- emit_signal(SNAME("caches_cleared"));
if (is_playing()) {
playback.seeked = true; //need to restart stuff, like audio
}
@@ -1839,6 +1838,8 @@ void AnimationPlayer::clear_caches() {
cache_update_size = 0;
cache_update_prop_size = 0;
cache_update_bezier_size = 0;
+
+ emit_signal(SNAME("caches_cleared"));
}
void AnimationPlayer::set_active(bool p_active) {
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index 3e0f59a48a..7471ddd60f 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -859,7 +859,6 @@ void AnimationTree::_clear_caches() {
memdelete(K.value);
}
playing_caches.clear();
-
track_cache.clear();
cache_valid = false;
}