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

Unable to pack a scene if it has Python scripts #280

Open
dranorter opened this issue Mar 15, 2021 · 1 comment
Open

Unable to pack a scene if it has Python scripts #280

dranorter opened this issue Mar 15, 2021 · 1 comment

Comments

@dranorter
Copy link
Contributor

I have a simple project with a CSGMesh and a few other nodes. The CSGMesh has a Python script, which generates a small ArrayMesh. I wanted to try exporting the scene as a packed scene once the mesh was present. However, I find that calling packed_scene.pack(get_tree().get_current_scene()) fails with the error:

Pythonscript 0.50.0 (CPython 3.8.5.final.0)
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: `CSGMesh` object has no attribute `_import_path`
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: `CSGMesh` object has no attribute `script`

This happens the same way whether I make the call within a Python script, or a GDNative script.

When inspecting the node in the Inspector, of course, it does have the property "script", whose value corresponds to a python script.

Seems somewhat related to #267.

@touilleMan
Copy link
Owner

touilleMan commented Mar 27, 2021

Hi @dranorter

I think I found the issue: Node._import_path is a property, but it getter/setter are not defined in Godot's api.json version used to build version 0.50.0 of Godot Python (I guess it was this one https://github.com/godotengine/godot-headers/blob/f2122198d51f230d903f9585527248f6cf411494/api.json)

The good news is newer version of api.json seems to have fixed this \o/ (see https://github.com/godotengine/godot-headers/blob/godot-3.2.3-stable/api.json)

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

No branches or pull requests

2 participants