[Bf-blender-cvs] [dee5c1aa409] master: MeshAnalysis: Disable when XRay is turned on
Jeroen Bakker
noreply at git.blender.org
Tue May 28 15:10:25 CEST 2019
Commit: dee5c1aa409cb9d3f80f7b8422b073e67a469cfc
Author: Jeroen Bakker
Date: Tue May 28 13:00:40 2019 +0200
Branches: master
https://developer.blender.org/rBdee5c1aa409cb9d3f80f7b8422b073e67a469cfc
MeshAnalysis: Disable when XRay is turned on
When XRay is turned on the mesh analysis did not draw correct. This
change won't draw the mesh analysis overlay when xray is turned on.
In terms of giving the user a visual feedback of this limitation we
render the overlay options inactive.
Reviewed By: brecht, fclem
Maniphest Tasks: T65225
Differential Revision: https://developer.blender.org/D4965
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/draw/engines/workbench/workbench_forward.c
M source/blender/draw/modes/edit_mesh_mode.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index b79d5bf7aa2..fdf9570763a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -5557,6 +5557,7 @@ class VIEW3D_PT_overlay_edit_mesh_shading(Panel):
layout = self.layout
view = context.space_data
+ shading = view.shading
overlay = view.overlay
tool_settings = context.tool_settings
display_all = overlay.show_overlays
@@ -5574,12 +5575,21 @@ class VIEW3D_PT_overlay_edit_mesh_shading(Panel):
sub = row.row()
sub.prop(tool_settings, "vertex_group_user", expand=True)
- col.prop(overlay, "show_statvis", text="Mesh Analysis")
+ if shading.type == 'WIREFRAME':
+ xray = shading.show_xray_wireframe and shading.xray_alpha_wireframe < 1.0
+ elif shading.type == 'SOLID':
+ xray = shading.show_xray and shading.xray_alpha < 1.0
+ else:
+ xray = False
+ statvis_active = not xray
+ row = col.row()
+ row.active = statvis_active
+ row.prop(overlay, "show_statvis", text="Mesh Analysis")
if overlay.show_statvis:
col = col.column()
+ col.active = statvis_active
sub = col.split()
- sub.active = overlay.show_statvis
sub.label(text="Type")
sub.prop(statvis, "type", text="")
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 5f15fb3f19e..6b1982151cf 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -431,7 +431,7 @@ void workbench_forward_engine_init(WORKBENCH_Data *vedata)
noise_offset = fmodf(noise_offset + 1.0f / 8.0f, 1.0f);
}
- if (XRAY_FLAG_ENABLED(wpd)) {
+ if (XRAY_ENABLED(wpd)) {
blend_threshold = 1.0f - XRAY_ALPHA(wpd) * 0.9f;
}
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c
index 081590bb003..afe735ec7f5 100644
--- a/source/blender/draw/modes/edit_mesh_mode.c
+++ b/source/blender/draw/modes/edit_mesh_mode.c
@@ -701,7 +701,7 @@ static void EDIT_MESH_cache_populate(void *vedata, Object *ob)
DRW_shgroup_call(g_data->fweights_shgrp, geom, ob->obmat);
}
- if (do_show_mesh_analysis) {
+ if (do_show_mesh_analysis && !XRAY_ACTIVE(v3d)) {
Mesh *me = (Mesh *)ob->data;
BMEditMesh *embm = me->edit_mesh;
const bool is_original = embm->mesh_eval_final &&
More information about the Bf-blender-cvs
mailing list