Skip to content

Commit 0e1811a

Browse files
committed
Fix animation track subpath hint inference.
1 parent 34f005d commit 0e1811a

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

editor/animation_track_editor.cpp

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4638,42 +4638,14 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b
46384638
}
46394639
}
46404640

4641-
for (int i = 0; i < leftover_path.size() - 1; i++) {
4642-
bool valid;
4643-
property_info_base = property_info_base.get_named(leftover_path[i], valid);
4644-
}
4645-
4646-
// Hack for the fact that bezier tracks leftover paths can reference
4647-
// the individual components for types like vectors.
4648-
if (property_info_base.is_null()) {
4649-
if (res.is_valid()) {
4650-
property_info_base = res;
4651-
} else if (node) {
4652-
property_info_base = node;
4653-
}
4654-
4655-
if (leftover_path.size()) {
4656-
leftover_path.remove_at(leftover_path.size() - 1);
4657-
}
4658-
4659-
for (int i = 0; i < leftover_path.size() - 1; i++) {
4660-
bool valid;
4661-
property_info_base = property_info_base.get_named(leftover_path[i], valid);
4662-
}
4663-
}
4664-
4665-
if (property_info_base.is_null()) {
4666-
WARN_PRINT(vformat("Could not determine track hint for '%s:%s' because its base property is null.",
4667-
String(path.get_concatenated_names()), String(path.get_concatenated_subnames())));
4668-
return PropertyInfo();
4669-
}
4670-
46714641
List<PropertyInfo> pinfo;
46724642
property_info_base.get_property_list(&pinfo);
46734643

4674-
for (const PropertyInfo &E : pinfo) {
4675-
if (E.name == leftover_path[leftover_path.size() - 1]) {
4676-
return E;
4644+
if (leftover_path.size() == 1) {
4645+
for (const PropertyInfo &E : pinfo) {
4646+
if (E.name == leftover_path[0]) {
4647+
return E;
4648+
}
46774649
}
46784650
}
46794651

0 commit comments

Comments
 (0)