EditorResourcePreviewGenerator & Custom Resource Questions

Godot Version

4.3, Mono

Question

I’m adding Editor Inspector functionality for a custom resource. I’m trying to avoid using InspectorPlugins, but I may have to. My class, NoiseResource, inherits from FastNoiseLite. It defines some optional parameters to change how the noise is sampled.

Is it possible to implement a custom EditorResourcePreviewGenerator for such a class? I wrote one that I thought would work, and made sure to add/remove it via a plugin’s _EnterTree calls, so it is registering, but whenever I check the type of resource in the ERPG’s _Handles() method, it receives only a string representing the built-in resource type the custom resource inherited from; in other words, custom resources inheriting from FastNoiseLite will only be seen in _Handles as FastNoiseLite, even if you implement a custom _Get() method for reporting the resource’s type name differently.

I created a sample project to illustrate the issue I’m having. I tried reading the docs and searching the Godot project github for issues related to this, but I could only find one page regarding the poor quality of the documentation.

This question was solved thanks to some helpful feedback in the engine’s docs repo. I updated my sample project to correctly use this class, in case anyone wants to take a look later at how to do it.