@@ -4302,17 +4302,8 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
4302
4302
String path = root->get_path_to (p_node, true );
4303
4303
4304
4304
// Get the value from the subpath.
4305
- Variant value = p_node;
4306
- Vector<String> property_path = p_property.split (" :" );
4307
- for (const String &E : property_path) {
4308
- if (value.get_type () == Variant::OBJECT) {
4309
- Object *obj = value;
4310
- value = obj->get (E);
4311
- } else {
4312
- value = Variant ();
4313
- break ;
4314
- }
4315
- }
4305
+ Vector<StringName> subpath = NodePath (p_property).get_as_property_path ().get_subnames ();
4306
+ Variant value = p_node->get_indexed (subpath);
4316
4307
4317
4308
if (Object::cast_to<AnimationPlayer>(p_node) && p_property == " current_animation" ) {
4318
4309
if (p_node == AnimationPlayerEditor::get_singleton ()->get_player ()) {
@@ -4549,30 +4540,6 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b
4549
4540
}
4550
4541
}
4551
4542
4552
- for (int i = 0 ; i < leftover_path.size () - 1 ; i++) {
4553
- bool valid;
4554
- property_info_base = property_info_base.get_named (leftover_path[i], valid);
4555
- }
4556
-
4557
- // Hack for the fact that bezier tracks leftover paths can reference
4558
- // the individual components for types like vectors.
4559
- if (property_info_base.is_null ()) {
4560
- if (res.is_valid ()) {
4561
- property_info_base = res;
4562
- } else if (node) {
4563
- property_info_base = node;
4564
- }
4565
-
4566
- if (leftover_path.size ()) {
4567
- leftover_path.remove_at (leftover_path.size () - 1 );
4568
- }
4569
-
4570
- for (int i = 0 ; i < leftover_path.size () - 1 ; i++) {
4571
- bool valid;
4572
- property_info_base = property_info_base.get_named (leftover_path[i], valid);
4573
- }
4574
- }
4575
-
4576
4543
if (property_info_base.is_null ()) {
4577
4544
WARN_PRINT (vformat (" Could not determine track hint for '%s:%s' because its base property is null." ,
4578
4545
String (path.get_concatenated_names ()), String (path.get_concatenated_subnames ())));
@@ -4630,6 +4597,9 @@ static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool
4630
4597
subindices.push_back (" :z" );
4631
4598
subindices.push_back (" :d" );
4632
4599
} break ;
4600
+ case Variant::NIL: {
4601
+ subindices.push_back (" " ); // Hack: it is probably float since non-numeric types are filtered in the selection window.
4602
+ } break ;
4633
4603
default : {
4634
4604
if (r_valid) {
4635
4605
*r_valid = false ;
0 commit comments