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

Godot 3.5: AnimationPlayer Animation window: deleting last track causes spurious error "Index track = N is out of bounds (animation->get_track_count() = N)" #79587

Open
hsandt opened this issue Jul 17, 2023 · 2 comments

Comments

@hsandt
Copy link
Contributor

hsandt commented Jul 17, 2023

Godot version

v3.5.2.stable.official [170ba33]

System information

Linux Ubuntu 22.04 with Unity desktop

Issue description

Note: I did not test this with Godot 4, but I don't remember having it on Godot 4 either

When I delete the last track of some animation on my Animation Player in the Animation window, I get the following error:

editor/animation_track_editor.cpp:1850 - Index track = N is out of bounds (animation->get_track_count() = N).

where N is the index of the removed track.

It's as if the index was checked after removing the track instead of before.

Steps to reproduce

  1. Create an AnimationPlayer + some Animation with some tracks
  2. Delete the last track

Minimal reproduction project

N/A

@lawnjelly
Copy link
Member

I'm not super familiar with the AnimationTrack editor but I think this is benign. When deleting the AnimationTrackEdit, during the delete the Control::remove_child_notify() sends a _propagate_theme_changed for the some reason.

As part of the theme it checks the track ID within the animation is within range, and it no longer is.

I'm presuming it deletes the track itself from the animation, then calls AnimationTrackEditor::_update_tracks which flags the error.

Simplest thing is to just fail when out of range, but not show error message.

@lawnjelly
Copy link
Member

Marked as good first issue as it should just be changing the ERR_FAIL_INDEX to a silent return on the same condition (unless reviewers have another preference to fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants