summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/animation_track_editor.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 95ba301282..55bae8e592 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -4345,6 +4345,25 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b
property_info_base = property_info_base.get_named(leftover_path[i], valid);
}
+ // Hack for the fact that bezier tracks leftover paths can reference
+ // the individual components for types like vectors.
+ if (property_info_base.is_null()) {
+ if (res.is_valid()) {
+ property_info_base = res;
+ } else if (node) {
+ property_info_base = node;
+ }
+
+ if (leftover_path.size()) {
+ leftover_path.remove_at(leftover_path.size() - 1);
+ }
+
+ for (int i = 0; i < leftover_path.size() - 1; i++) {
+ bool valid;
+ property_info_base = property_info_base.get_named(leftover_path[i], valid);
+ }
+ }
+
if (property_info_base.is_null()) {
WARN_PRINT(vformat("Could not determine track hint for '%s:%s' because its base property is null.",
String(path.get_concatenated_names()), String(path.get_concatenated_subnames())));
@@ -4472,7 +4491,11 @@ AnimationTrackEditor::TrackIndices AnimationTrackEditor::_confirm_insert(InsertD
} break;
case Animation::TYPE_BEZIER: {
- int existing = animation->track_find_key(p_id.track_idx, time, Animation::FIND_MODE_APPROX);
+ int existing = -1;
+ if (p_id.track_idx < animation->get_track_count()) {
+ existing = animation->track_find_key(p_id.track_idx, time, Animation::FIND_MODE_APPROX);
+ }
+
if (existing != -1) {
Array arr = animation->track_get_key_value(p_id.track_idx, existing);
arr[0] = p_id.value;