From 4f4052581b19b84a0c38295cd3f11fdea4dabac1 Mon Sep 17 00:00:00 2001 From: Chinmay Awale Date: Fri, 7 Jul 2023 17:45:11 +0530 Subject: [PATCH] add 3.x compatibility for animation loop mode (cherry picked from commit 1686a7a1a272021d8c3d0929c6a25923bebf889d) --- scene/resources/animation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 7078d60de5e..1ab6e714a80 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -427,6 +427,11 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) { } else { return false; } +#ifndef DISABLE_DEPRECATED + } else if (prop_name == "loop" && p_value.operator bool()) { // Compatibility with Godot 3.x. + loop_mode = Animation::LoopMode::LOOP_LINEAR; + return true; +#endif // DISABLE_DEPRECATED } else { return false; }