From 4ae0310cec6b994c26f57b6b5a87f27e5922dc20 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Thu, 17 Jun 2021 23:28:04 +0200 Subject: [PATCH] AnimationMultiTrackKeyEdit Allow editing easing if it's possible for all edited tracks (cherry picked from commit 1d890e16f754a8cd245879faca2f0c3cf57c6138) --- editor/animation_track_editor.cpp | 40 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index dc179c41b65..23f9946f03d 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1175,31 +1175,29 @@ public: p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); } break; case Animation::TYPE_VALUE: { - if (!same_key_type) { - break; - } + if (same_key_type) { + Variant v = animation->track_get_key_value(first_track, first_key); - Variant v = animation->track_get_key_value(first_track, first_key); + if (hint.type != Variant::NIL) { + PropertyInfo pi = hint; + pi.name = "value"; + p_list->push_back(pi); + } else { + PropertyHint hint = PROPERTY_HINT_NONE; + String hint_string; - if (hint.type != Variant::NIL) { - PropertyInfo pi = hint; - pi.name = "value"; - p_list->push_back(pi); - } else { - PropertyHint hint = PROPERTY_HINT_NONE; - String hint_string; - - if (v.get_type() == Variant::OBJECT) { - //could actually check the object property if exists..? yes i will! - Ref res = v; - if (res.is_valid()) { - hint = PROPERTY_HINT_RESOURCE_TYPE; - hint_string = res->get_class(); + if (v.get_type() == Variant::OBJECT) { + //could actually check the object property if exists..? yes i will! + Ref res = v; + if (res.is_valid()) { + hint = PROPERTY_HINT_RESOURCE_TYPE; + hint_string = res->get_class(); + } } - } - if (v.get_type() != Variant::NIL) { - p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); + if (v.get_type() != Variant::NIL) { + p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); + } } }