48
48
#include " editor/gui/editor_toaster.h"
49
49
#include " editor/gui/scene_tree_editor.h"
50
50
#include " editor/inspector_dock.h"
51
- #include " editor/plugins/node_3d_editor_plugin.h"
52
51
#include " editor/property_selector.h"
53
52
#include " editor/themes/editor_scale.h"
54
53
#include " main/main.h"
55
54
#include " plugins/editor_preview_plugins.h"
56
- #include " scene/3d/light_3d.h"
57
- #include " scene/3d/mesh_instance_3d.h"
58
55
#include " scene/gui/box_container.h"
59
56
#include " scene/gui/control.h"
60
57
#include " scene/main/window.h"
61
58
#include " scene/resources/theme.h"
62
59
60
+ #ifndef _3D_DISABLED
61
+ #include " editor/plugins/node_3d_editor_plugin.h"
62
+ #include " scene/3d/light_3d.h"
63
+ #include " scene/3d/mesh_instance_3d.h"
64
+ #endif // _3D_DISABLED
65
+
63
66
EditorInterface *EditorInterface::singleton = nullptr ;
64
67
65
68
void EditorInterface::restart_editor (bool p_save) {
@@ -103,6 +106,7 @@ EditorUndoRedoManager *EditorInterface::get_editor_undo_redo() const {
103
106
return EditorUndoRedoManager::get_singleton ();
104
107
}
105
108
109
+ #ifndef _3D_DISABLED
106
110
AABB EditorInterface::_calculate_aabb_for_scene (Node *p_node, AABB &p_scene_aabb) {
107
111
MeshInstance3D *mesh_node = Object::cast_to<MeshInstance3D>(p_node);
108
112
if (mesh_node && mesh_node->get_mesh ().is_valid ()) {
@@ -359,6 +363,7 @@ void EditorInterface::make_scene_preview(const String &p_path, Node *p_scene, in
359
363
EditorResourcePreview::get_singleton ()->check_for_invalidation (p_path);
360
364
EditorFileSystem::get_singleton ()->emit_signal (SNAME (" filesystem_changed" ));
361
365
}
366
+ #endif // _3D_DISABLED
362
367
363
368
void EditorInterface::set_plugin_enabled (const String &p_plugin, bool p_enabled) {
364
369
EditorNode::get_singleton ()->set_addon_plugin_enabled (p_plugin, p_enabled, true );
@@ -390,10 +395,12 @@ SubViewport *EditorInterface::get_editor_viewport_2d() const {
390
395
return EditorNode::get_singleton ()->get_scene_root ();
391
396
}
392
397
398
+ #ifndef _3D_DISABLED
393
399
SubViewport *EditorInterface::get_editor_viewport_3d (int p_idx) const {
394
400
ERR_FAIL_INDEX_V (p_idx, static_cast <int >(Node3DEditor::VIEWPORTS_COUNT), nullptr );
395
401
return Node3DEditor::get_singleton ()->get_editor_viewport (p_idx)->get_viewport_node ();
396
402
}
403
+ #endif // _3D_DISABLED
397
404
398
405
void EditorInterface::set_main_screen_editor (const String &p_name) {
399
406
EditorNode::get_singleton ()->get_editor_main_screen ()->select_by_name (p_name);
@@ -754,10 +761,12 @@ void EditorInterface::get_argument_options(const StringName &p_function, int p_i
754
761
for (String E : { " \" 2D\" " , " \" 3D\" " , " \" Script\" " , " \" Game\" " , " \" AssetLib\" " }) {
755
762
r_options->push_back (E);
756
763
}
764
+ #ifndef _3D_DISABLED
757
765
} else if (pf == " get_editor_viewport_3d" ) {
758
766
for (uint32_t i = 0 ; i < Node3DEditor::VIEWPORTS_COUNT; i++) {
759
767
r_options->push_back (String::num_int64 (i));
760
768
}
769
+ #endif // _3D_DISABLED
761
770
}
762
771
}
763
772
Object::get_argument_options (p_function, p_idx, r_options);
@@ -779,7 +788,9 @@ void EditorInterface::_bind_methods() {
779
788
ClassDB::bind_method (D_METHOD (" get_editor_toaster" ), &EditorInterface::get_editor_toaster);
780
789
ClassDB::bind_method (D_METHOD (" get_editor_undo_redo" ), &EditorInterface::get_editor_undo_redo);
781
790
791
+ #ifndef _3D_DISABLED
782
792
ClassDB::bind_method (D_METHOD (" make_mesh_previews" , " meshes" , " preview_size" ), &EditorInterface::_make_mesh_previews);
793
+ #endif // _3D_DISABLED
783
794
784
795
ClassDB::bind_method (D_METHOD (" set_plugin_enabled" , " plugin" , " enabled" ), &EditorInterface::set_plugin_enabled);
785
796
ClassDB::bind_method (D_METHOD (" is_plugin_enabled" , " plugin" ), &EditorInterface::is_plugin_enabled);
@@ -791,7 +802,9 @@ void EditorInterface::_bind_methods() {
791
802
ClassDB::bind_method (D_METHOD (" get_editor_main_screen" ), &EditorInterface::get_editor_main_screen);
792
803
ClassDB::bind_method (D_METHOD (" get_script_editor" ), &EditorInterface::get_script_editor);
793
804
ClassDB::bind_method (D_METHOD (" get_editor_viewport_2d" ), &EditorInterface::get_editor_viewport_2d);
805
+ #ifndef _3D_DISABLED
794
806
ClassDB::bind_method (D_METHOD (" get_editor_viewport_3d" , " idx" ), &EditorInterface::get_editor_viewport_3d, DEFVAL (0 ));
807
+ #endif // _3D_DISABLED
795
808
796
809
ClassDB::bind_method (D_METHOD (" set_main_screen_editor" , " name" ), &EditorInterface::set_main_screen_editor);
797
810
ClassDB::bind_method (D_METHOD (" set_distraction_free_mode" , " enter" ), &EditorInterface::set_distraction_free_mode);
0 commit comments