From c70f975d5c3b961e0c77eba3a35c8a892f39214d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 16 Aug 2019 14:36:57 +0200 Subject: Fix T67999: calling Mesh.materials.clear() crashes Blender The `BKE_material_pop_id()` and `BKE_material_clear_id()` functions had a parameter `update_data` that, when `false`, would cause the mesh polys to keep their material index, even when the indexed material slots were removed. This behaviour was never used in the C code and not supported by the drawing code, making polygons disappear and causing crashes. The Python binding in RNA, however, defaulted to `update_data=False`. This commit removes the `update_data` parameter altogether, and makes the functions always fix up the material indices. Reviewed by: mont29, brecht --- source/blender/editors/mesh/editmesh_tools.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_tools.c') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index f57e8141f27..4e58fee61a2 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -4040,7 +4040,7 @@ static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const ma_obdata = NULL; } - BKE_material_clear_id(bmain, obdata, true); + BKE_material_clear_id(bmain, obdata); BKE_material_resize_object(bmain, ob, 1, true); BKE_material_resize_id(bmain, obdata, 1, true); @@ -4051,7 +4051,7 @@ static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const id_us_plus((ID *)ma_obdata); } else { - BKE_material_clear_id(bmain, obdata, true); + BKE_material_clear_id(bmain, obdata); BKE_material_resize_object(bmain, ob, 0, true); BKE_material_resize_id(bmain, obdata, 0, true); } -- cgit v1.2.3 From dd08d68df835e54ccd1fdf24ae154e461faab685 Mon Sep 17 00:00:00 2001 From: mano-wii Date: Tue, 20 Aug 2019 19:18:25 -0300 Subject: Transform: New Snap Option: Edge Perpendicular Part of T66420 Option for snapping to the nearest point of a reference coordinate. The patch also adds Edge Center and Perpendicular snaps to the ruler. {F7675906} Reviewers: campbellbarton, brecht Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D5543 --- source/blender/editors/mesh/editmesh_tools.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/mesh/editmesh_tools.c') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 4e58fee61a2..2b0213dc1ef 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -437,6 +437,7 @@ void EDBM_project_snap_verts(bContext *C, Depsgraph *depsgraph, ARegion *ar, BME }, mval, NULL, + NULL, co_proj, NULL)) { mul_v3_m4v3(eve->co, obedit->imat, co_proj); -- cgit v1.2.3 From ac646bc20dafe176c1b84ee5beddf980aba11358 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 31 Aug 2019 01:19:22 +1000 Subject: Cleanup: spelling --- source/blender/editors/mesh/editmesh_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/mesh/editmesh_tools.c') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 2b0213dc1ef..b88b6cbb3a6 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5711,7 +5711,7 @@ void MESH_OT_dissolve_limited(wmOperatorType *ot) "use_dissolve_boundaries", false, "All Boundaries", - "Dissolve all vertices inbetween face boundaries"); + "Dissolve all vertices in between face boundaries"); RNA_def_enum_flag(ot->srna, "delimit", rna_enum_mesh_delimit_mode_items, -- cgit v1.2.3 From a3559a70dd57110fd4e1cc568928ee1e3504959a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 3 Sep 2019 00:32:02 +1000 Subject: Fix T69404: Merge by distance crash with Unselected Error introduced when removing the automerge bmesh operator. --- source/blender/editors/mesh/editmesh_tools.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source/blender/editors/mesh/editmesh_tools.c') diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index b88b6cbb3a6..e5023068100 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -3131,12 +3131,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op) BM_mesh_elem_hflag_enable_test(em->bm, htype_select, BM_ELEM_TAG, true, true, BM_ELEM_SELECT); if (use_unselected) { - EDBM_op_init(em, &bmop, op, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, threshold); - BMO_op_exec(em->bm, &bmop); - - if (!EDBM_op_finish(em, &bmop, op, true)) { - continue; - } + EDBM_automerge(obedit, false, BM_ELEM_SELECT, threshold); } else { EDBM_op_init(em, &bmop, op, "find_doubles verts=%hv dist=%f", BM_ELEM_SELECT, threshold); -- cgit v1.2.3