godot-python icon indicating copy to clipboard operation
godot-python copied to clipboard

How to make a class_name object with a Python script?

Open ghost opened this issue 5 years ago • 4 comments

As described here in the documentation: https://docs.godotengine.org/en/3.2/getting_started/scripting/gdscript/gdscript_basics.html#classes In GDScript you can define a class to appear in the "Create new node" dialogue and be possible to refer to that script with a name as any Godot default node class. There should be an option to have this in a Python script too.

ghost avatar Dec 06 '20 18:12 ghost

Hi @Codified-Vexing,

This feature is not supported yet (it will require some changes in Godot's Pluginscript API, so it most likely won't be available before Godot 4.0)

touilleMan avatar Dec 07 '20 10:12 touilleMan

this is wip ^^ https://github.com/godotengine/godot/pull/44176

touilleMan avatar Dec 07 '20 23:12 touilleMan

Hi I am very unfamiliar with the github environment. Does your last comment mean that the feature has been implemented? If so, how is it done ?

giamo152 avatar Apr 09 '21 06:04 giamo152

@giamo152, the link was originally to an in-progress pull request, which means touilleMan wrote a partial or complete solution and requested that it be merged into Godot itself (since this issue really is on Godot's side, not godot-python). That request was later approved, which means it is now part of the master branch of Godot. However, the "master" branch refers to Godot 4.0, meaning this feature won't be released until their 4.0 release. (This is because it's bad practice to make API changes in minor version releases.)

dranorter avatar Apr 10 '21 00:04 dranorter