-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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 for Inspector not running code in @tool
scripts until restart
#92099
base: master
Are you sure you want to change the base?
Fix for Inspector not running code in @tool
scripts until restart
#92099
Conversation
8ba1180
to
ef6e94d
Compare
is there any chance this actually makes it into 4.3? This is still a problem in the current beta |
db87af6
to
1e33ec9
Compare
I modified the code to prevent recalling |
@tool
scripts until restart
334f999
to
3adf04c
Compare
There is now also a MR to document the issue this MR aims to resolve. |
3adf04c
to
9a27a6f
Compare
Just rebased to fix conflicts. |
This needs a rebase, but from initial testing this seems to fix tool scripts from not doing anything at all when first attached until the scene is reloaded. From reading old issues this is something that worked in the past, except for process overrides since those are called on ready. I have a branch built on top of this one that could be a solution for allowing tool scripts to run as soon as they are attached including the processes: https://github.com/Open-Industry-Project/godot/tree/tool-scripts-without-reloading-scene, ideally leading to a nice workflow of not having to reload the scene as often for testing. |
This PR should fix the problem where adding
@tool
in a GDScript where there are getters and setters does not work until the editor is restarted #66381.I figured out that the problem was caused by creating a PlaceHolderInstance when the script is not a tool and nothing was converting it to a GDScriptInstance when adding
@tool
. The inverse was probably also a problem when removing the@tool
.It's my first time working with the GDScript, so I certainly missed something especially that my fix was real simple to implement. I did not test extensively.
I did not modify anything to fix the same issue with C# script. I'll wait your feedback before trying the same fix with C#.
@tool
scripts until restart #66381 Fixes @tool functionality doesn't take effect until reloading the project. #95268