From 653e2a550c5e7abe7d400f3a8e17737e1f020211 Mon Sep 17 00:00:00 2001 From: Silc 'Tokage' Renew Date: Sat, 16 Oct 2021 10:04:09 +0900 Subject: Fixed animation insertion in SkeletonEditor --- scene/resources/animation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scene/resources/animation.cpp') diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 08b78a39b1..55d58bf156 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -837,9 +837,9 @@ NodePath Animation::track_get_path(int p_track) const { return tracks[p_track]->path; } -int Animation::find_track(const NodePath &p_path) const { +int Animation::find_track(const NodePath &p_path, const TrackType p_type) const { for (int i = 0; i < tracks.size(); i++) { - if (tracks[i]->path == p_path) { + if (tracks[i]->path == p_path && tracks[i]->type == p_type) { return i; } }; @@ -3027,7 +3027,7 @@ void Animation::_bind_methods() { ClassDB::bind_method(D_METHOD("track_get_type", "track_idx"), &Animation::track_get_type); ClassDB::bind_method(D_METHOD("track_get_path", "track_idx"), &Animation::track_get_path); ClassDB::bind_method(D_METHOD("track_set_path", "track_idx", "path"), &Animation::track_set_path); - ClassDB::bind_method(D_METHOD("find_track", "path"), &Animation::find_track); + ClassDB::bind_method(D_METHOD("find_track", "path", "type"), &Animation::find_track); ClassDB::bind_method(D_METHOD("track_move_up", "track_idx"), &Animation::track_move_up); ClassDB::bind_method(D_METHOD("track_move_down", "track_idx"), &Animation::track_move_down); -- cgit v1.2.3