Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / mesh / editmesh_tools.c
index 30728af..5c6b6da 100644 (file)
@@ -366,7 +366,7 @@ void EMBM_project_snap_verts(bContext *C, ARegion *ar, BMEditMesh *em)
        ED_view3d_init_mats_rv3d(obedit, ar->regiondata);
 
        struct SnapObjectContext *snap_context = ED_transform_snap_object_context_create_view3d(
-               CTX_data_main(C), CTX_data_scene(C), CTX_data_depsgraph(C), 0,
+               CTX_data_scene(C), CTX_data_depsgraph(C), 0,
                ar, CTX_wm_view3d(C));
 
        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
@@ -3624,7 +3624,7 @@ static Base *mesh_separate_tagged(Main *bmain, Scene *scene, ViewLayer *view_lay
 
        base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_MESH);
        /* DAG_relations_tag_update(bmain); */ /* normally would call directly after but in this case delay recalc */
-       assign_matarar(base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */
+       assign_matarar(bmain, base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */
 
        ED_object_base_select(base_new, BA_SELECT);
 
@@ -5310,7 +5310,7 @@ static int edbm_dissolve_degenerate_exec(bContext *C, wmOperator *op)
        } /* objects */
 
        const float thresh = RNA_float_get(op->ptr, "threshold");
-       
+
        for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
                Object *obedit = objects[ob_index];
                BMEditMesh *em = BKE_editmesh_from_object(obedit);
@@ -5447,11 +5447,12 @@ static int edbm_split_exec(bContext *C, wmOperator *op)
        for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
                Object *obedit = objects[ob_index];
                BMEditMesh *em = BKE_editmesh_from_object(obedit);
-
-               if (em->bm->totfacesel == 0) {
+               if ((em->bm->totvertsel == 0) &&
+                   (em->bm->totedgesel == 0) &&
+                   (em->bm->totfacesel == 0))
+               {
                        continue;
                }
-
                BMOperator bmop;
                EDBM_op_init(em, &bmop, op, "split geom=%hvef use_only_faces=%b", BM_ELEM_SELECT, false);
                BMO_op_exec(em->bm, &bmop);