-
-
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
Renaming nested StateMachine has unexpected behavior (rename to "null") and sometimes crashes #58822
Comments
I can reproduce this in |
When the next alpha comes out in a couple days I will test again and close this issue if fixed. |
In alpha 4 using enter key to accept the entered text works more often, but also seems to crash more often. The unexpected values have stopped, but once it renamed itself to "null" instead .... |
This is a tricky one, but as far as I was able to determine so far it is caused by the animation blend tree editor listening to both the enter key being pressed and the text field losing focus. If either of these signal connections is disabled, the text field works as expected. Maybe it's caused by both signals firing at the same time and the editor doing some funky stuff to nodes that have just become invalid as the graph is being updated? 🤷♂️ |
I have the same issue in 4.0 alpha 11. When a crash doesn't occur, the resulting name changes randomly or it changes to null. At times, the name of the previously selected node changes (to null or to some other name previously used by some other randomly chosen node) at the same time. The name change seems to work more frequently when I tab out of the name field, but not always. That may just be random coincidence, though. |
Yeah, I can consistently avoid these problems when I deactivate either the connection to the LineEdit's godot/editor/plugins/animation_blend_tree_editor_plugin.cpp Lines 150 to 151 in 1d06fec
|
I don't know much about pointers and memory, but I think I've largely worked out what's going on. The crashing and strange naming behaviour both seem to be caused by Crashes give this backtrace:
(custom build is It looks like the crash happens after
This is causing a problem when the freed Infrequently, I get an error in place of the crash:
which seems to be triggered by some addition or another I've made while debugging, but I can't pinpoint what. I think the crash is averted if the pointer for the After the graph has been destroyed and rebuilt in Incorrect naming stops when |
Can confirm that this is currently on the latest 4.0 A16 Build still
|
This still occurs in Godot 4.0 Beta 2. The work around seems to be to click or tab out of naming the node after typing in the name instead of hitting the Enter key. So the error seems to happen in the code that corresponds to the ENTER key being pressed |
I'm 99% sure this is already fixed in 4.0, can someone confirm? I remember a PR doing it and it doesn't crash anymore on my system |
The issue is still present in 4.0.beta according to #65289. |
i see, thanks for clarifying |
I cannot reproduce it with any MRP. Is this an environment dependent issue? Does anyone have an MRP that causes the bug with the latest master? |
I can't reproduce either in 4.0 RC 2. From the above comments it seems like others couldn't reproduce in November either, this was likely fixed in September or October. |
@akien-mga actually, I just did (over and over :x) |
This always happens for me with both the 4.0rc2 version and my own master branch build (at 37589edf). |
Thanks for the new reproduction project! It doesn't crash for me on 4.0.rc2 and latest
And indeed the connection from Start jumps to point to empty space when renaming the node. CC @TokageItLab |
Yes, the crash doesn't happen in this case (and I'm on Linux too) and I also have the same message as you (didn't see it before). Actually, now that I think about it, I'm pretty sure I've only had a single crash after renaming (but I do know it happened). I'll post any more info I have here. Thanks for replying that fast :) |
Probably this is a problem related to SubStateMachine (I believe that most of the problems mentioned above have been fixed). Currently the nested StateMachines are implemented in a very wrong way and their internal paths are also generated in a very hacky way, we plan to fix them in 4.1, but we can only send them cleanup PRs for 4.0RC. What should we do? (The connection to the nested StateMachine will be disconnected by those PR, resulting in a slight breaks compatibility.) |
if there isn't time to fix it properly for 4.0, an interim fix is to forbid renaming in the conditions that cause the bug (if there is nesting)... And if users really want to rename for now, they can manually find/replace within the .tscn or .tres. Alternatively, we can see if it's a simple mistake that is easy to fix in the existing code. |
Just hit this today in 4.0.1-rc2.
What are these conditions? I'd love to avoid them. |
Godot version
4.0 alpha 3
System information
Linux
Issue description
When renaming an AnimationNode that inside a BlendTree (used in an AnimationTree of course), the name is not changed to the entered text, and instead is changed to a seemingly arbitrary string (or sometimes "null"). In another project of mine, this causes crashes (possibly the same as #57370)
Also possibly related: #51889
Upon some further testing, I think this is is almost certainly a regression of #57370
Steps to reproduce
Minimal reproduction project
AnimTreeNodeRenameBug.zip
The text was updated successfully, but these errors were encountered: