Skip to content

Commit

Permalink
Merge pull request #49695 from kleonc/animation-track-editor-multi-ed…
Browse files Browse the repository at this point in the history
…it-easing

AnimationMultiTrackKeyEdit Allow editing easing if it's possible for all edited tracks
  • Loading branch information
akien-mga authored Jun 18, 2021
2 parents 407229a + 1d890e1 commit 8ffb631
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,31 +1168,29 @@ class AnimationMultiTrackKeyEdit : public Object {
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 (v.get_type() == Variant::OBJECT) {
//could actually check the object property if exists..? yes i will!
Ref<Resource> res = v;
if (res.is_valid()) {
hint = PROPERTY_HINT_RESOURCE_TYPE;
hint_string = res->get_class();
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<Resource> 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));
}
}
}

Expand Down

0 comments on commit 8ffb631

Please sign in to comment.