-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 the error when clicking AnimationTree in the editor #79588
Conversation
Thanks for opening a PR, but I don't think this is a correct solution. These are exactly the same checks, so if this fixes the issue that can only be possible by accident. If we need to be aware of running this code from the main thread only, it needs to be done explicitly. I, unfortunately, can't tell without investigating what exactly depends on the main thread. So I can't point you to anything more specific. |
When |
Right, but my point is that the reason for this order is not obvious from the code as it is. It needs to be made explicit why the checks are there and in this order. At least something like this would help: if (!singleton->tree || !singleton->is_visible()) {
return Vector<String>(); // Not in the main thread, returning.
}
AnimationTree *tree = singleton->tree;
if (!tree->has_node(tree->get_animation_player())) {
return Vector<String>();
}
|
I followed your format and made some modifications, the deeper reasons, can only rely on others to solve it, my abilities are limited. |
Thanks! |
Fix #78052