utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
482 stars 52 forks source link

"Unable to load addon script from path" when working with Version control #184

Open RetroSpecter opened 10 months ago

RetroSpecter commented 10 months ago

When initially setting up the fmod addon, things seem to work smoothly. However, if I hop to a separate branch and come back to it, or hop to the branch from a separate screen, I end up with the following popup, and am unable to re-enable the addon from the plugins menu:

Unable to load addon script from path: 'res://addons/fmod/FmodPlugin.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/fmod/plugin.cfg' to prevent further errors.

It seems to fix itself if I reimport the addon, however that isn't a very viable solution.

Currently on Godot 4.2.0 mono (granted a custom build for Spine2D, but I don't think that would cause the issue).

RetroSpecter commented 10 months ago

So I did more investigation, and it looks like it is being caused by the .gitignore included in the fmod folder ignoring certain filetypes in the libs folder.

image

If I readd them, the plugin seems to work again (though of course they don't show up in VC because of the .gitignore).

Curious as to if there was a particular reason they were ignored. Is it leftover from when you couldn't redistribute the fmod libraries? image

piiertho commented 10 months ago

Hello ! Libraries files are not committed in repo to avoid making repo disk size grow up at each fmod update.
If you want to commit them in your repo, you can simply remove libs folder from gitignore.
Maybe we should remove gitignore file when building add-on in CI.

JackEvans24 commented 3 months ago

Hi, just run into a similar issue here.

The structure of the .gitignore file suggests that the intended behaviour is to ignore those file types outside of the libs directory (using the ! negation). The negation doesn't work as a coverall for a top-level directory, so the actual files you need aren't saved to version control.

I've fixed this in my project by being a bit more specific with the negation:

*.dll
*.a
*.dylib
*.so

!libs/android/arm64
!libs/iOS/
!libs/linux/
!libs/macos/
!libs/windows/

Hope this helps :)

0-Vanes-0 commented 1 week ago

I tried same above but didn't succeed.

It seems to fix itself if I reimport the addon, however that isn't a very viable solution.

I just told my contributor of my repo to delete fmod folder from addons and redownload extension's release with unpacking it at addons once again. It's not such a problem if I have 2-3 programmers in total but yeah.

CedNaru commented 1 week ago

I think the issue is mire likely to be a bug related to Godot itself more than the FMOD plugin itself. Hopefully, this PR will fix that in the next Godot release: https://github.com/godotengine/godot/pull/98041