From 72a01816a4df388292a9fc10fd2586ad488f751f Mon Sep 17 00:00:00 2001 From: Zi Ye Date: Tue, 2 Jul 2024 12:26:44 -0500 Subject: [PATCH] Make viewport grid visible on all three planes in ortho camera view --- doc/classes/EditorSettings.xml | 6 +++--- editor/plugins/node_3d_editor_plugin.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index c97ae197d9..8f28a8f45f 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -311,13 +311,13 @@ The grid size in units. Higher values prevent the grid from appearing "cut off" at certain angles, but make the grid more demanding to render. Depending on the camera's position, the grid may not be fully visible since a shader is used to fade it progressively. - If [code]true[/code], render the grid on an XY plane. This can be useful for 3D side-scrolling games. + If [code]true[/code], renders the grid on the XY plane in perspective view. This can be useful for 3D side-scrolling games. - If [code]true[/code], render the grid on an XZ plane. + If [code]true[/code], renders the grid on the XZ plane in perspective view. - If [code]true[/code], render the grid on a YZ plane. This can be useful for 3D side-scrolling games. + If [code]true[/code], renders the grid on the YZ plane in perspective view. This can be useful for 3D side-scrolling games. If [code]true[/code], enables 3-button mouse emulation mode. This is useful on laptops when using a trackpad. diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index c6a0dfb888..be154af01d 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -7296,9 +7296,9 @@ void Node3DEditor::_init_grid() { int primary_grid_steps = EDITOR_GET("editors/3d/primary_grid_steps"); // Which grid planes are enabled? Which should we generate? - grid_enable[0] = grid_visible[0] = EDITOR_GET("editors/3d/grid_xy_plane"); - grid_enable[1] = grid_visible[1] = EDITOR_GET("editors/3d/grid_yz_plane"); - grid_enable[2] = grid_visible[2] = EDITOR_GET("editors/3d/grid_xz_plane"); + grid_enable[0] = grid_visible[0] = orthogonal || EDITOR_GET("editors/3d/grid_xy_plane"); + grid_enable[1] = grid_visible[1] = orthogonal || EDITOR_GET("editors/3d/grid_yz_plane"); + grid_enable[2] = grid_visible[2] = orthogonal || EDITOR_GET("editors/3d/grid_xz_plane"); // Offsets division_level for bigger or smaller grids. // Default value is -0.2. -1.0 gives Blender-like behavior, 0.5 gives huge grids.