From 6c0008a912f602155a52fb455422bdceebc67fac Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 20 Nov 2022 23:16:20 +0100 Subject: [PATCH] Added custom Paint, Web, and Mesh (MDI) nodes to the SceneTreeDock. --- modules/mesh_data_resource/editor/mdi_ed_plugin.cpp | 3 +++ modules/paint/paint_editor_plugin.cpp | 3 +++ modules/web/editor/web_node_editor_plugin.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/modules/mesh_data_resource/editor/mdi_ed_plugin.cpp b/modules/mesh_data_resource/editor/mdi_ed_plugin.cpp index ec22f43de..9cff0bda4 100644 --- a/modules/mesh_data_resource/editor/mdi_ed_plugin.cpp +++ b/modules/mesh_data_resource/editor/mdi_ed_plugin.cpp @@ -26,6 +26,7 @@ SOFTWARE. #include "mdi_ed.h" #include "mdi_gizmo.h" #include "mdi_gizmo_plugin.h" +#include "editor/editor_node.h" bool MDIEdPlugin::handles(Object *object) const { if (object->is_class("MeshDataInstance")) { @@ -500,6 +501,8 @@ MDIEdPlugin::MDIEdPlugin(EditorNode *p_node) { gizmo_plugin.instance(); gizmo_plugin->plugin = this; add_spatial_gizmo_plugin(gizmo_plugin); + + editor->get_scene_tree_dock()->add_custom_scene_root_class("Mesh", "MeshDataInstance"); } MDIEdPlugin::~MDIEdPlugin() { diff --git a/modules/paint/paint_editor_plugin.cpp b/modules/paint/paint_editor_plugin.cpp index 28335fdf2..560560ddb 100644 --- a/modules/paint/paint_editor_plugin.cpp +++ b/modules/paint/paint_editor_plugin.cpp @@ -23,6 +23,7 @@ SOFTWARE. #include "paint_editor_plugin.h" #include "core/config/engine.h" +#include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" @@ -74,6 +75,8 @@ PaintEditorPlugin::PaintEditorPlugin(EditorNode *p_node) { _inspector_plugin = memnew(PaintInspectorPlugin); add_inspector_plugin(_inspector_plugin); + + editor->get_scene_tree_dock()->add_custom_scene_root_class("Paint", "PaintCanvas"); } PaintEditorPlugin::~PaintEditorPlugin() { diff --git a/modules/web/editor/web_node_editor_plugin.cpp b/modules/web/editor/web_node_editor_plugin.cpp index 00ab11dbf..7dc6bc5c0 100644 --- a/modules/web/editor/web_node_editor_plugin.cpp +++ b/modules/web/editor/web_node_editor_plugin.cpp @@ -142,6 +142,8 @@ WebNodeEditorPlugin::WebNodeEditorPlugin(EditorNode *p_node) { _scene_has_webnode = false; Engine::get_singleton()->add_global("WebNodeEditor", window); + + editor->get_scene_tree_dock()->add_custom_scene_root_class("Web", "WebNode"); } WebNodeEditorPlugin::~WebNodeEditorPlugin() {