Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <mano-wii>2021-04-08 19:04:18 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-04-08 19:07:47 +0300
commit3d6798962c209f20baffe1d4b6db89831da94068 (patch)
tree59162d3f19c5bec4a611626967d5ebc74c9af8ec /source/blender/draw/engines
parent08ae545de433272827d6b244020efe677cf3670e (diff)
Fix T86762: Inconsistent show of result of modifier Screw in edit mode
To check if an "is_mesh_verts_only" mesh, the overlay engine checks if the mesh has no "totedge" and has "totvert". However, sometimes this engine can check the wrong mesh since editmesh works on `embm->mesh_eval_final`. Reviewed By: fclem Differential Revision: https://developer.blender.org/D10917
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/overlay/overlay_wireframe.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c
index 7ba5fb3a426..b428d8b4ab8 100644
--- a/source/blender/draw/engines/overlay/overlay_wireframe.c
+++ b/source/blender/draw/engines/overlay/overlay_wireframe.c
@@ -177,8 +177,22 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES) != 0;
const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0;
const bool is_mesh = ob->type == OB_MESH;
- const bool is_mesh_verts_only = is_mesh && (((Mesh *)ob->data)->totedge == 0 &&
- ((Mesh *)ob->data)->totvert > 0);
+ const bool is_edit_mode = DRW_object_is_in_edit_mode(ob);
+ bool has_edit_mesh_cage = false;
+ bool is_mesh_verts_only = false;
+ if (is_mesh && is_edit_mode) {
+ /* TODO: Should be its own function. */
+ Mesh *me = ob->data;
+ BMEditMesh *embm = me->edit_mesh;
+ if (embm) {
+ has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final);
+ if (embm->mesh_eval_final) {
+ me = embm->mesh_eval_final;
+ }
+ }
+ is_mesh_verts_only = me->totedge == 0 && me->totvert > 0;
+ }
+
const bool use_wire = !is_mesh_verts_only && ((pd->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
(ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE));
@@ -261,17 +275,6 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
}
}
- const bool is_edit_mode = DRW_object_is_in_edit_mode(ob);
- bool has_edit_mesh_cage = false;
- if (is_mesh && is_edit_mode) {
- /* TODO: Should be its own function. */
- Mesh *me = (Mesh *)ob->data;
- BMEditMesh *embm = me->edit_mesh;
- if (embm) {
- has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final);
- }
- }
-
/* Don't do that in edit Mesh mode, unless there is a modifier preview. */
if (use_wire && (!is_mesh || (!is_edit_mode || has_edit_mesh_cage))) {
const bool is_sculpt_mode = ((ob->mode & OB_MODE_SCULPT) != 0) && (ob->sculpt != NULL);