diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-19 09:46:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-19 09:46:42 +0300 |
commit | 264691e5630fcd11516272c98bcdf2a2c980dfa3 (patch) | |
tree | dd4e72696dc2c9f4ff478339ccca8cf714eb1e03 /source/blender | |
parent | 34e76c7162de721e73262efe138ac28f74936eec (diff) | |
parent | 860939ccc2c11f0503588d35e2b23326997c9768 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_conv.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh_conv.h | 3 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 1 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_mesh_conv.c | 11 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 5 | ||||
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 6 |
9 files changed, 32 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 932f80c35d5..899a911270f 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1396,7 +1396,11 @@ static void prepare_mesh_for_viewport_render(Main *bmain, const EvaluationContex { if (check_rendered_viewport_visible(bmain)) { BMesh *bm = mesh->edit_btmesh->bm; - BM_mesh_bm_to_me(bm, mesh, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm, mesh, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); DEG_id_tag_update(&mesh->id, 0); } } diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index 6cc1f37db43..fd32119cb5f 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -708,7 +708,7 @@ void BM_mesh_bm_to_me( } /* patch hook indices and vertex parents */ - if (ototvert > 0) { + if (params->calc_object_remap && (ototvert > 0)) { Object *ob; ModifierData *md; BMVert **vertMap = NULL; @@ -765,11 +765,7 @@ void BM_mesh_bm_to_me( if (vertMap) MEM_freeN(vertMap); } - if (params->calc_tessface) { - BKE_mesh_tessface_calc(me); - } - - BKE_mesh_update_customdata_pointers(me, params->calc_tessface); + BKE_mesh_update_customdata_pointers(me, false); { BMEditSelection *selected; diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.h b/source/blender/bmesh/intern/bmesh_mesh_conv.h index 1974d364171..6e9d62349ea 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.h +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.h @@ -55,7 +55,8 @@ void BM_mesh_bm_from_me( ATTR_NONNULL(1, 3); struct BMeshToMeshParams { - uint calc_tessface : 1; + /** Update object hook indices & vertex parents. */ + uint calc_object_remap : 1; int64_t cd_mask_extra; }; void BM_mesh_bm_to_me( diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 8e0e905cf88..4847ae4be42 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -843,7 +843,6 @@ static BMOpDefine bmo_bmesh_to_mesh_def = { {"mesh", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_MESH}}, /* pointer to an object structure */ {"object", BMO_OP_SLOT_PTR, {(int)BMO_OP_SLOT_SUBTYPE_PTR_OBJECT}}, - {"skip_tessface", BMO_OP_SLOT_BOOL}, /* don't calculate mfaces */ {{'\0'}}, }, {{{'\0'}}}, /* no output */ diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c index 0eb9bf90ca8..7311ed5ce64 100644 --- a/source/blender/bmesh/operators/bmo_mesh_conv.c +++ b/source/blender/bmesh/operators/bmo_mesh_conv.c @@ -62,15 +62,18 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op) Mesh *me = ob->data; BMO_op_callf(bm, op->flag, - "bmesh_to_mesh mesh=%p object=%p skip_tessface=%b", - me, ob, true); + "bmesh_to_mesh mesh=%p object=%p", + me, ob); } void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op) { Mesh *me = BMO_slot_ptr_get(op->slots_in, "mesh"); /* Object *ob = BMO_slot_ptr_get(op, "object"); */ - const bool dotess = !BMO_slot_bool_get(op->slots_in, "skip_tessface"); - BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){ .calc_tessface = dotess, })); + BM_mesh_bm_to_me( + bm, me, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index ff1cd7224cd..a71b03b6ff7 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3374,7 +3374,11 @@ static int edbm_separate_exec(bContext *C, wmOperator *op) } if (retval_iter) { - BM_mesh_bm_to_me(bm_old, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm_old, me, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); DEG_id_tag_update(&me->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM | ND_DATA, me); diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 534ca22178e..11667ed5710 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -496,6 +496,8 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) BM_mesh_bm_to_me( em->bm, &um->me, (&(struct BMeshToMeshParams){ + /* Undo code should not be manipulating 'G.main->object' hooks/vertex-parent. */ + .calc_object_remap = false, .cd_mask_extra = CD_MASK_SHAPE_KEYINDEX, })); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 132ac0d30b7..7b727e75b55 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -381,7 +381,10 @@ void EDBM_mesh_load(Object *ob) bm->shapenr = 1; } - BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm, me, (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); #ifdef USE_TESSFACE_DEFAULT BKE_mesh_tessface_calc(me); diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 629c3a3c7a3..ec787768a57 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -902,7 +902,11 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) bm = self->bm; - BM_mesh_bm_to_me(bm, me, (&(struct BMeshToMeshParams){0})); + BM_mesh_bm_to_me( + bm, me, + (&(struct BMeshToMeshParams){ + .calc_object_remap = true, + })); /* we could have the user do this but if they forget blender can easy crash * since the references arrays for the objects derived meshes are now invalid */ |