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

Fix crash on reimport scene with animations #95084

Conversation

Hilderin
Copy link
Contributor

@Hilderin Hilderin commented Aug 2, 2024

At first, I thought the issue was in the importation, but it turns out it's a regression from #94093. In reality, the fact that the reimportation actually works caused the problem.

The issue was caused by the current editable object in the editor_history. After the reimportation, EditorNode::_edit_current is called in EditorNode::_set_current_scene_nocheck, but at that time, the ObjectID from the original AnimationPlayer is still valid, and that AnimationPlayer is kept by the AnimationPlayerPlugin. Eventually, the original AnimationPlayer gets destroyed, causing the crash.

The solution was to replace the old ObjectID with the new ObjectID for all the new nodes in the reimportation process. The bonus here is that the history is kept intact, and the previous and next buttons in the Inspector now work after a reimportation!

@akien-mga akien-mga merged commit 3158bbd into godotengine:master Aug 6, 2024
18 checks passed
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.

Crash when adding or removing animation from Blender
4 participants