derkork / godot-resource-groups

An add-on for the Godot engine that simplifies handling of resources
MIT License
196 stars 6 forks source link

Invalid Resources cause plugin to hang editor on startup #10

Open Menacing opened 2 months ago

Menacing commented 2 months ago

I'm part way through a refactor on my project and have some invalid resources I need to clean up. This plugin prevents the editor from loading the project till I disable it. It will just hang on "scanning files" and stop responding.

Disabling the plugin allows the project to load immediately

derkork commented 2 months ago

Thanks for taking the time to report this!

I have tried to reproduce this locally by creating some resources and changing their paths afterwards outside the editor but I coudn't reproduce the problem. Could you give me some more details on how specifically the resources are invalid?

Also it would seem you use an older version of this plugin, because newer versions will not do any scanning on project load - they just register a few classes and then sit idly until a game is started or exported. If you aren't already on the latest version 0.4.0, could you try to update to the latest version of the plugin and see if the issue can still be reproduced with that? You can check the version in the project settings:

image

Menacing commented 2 months ago

It looks like when I updated from 0.3 to 0.4 it didn't get that change, when I deleted the addon folder and dropped in the 0.4 version, the editor starts correctly.

I think the issue isn't just any invalid resource, I think its specifically cyclical references. I ended up with a scene with an exported resource that also exports that same scene. I'm cleaning that issue up in my project, since it'd cause runtime issues anyway, so maybe this isn't an issue worth devoting time to

derkork commented 2 months ago

Well yes ultimately this is something that would need cleanup in the project anyways, but of course it would be nice if the editor didn't lock up.

That being said all the plugin does is try to load the resource and if this freezes up because of some circular dependency there is actually not a lot the plugin can do against that (after all it just calls godot's load function). The plugin tries to load each resource found by the scanner to make sure it is actually a resource type and can be loaded with the resource loader and I think this check is actually important to do (see https://github.com/derkork/godot-resource-groups/issues/8#issuecomment-2239309125) .

I also did some testing and deliberately tried to make some circular references which I couldn't do with the editor directly as it actually checks for that. I was able to manually code one into two .tres files but couldn't actually reproduce a freeze, rather Godot was unable to open either resource because it would need to load the other for that. Just out of curiosity could you tell me which Godot version you're using?

Menacing commented 2 months ago

I just recently updated to 4.3