-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Files imported as custom resource types are not considered as resources #20496
Comments
Hello from the future! Dunno if you're past this, but I'm running into something similar now. If you change the type returned from the EditorImportPlugin to "Resource", it lets you use either Load or drag'n'drop to associate a file to a resource slot, as you'd expect. I'm not sure what functionality you might lose by doing that, but at least so far it doesn't seem to hurt anything. That might be all it takes, though I hit another snag after getting past that - the ResourceSaver doesn't seem to be serializing my resource correctly. I'm using C#, and it's possible it's a C#-specific issue and may not affect you. If it does, you can work around it by skipping the ResourceSaver and directly writing the tres file with the information you need to the file system (I used the inspector to generate one and then used it as a template.) I opened a separate ticket about that issue here: #38191 |
The first arguments passed on |
Yes, it is. |
@AnidemDex Will check as soon as I can. |
@paulloz this is the reproduction project https://github.com/AnidemDex/Godot-CustomResource |
So @AnidemDex, nothing changed AFAIK. Your example works because you are importing things as a |
Maybe is related to this? godotengine/godot-proposals#18 (comment) ClassDB can't found that type in native classes, so is not recognized as resource or that specific resource type |
Yeah, I'm pretty sure this is a duplicate of #32706, as @AnidemDex mentioned. And it's definitely related to exported resources, but it's a bit more than that. The only way to fix this is to cache what scripted type and icon are associated with a file during the filesystem scanning process, that way the filesystem dock is able to render the icon without actually loading the entire resource. And the mentioned Issue already has a PR ready to implement it. Pretty sure this can be closed. |
Duplicate of #32706. |
First of all sorry if this issue title is unclear. I can't find a better way to describe this in a quick way.
Godot version: 832e2bf
OS/device including version: Win10 x64
Issue description:
Here are possibly related issues I've found: #17395, #6763, #6067
I have this pretty simple plug-in defining a custom resource type and a resource importer.
The import plugin is setting the
resource_type
like so.So far, everything's fine.
The import plug-in works like a charm:
And the custom resource type is shown in the list of exported properties (I used
export (Resource) var Story
):However, even once imported, the icon aside the file here does not update (it's updating if the resource_type in the import plug-in is set to a built-in one):
More importantly, it's impossible to set this file/resource to the previously mentioned exported property (whether it is by drag'n'dropping it or using the
Load
button).Bests ❤️
The text was updated successfully, but these errors were encountered: