Hi, I'm rather new to Godot so apologies if this solution is rather simple.

I've noticed that the editor for Godot is itself run with the Godot engine. That gave me a thought. Could I instance the Godot code editor in my own project, and interface with it to add more functionality?

I've tried looking at the github repo for the definition of the code editor and possibly somewhere I could extract it, and while I found what looks like a lot of the logic, I'm not sure how to integrate this into my project, and also add features.

Any thoughts on how I should approach this?

Godot editor is indeed itself a godot project, but the engine can be used via C/C++ alone and afaik the editor is built that way, so what you are asking about might be doable, but probably only if your project is similarly a C/C++ project I suspect.

2 months later

Ok, so I've got a basic C++ project set up from https://github.com/godotengine/gdnative-demos/tree/master/cpp/simple . I imagine the next step would be calling the editors initialisation methods from my own script.

However, in order to access the editor methods I'd need to include some header files from godot, which I'm unsure how to build. Is there any "best" way to do this, or should I just try copying the entirety of godot into the same folder.

I don't think you really want to use GDNative but instead work with godot source directly and customize and/or add your own modules. You could certainly try though.

In terms of C/C++ users the forums is perhaps not the best place to find them though. I think most tend to be active on IRC instead. Still would be nice to see more low level engine users active here to be sure tho.

I will have a look into this too. I will post my findings here.

Here's what I've found: ./editor/code_editor.h is used by ./editor/plugins/script_text_editor.h That is then used in ./editor/plugins/script_editor_plugin.h

In ./scene/register_scene_types.cpp I tried registering CodeTextEditor into ClassDB. It compiled fine, however the editor just crashed on launching a project. So I tried registering ScriptTextEditor into ClassDB instead and got the same crash.

I've also noticed that ScriptTextEditor and CodeTextEditor are lacking bind_methods(). I think to get this working, one would need to implement a bind_methods() and define the default properties.. It's just a hunch though! Good luck, and I will update on this post if I find anything else out!

Here is the backtrace from the crash I got with the last attemp: [0] mtx_do_lock (d:\agent_work\63\s\src\vctools\crt\github\stl\src\mutex.cpp:92) [1] mtx_do_lock (d:\agent_work\63\s\src\vctools\crt\github\stl\src\mutex.cpp:92) [2] EDITOR_GET [3] CodeTextEditor::CodeTextEditor [4] ScriptTextEditor::ScriptTextEditor [5] ClassDB::creator<ScriptTextEditor> (C:\godot\core\class_db.h:143) [6] ClassDB::instance [7] ClassDB::class_get_default_property_value [8] DocData::generate [9] DocData::generate [10] EditorHelp::generate_doc [11] EditorNode::EditorNode [12] Main::start (C:\godot\main\main.cpp:1808) [13] widechar_main [14] main [15] main [16] __scrt_common_main_seh (d:\agent_work\63\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288) [17] BaseThreadInitThunk

The Godot script editor depends on a lot of editor functionality. It's not something you can expect to run in a self-contained manner, even if you manage to extract its code somehow.

2 years later