You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-03 16:55:53 +00:00
Remove animation tracks with correct indices
(cherry picked from commit 3d7facd21c)
This commit is contained in:
committed by
Yuri Sizov
parent
89dd2d066f
commit
bad5e93945
@@ -1738,6 +1738,8 @@ void SceneTreeDock::perform_node_renames(Node *p_base, HashMap<Node *, NodePath>
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int tracks_removed = 0;
|
||||||
|
|
||||||
for (int i = 0; i < anim->get_track_count(); i++) {
|
for (int i = 0; i < anim->get_track_count(); i++) {
|
||||||
NodePath track_np = anim->track_get_path(i);
|
NodePath track_np = anim->track_get_path(i);
|
||||||
Node *n = root->get_node_or_null(track_np);
|
Node *n = root->get_node_or_null(track_np);
|
||||||
@@ -1755,14 +1757,8 @@ void SceneTreeDock::perform_node_renames(Node *p_base, HashMap<Node *, NodePath>
|
|||||||
if (found_path->value.is_empty()) {
|
if (found_path->value.is_empty()) {
|
||||||
//will be erased
|
//will be erased
|
||||||
|
|
||||||
int idx = 0;
|
int idx = i - tracks_removed;
|
||||||
HashSet<int>::Iterator EI = ran.begin();
|
tracks_removed++;
|
||||||
ERR_FAIL_COND(!EI); //bug
|
|
||||||
while (*EI != i) {
|
|
||||||
idx++;
|
|
||||||
++EI;
|
|
||||||
ERR_FAIL_COND(!EI); //another bug
|
|
||||||
}
|
|
||||||
|
|
||||||
undo_redo->add_do_method(anim.ptr(), "remove_track", idx);
|
undo_redo->add_do_method(anim.ptr(), "remove_track", idx);
|
||||||
undo_redo->add_undo_method(anim.ptr(), "add_track", anim->track_get_type(i), idx);
|
undo_redo->add_undo_method(anim.ptr(), "add_track", anim->track_get_type(i), idx);
|
||||||
|
|||||||
Reference in New Issue
Block a user