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

Built-in tool scripts aren't reloaded unless the scene is reloaded #15406

Closed
bluegamepoy opened this issue Jan 6, 2018 · 15 comments · Fixed by #54662
Closed

Built-in tool scripts aren't reloaded unless the scene is reloaded #15406

bluegamepoy opened this issue Jan 6, 2018 · 15 comments · Fixed by #54662

Comments

@bluegamepoy
Copy link

Godot version:

Godot 3.0

OS/device including version:

Windows 10

Issue description:

I just want to report an issue with tool mode. Tool mode only updates my object in the editor when I make changes to my exported variable, after I restart the editor. Basically tool mode doesn't unless the editor is restarted.

Steps to reproduce:
Ex:
tool
extends Panel

export (int) var orientation = 0 setget orientation_set

func orientation_set(new_value):
orientation = new_value
set('rect_rotation', orientation)

// So everytime I make changes to the orientation_set() function, I have to restart the editor. Not a major problem but its a hassle closing and opening godot.

Minimal reproduction project:

ToolBug.zip

@Zylann
Copy link
Contributor

Zylann commented Jan 6, 2018

Does closing and reopening the scene makes it work?

@mrcdk
Copy link
Contributor

mrcdk commented Jan 6, 2018

Can't reproduce on latest master 50b9755

https://i.imgur.com/BgaEpLJ.gifv

@bluegamepoy
Copy link
Author

scene

Does closing and reopening the scene makes it work?

Oh yeah, it does.

@bluegamepoy
Copy link
Author

Can't reproduce on latest master

I tried and its the same in the latest master. When I make change to the script, saving the scene also works. Guess this is not really a major problem.

@magpie514
Copy link

Is the script built-in?

@bluegamepoy
Copy link
Author

Is the script built-in?

I saved the script, and now changes takes effects everytime I save the scene.

@magpie514
Copy link

magpie514 commented Jan 7, 2018

Ah figured. I noticed it still happened in 3.0 and came to see if there was any related issue (in other words I can reproduce this). I'm pretty sure I reported it happening with builtin scripts way back, but I can't remember if anything came out of it.
Should look it up and maybe link to this issue if I can find a minute later.

@AssjackGames
Copy link

Just wanted to mention I also seem to have this bug (v 3.0), that is I can also reproduce it.
Oddly enough when I run the test project above it works fine, but it affects my own project.

@PLyczkowski
Copy link

Noticed a related issue: vars exported in tool mode, for example:
export(int, "Warrior", "Magician", "Thief") var character_class
after once set and then changed for instance to:
export(int, "Warrior", "Magician", "Thief", "Test") var character_class
don't get updated until editor restart (scene reopening does not update them).

@PLyczkowski
Copy link

^ Seems to only happen when saving script in external text editor? Saving in Godot editor and then reloading scene fixes the issue.

@T4g1
Copy link

T4g1 commented Aug 9, 2018

Seems related to #17044

@akien-mga akien-mga changed the title Tool Mode doesn't work unless godot is restarted Built-in tool scripts aren't reloaded unless the scene is reloaded Dec 18, 2018
@akien-mga akien-mga removed this from the 3.1 milestone Dec 18, 2018
@akien-mga
Copy link
Member

I could reproduce it on the master branch, and it only happens with builtin scripts (embedded in the scene file). If you save your tool script as .gd file, it gets properly reloaded on the fly.

@magpie514
Copy link

Yeah I'd very much like it to reload builtin scripts. At times your logic is just 10 lines long and it's not worth it to pollute the file layout any further with more tiny files (having an extra file for every image is already overkill and uncomfortable).

@GlaDOSik
Copy link

GlaDOSik commented Dec 3, 2019

After an hour of head scratching, I found this issue. Hope this is going to be fixed soon. I'm developing a pretty complex plugin so built-in scripts are important to me. But this bug makes the development painful.

@Calinou
Copy link
Member

Calinou commented Apr 29, 2020

The external editor part is already being tracked in #29379. See also #31758.

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

Successfully merging a pull request may close this issue.