Merge pull request #90183 from stevenjt/fix-gizmo-on-top-material-option
Fix gizmo on top material option having no effect
This commit is contained in:
commit
5eadb88596
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue