Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneTreeDock: Remove animation tracks with correct indices #81651

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

garychia
Copy link
Contributor

Fixes #81602

The index of an animation track to be removed was not determined correctly. HashSet was used to find out the updated index but it does not always keep its keys in the same order after erasing a key.

@garychia garychia requested a review from a team as a code owner September 14, 2023 14:10
@fire fire requested a review from a team September 14, 2023 14:15
@akien-mga akien-mga added bug topic:editor topic:animation cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Sep 14, 2023
@akien-mga akien-mga added this to the 4.2 milestone Sep 14, 2023
@YuriSizov
Copy link
Contributor

While the trick makes sense, wouldn't it be more convenient to start from the end? That way indices are not changing under your feet.

@garychia
Copy link
Contributor Author

I tried to start from the end but it became a bit complicated to handle the undo part as removed tracks would need to be reinserted in reverse order.

@YuriSizov YuriSizov merged commit 2568807 into godotengine:master Sep 15, 2023
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@garychia garychia deleted the delete_anim_tracks branch September 19, 2023 05:02
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnimationPlayer unexpectedly deletes or adds tracks when Undo after nodes are deleted.
4 participants