Skip to content

Commit

Permalink
Merge pull request #90183 from stevenjt/fix-gizmo-on-top-material-option
Browse files Browse the repository at this point in the history
Fix gizmo on top material option having no effect
  • Loading branch information
akien-mga committed Apr 12, 2024
2 parents a95893c + 9b1a1d2 commit 5eadb88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/plugins/node_3d_editor_gizmos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,11 @@ Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_na

Ref<StandardMaterial3D> mat = materials[p_name][index];

if (current_state == ON_TOP && p_gizmo->is_selected()) {
bool on_top_mat = mat->get_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST);

if (!on_top_mat && current_state == ON_TOP && p_gizmo->is_selected()) {
mat = mat->duplicate();
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
} else {
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, false);
}

return mat;
Expand Down

0 comments on commit 5eadb88

Please sign in to comment.