1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-23 15:16:17 +00:00

AnimationMultiTrackKeyEdit Allow editing easing if it's possible for all edited tracks

(cherry picked from commit 1d890e16f7)
This commit is contained in:
kleonc
2021-06-17 23:28:04 +02:00
committed by Rémi Verschelde
parent 2e1e8eb2e1
commit 5c36619bdd

View File

@@ -1262,19 +1262,14 @@ public:
p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale"));
} break; } break;
case Animation::TYPE_VALUE: { case Animation::TYPE_VALUE: {
if (same_key_type) {
if (!same_key_type)
break;
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) { if (hint.type != Variant::NIL) {
PropertyInfo pi = hint; PropertyInfo pi = hint;
pi.name = "value"; pi.name = "value";
p_list->push_back(pi); p_list->push_back(pi);
} else { } else {
PropertyHint hint = PROPERTY_HINT_NONE; PropertyHint hint = PROPERTY_HINT_NONE;
String hint_string; String hint_string;
@@ -1282,15 +1277,16 @@ public:
//could actually check the object property if exists..? yes i will! //could actually check the object property if exists..? yes i will!
Ref<Resource> res = v; Ref<Resource> res = v;
if (res.is_valid()) { if (res.is_valid()) {
hint = PROPERTY_HINT_RESOURCE_TYPE; hint = PROPERTY_HINT_RESOURCE_TYPE;
hint_string = res->get_class(); hint_string = res->get_class();
} }
} }
if (v.get_type() != Variant::NIL) if (v.get_type() != Variant::NIL) {
p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string)); p_list->push_back(PropertyInfo(v.get_type(), "value", hint, hint_string));
} }
}
}
p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING)); p_list->push_back(PropertyInfo(Variant::REAL, "easing", PROPERTY_HINT_EXP_EASING));
} break; } break;