3636#include " editor/multi_node_edit.h"
3737#include " editor/plugins/node_3d_editor_plugin.h"
3838#include " editor/themes/editor_scale.h"
39+ #ifndef NAVIGATION_3D_DISABLED
3940#include " scene/3d/navigation/navigation_region_3d.h"
41+ #endif // NAVIGATION_3D_DISABLED
4042#include " scene/3d/physics/collision_shape_3d.h"
4143#include " scene/3d/physics/static_body_3d.h"
4244#include " scene/gui/aspect_ratio_container.h"
@@ -214,7 +216,9 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
214216 } break ;
215217
216218 case MENU_OPTION_CREATE_NAVMESH: {
219+ #ifndef NAVIGATION_3D_DISABLED
217220 navigation_mesh_dialog->popup_centered (Vector2 (200 , 90 ));
221+ #endif // NAVIGATION_3D_DISABLED
218222 } break ;
219223
220224 case MENU_OPTION_CREATE_OUTLINE_MESH: {
@@ -485,6 +489,7 @@ void MeshInstance3DEditor::_debug_uv_draw() {
485489}
486490
487491void MeshInstance3DEditor::_create_navigation_mesh () {
492+ #ifndef NAVIGATION_3D_DISABLED
488493 Ref<Mesh> mesh = node->get_mesh ();
489494 if (mesh.is_null ()) {
490495 return ;
@@ -512,6 +517,7 @@ void MeshInstance3DEditor::_create_navigation_mesh() {
512517 ur->add_do_reference (nmi);
513518 ur->add_undo_method (node, " remove_child" , nmi);
514519 ur->commit_action ();
520+ #endif // NAVIGATION_3D_DISABLED
515521}
516522
517523void MeshInstance3DEditor::_create_outline_mesh () {
@@ -574,7 +580,9 @@ MeshInstance3DEditor::MeshInstance3DEditor() {
574580 Node3DEditor::get_singleton ()->add_control_to_menu_panel (options);
575581
576582 options->get_popup ()->add_item (TTR (" Create Collision Shape..." ), MENU_OPTION_CREATE_COLLISION_SHAPE);
583+ #ifndef NAVIGATION_3D_DISABLED
577584 options->get_popup ()->add_item (TTR (" Create Navigation Mesh" ), MENU_OPTION_CREATE_NAVMESH);
585+ #endif // NAVIGATION_3D_DISABLED
578586 options->get_popup ()->add_separator ();
579587 options->get_popup ()->add_item (TTR (" Create Outline Mesh..." ), MENU_OPTION_CREATE_OUTLINE_MESH);
580588 options->get_popup ()->set_item_tooltip (options->get_popup ()->get_item_count () - 1 , TTR (" Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\n This can be used instead of the StandardMaterial Grow property when using that property isn't possible." ));
@@ -660,6 +668,7 @@ MeshInstance3DEditor::MeshInstance3DEditor() {
660668 debug_uv->connect (SceneStringName (draw), callable_mp (this , &MeshInstance3DEditor::_debug_uv_draw));
661669 debug_uv_arc->add_child (debug_uv);
662670
671+ #ifndef NAVIGATION_3D_DISABLED
663672 navigation_mesh_dialog = memnew (ConfirmationDialog);
664673 navigation_mesh_dialog->set_title (TTR (" Create NavigationMesh" ));
665674 navigation_mesh_dialog->set_ok_button_text (TTR (" Create" ));
@@ -673,6 +682,7 @@ MeshInstance3DEditor::MeshInstance3DEditor() {
673682
674683 add_child (navigation_mesh_dialog);
675684 navigation_mesh_dialog->connect (SceneStringName (confirmed), callable_mp (this , &MeshInstance3DEditor::_create_navigation_mesh));
685+ #endif // NAVIGATION_3D_DISABLED
676686}
677687
678688void MeshInstance3DEditorPlugin::edit (Object *p_object) {
0 commit comments