From ebf7e86bd4635d41d0399d116af416a521d5dd58 Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Sat, 23 Nov 2024 22:28:31 +0900 Subject: Make start/end can be retrieved from each PlaybackData on AnimPlayer --- scene/animation/animation_player.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scene/animation/animation_player.h') diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 6d7e8aa996..c87719a2b3 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -70,6 +70,18 @@ private: float speed_scale = 1.0; double start_time = 0.0; double end_time = 0.0; + double get_start_time() const { + if (from && (Animation::is_less_approx(start_time, 0) || Animation::is_greater_approx(start_time, from->animation->get_length()))) { + return 0; + } + return start_time; + } + double get_end_time() const { + if (from && (Animation::is_less_approx(end_time, 0) || Animation::is_greater_approx(end_time, from->animation->get_length()))) { + return from->animation->get_length(); + } + return end_time; + } }; struct Blend { -- cgit v1.2.3