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

Tools (export(tool=True)) do not reload on save #286

Open
dranorter opened this issue Mar 20, 2021 · 0 comments
Open

Tools (export(tool=True)) do not reload on save #286

dranorter opened this issue Mar 20, 2021 · 0 comments

Comments

@dranorter
Copy link
Contributor

dranorter commented Mar 20, 2021

I can see that #180 was labeled as a "partially fixes #170", but #170 got closed. The specific errors in #170 are fixed, but I have not been able to reload any type of tool script with any method besides a restart of the editor.

When I save changes to a script, errors appear in the output which are identical to the ones quoted on #280: AttributeError tool_class object has no attribute script.

The specific attributes complained about seem to depend on the type of node the script is attached to. For example a Node2D will just complain about "editor_description" and "script", whereas an AnimatedSprite will raise the same exception regarding the attribute "playing".

I decided to experiment with this a bit, and set up the following class:

from godot import exposed, ProjectSettings, ResourceLoader
from godot import export
from godot import *

@exposed(tool=True)
class tool_script(AnimatedSprite):
	
	def _enter_tree(self):
		# Initialization of the plugin goes here
		print("tree entered")
		
	def _ready(self):
		print("ready")
		
	def _process(self,delta):
		pass

Checking the "Playing" box in the inspector gives:


Traceback (most recent call last):
  File "build\windows-64\pythonscript\_godot_instance.pxi", line 67, in _godot.pythonscript_instance_get_prop
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 244, in godot.bindings.Object.__getattr__
AttributeError: `tool_script` object has no attribute `playing`
Traceback (most recent call last):
  File "build\windows-64\pythonscript\_godot_instance.pxi", line 52, in _godot.pythonscript_instance_set_prop
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 253, in godot.bindings.Object.__setattr__
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 171577, in godot.bindings.AnimatedSprite.playing.__set__
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 244, in godot.bindings.Object.__getattr__
AttributeError: `tool_script` object has no attribute `_set_playing`
Set playing
Traceback (most recent call last):
  File "build\windows-64\pythonscript\_godot_instance.pxi", line 67, in _godot.pythonscript_instance_get_prop
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 244, in godot.bindings.Object.__getattr__
AttributeError: `tool_script` object has no attribute `playing`
Traceback (most recent call last):
  File "build\windows-64\pythonscript\_godot_instance.pxi", line 67, in _godot.pythonscript_instance_get_prop
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 244, in godot.bindings.Object.__getattr__
AttributeError: `tool_script` object has no attribute `playing`
Traceback (most recent call last):
  File "build\windows-64\pythonscript\_godot_instance.pxi", line 67, in _godot.pythonscript_instance_get_prop
  File "build\windows-64\pythonscript\godot\bindings.pyx", line 244, in godot.bindings.Object.__getattr__
AttributeError: `tool_script` object has no attribute `playing`

I can avoid all these errors if I use an autoload class; however, the script still does not reload. I guess that leaves me with no specific leads.

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

No branches or pull requests

1 participant