diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-04-10 10:49:02 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-04-10 13:44:31 +0300 |
commit | a1a8578d5c75b3f094ea18524273ed8053acbc4e (patch) | |
tree | 16d3e7617628caa15ffe0a23e28377ed37cb4532 | |
parent | 1a12c9edab4ac89c8a87c20ad3a2195d0e681bc8 (diff) |
Fix T62449: Subsurf+hidden faces
When using subsurf (and other modifiers) the edit flags are not
propagated correctly. Currently we assume to read the edit flags
from the original object which is kind off hinding the real issue.
Modifiers use `mesh_new_nomain_from_template_ex` to create a copy
from an existing mesh. this method is only used by modifiers. So
by placing this we will make sure that editmesh is propagated.
Reviewed By: fclem, sergey
Maniphest Tasks: T62449
Differential Revision: https://developer.blender.org/D4666
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 3 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 449c2f86b04..74fb31d0121 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -634,6 +634,7 @@ static Mesh *mesh_new_nomain_from_template_ex( me_dst->totpoly = polys_len; me_dst->cd_flag = me_src->cd_flag; + me_dst->editflag = me_src->editflag; CustomData_copy(&me_src->vdata, &me_dst->vdata, mask.vmask, CD_CALLOC, verts_len); CustomData_copy(&me_src->edata, &me_dst->edata, mask.emask, CD_CALLOC, edges_len); diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 0256564ffb5..717fd69149c 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -3808,10 +3808,11 @@ void drw_batch_cache_generate_requested(Object *ob) const enum eContextObjectMode mode = CTX_data_mode_enum_ex( draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode); const bool is_paint_mode = ELEM(mode, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT); + const bool use_hide = ( (ob->type == OB_MESH) && ((is_paint_mode && (ob == draw_ctx->obact) && - (BKE_paint_select_face_test(ob) || BKE_paint_select_vert_test(ob))) || + DRW_object_use_hide_faces(ob)) || ((mode == CTX_MODE_EDIT_MESH) && BKE_object_is_in_editmode(ob)))); struct Mesh *mesh_eval = ob->runtime.mesh_eval; diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index cde7b283976..a96ef4ed8fa 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -200,7 +200,7 @@ bool DRW_object_is_flat_normal(const Object *ob) bool DRW_object_use_hide_faces(const struct Object *ob) { if (ob->type == OB_MESH) { - const Mesh *me = DEG_get_original_object((Object *)ob)->data; + const Mesh *me = ob->data; switch (ob->mode) { case OB_MODE_TEXTURE_PAINT: |