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

Assets should be imported before running plugins and tool scripts #36713

Open
aaronfranke opened this issue Mar 1, 2020 · 2 comments · Fixed by #52344
Open

Assets should be imported before running plugins and tool scripts #36713

aaronfranke opened this issue Mar 1, 2020 · 2 comments · Fixed by #52344

Comments

@aaronfranke
Copy link
Member

aaronfranke commented Mar 1, 2020

Godot version: 3.2 stable

OS/device including version: Ubuntu, but likely applies elsewhere.

Issue description:

If I delete .import and load the 2.5D demo projects, I get this error:

Unable to load addon script from path: 'res://addons/node25d/node25d_plugin.gd' There seems to be an error in the code, please check the syntax.

However, if I then restart Godot, it works fine.

I think the root of the problem is that the assets are currently imported after (or at the same time as) the plugins are ran. This causes the scripts to fail the first time, so it's really annoying.

To fix this issue, Godot should import all assets before attempting to run plugins or other scripts.

EDIT: Actually, it's not so simple. Some scripts we want to run before importing assets. For example, scripts that extend the GLTF importer need to be run before GLTF files are imported. So we need some kind of dependency system that determines which assets a script needs to be imported before running. Or maybe as a quick fix we can force simple PNG/JPEG/etc files to import before scripts, and have more complex models wait to import? I'm not sure, it's a tricky situation.

@akien-mga
Copy link
Member

akien-mga commented Nov 15, 2021

Reopening as #52344 was reverted due to regressions.

@nathanfranke
Copy link
Contributor

nathanfranke commented Feb 3, 2022

Using load instead of preload in plugin.gd seems to work for me.

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