How to make a class from gdnative from a plugin, visible in the node list

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By moechofe


I’m creating a plugin with gdnative c++.
I created a simple class, compile the library, make a simple script working according to the official example.

Now I want to add my stuff like a custom node. The gdscript editor can complete my class name and access it’s property, but I can’t see it in the window to add a new node to a scene with [ctrl+a].

How to do that?

:bust_in_silhouette: Reply From: spaceyjase

Open the Project Settings and click on the Plugins tab. Your plugin should be in the list. If it is not showing, click on the Update button in the top-right corner. Assuming the plugin is inactive on the Status column; click on the status to select Active.

Hm, the problem is not about the plugin not being updated. It’s about registering a Node that can be used in the editor that has been make with gdnative.

moechofe | 2021-11-10 14:53

:bust_in_silhouette: Reply From: sash-rc

First, learn how to create editor plugin aka tool: Making plugins — Godot Engine (stable) documentation in English with GDScript.

Then, in C++ use register_tool_class<YourClass>() instead as you would normally use register_class<YourClass>() for your custom type.