Closed Zylann closed 10 months ago
- It pollutes the Add Node dialog with nodes that should never be created by the user.
- It pollutes the Editor Help with classes that should not be accessible.
Both can easily be solved by using the GDREGISTER_INTERNAL_CLASS
macro. These classes won't appear in the Add Node dialog window nor in the editor help search window when using F1
or whatever you have bound search/help to.
Yep, this issue predates GDREGISTER_INTERNAL_CLASS()
.
I think we can consider this issue fixed by PR https://github.com/godotengine/godot-cpp/pull/970
Godot version
Godot 4.0, 4.1
godot-cpp version
4.1
System information
Windows 10 64 bits NVIDIA GeForce GTX 1060
Issue description
I maintain a module that can also compile as an extension, and it needs to register EditorPlugins. The problem is that in order to work, I have to register all the classes that take part in these plugins:
https://github.com/Zylann/godot_voxel/blob/3f4b0b20cd6e9a093c60a3116decd63710c168e0/register_types.cpp#L342-L386
But I don't intend these classes to be accessible by users... just like a plethora of editor classes in Godot core.
This causes a number of issues:
EditorNode
or other editor-only singletons that may not exist at that time (this is another serious problem which needs its own issue!).Ideally, there must be a way to register a class for Godot to be able to instantiate an extension, but without exposing it, which means none of these issues would occur in the first place.
I assume https://github.com/godotengine/godot-cpp/pull/970 would fix it.
Example of crash:
https://github.com/Zylann/godot_voxel/blob/3f4b0b20cd6e9a093c60a3116decd63710c168e0/editor/blocky_library/voxel_blocky_library_editor_plugin.cpp#L32
Steps to reproduce
Have an
EditorPlugin
that callsget_editor_interface()->get_base_control()
in its constructor.Minimal reproduction project
N.A