From 1953f042e6f51ce9a795f1bce3cca7e8560cef86 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 20 Feb 2012 01:52:35 +0000 Subject: added boolean type for bmesh operators, will make python wrapping clearer and also makes existing calls more obvious. also corrected some error reports. --- source/blender/editors/mesh/bmesh_select.c | 6 +-- source/blender/editors/mesh/bmesh_tools.c | 58 ++++++++++++------------ source/blender/editors/mesh/bmesh_utils.c | 28 ++++++------ source/blender/editors/mesh/editmesh_add.c | 72 +++++++++++++++++++----------- source/blender/editors/mesh/loopcut.c | 2 +- source/blender/editors/mesh/mesh_intern.h | 6 --- 6 files changed, 92 insertions(+), 80 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/mesh/bmesh_select.c b/source/blender/editors/mesh/bmesh_select.c index 38daf3c0d22..1377970083c 100644 --- a/source/blender/editors/mesh/bmesh_select.c +++ b/source/blender/editors/mesh/bmesh_select.c @@ -701,7 +701,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) float thresh = CTX_data_tool_settings(C)->select_thresh; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%d thresh=%f", BM_ELEM_SELECT, type, thresh); + EDBM_InitOpf(em, &bmop, op, "similarfaces faces=%hf type=%i thresh=%f", BM_ELEM_SELECT, type, thresh); /* execute the operator */ BMO_op_exec(em->bm, &bmop); @@ -742,7 +742,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op) float thresh = CTX_data_tool_settings(C)->select_thresh; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%d thresh=%f", BM_ELEM_SELECT, type, thresh); + EDBM_InitOpf(em, &bmop, op, "similaredges edges=%he type=%i thresh=%f", BM_ELEM_SELECT, type, thresh); /* execute the operator */ BMO_op_exec(em->bm, &bmop); @@ -787,7 +787,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) float thresh = CTX_data_tool_settings(C)->select_thresh; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%d thresh=%f", BM_ELEM_SELECT, type, thresh); + EDBM_InitOpf(em, &bmop, op, "similarverts verts=%hv type=%i thresh=%f", BM_ELEM_SELECT, type, thresh); /* execute the operator */ BMO_op_exec(em->bm, &bmop); diff --git a/source/blender/editors/mesh/bmesh_tools.c b/source/blender/editors/mesh/bmesh_tools.c index 4f7fab75f7e..5ba943cdede 100644 --- a/source/blender/editors/mesh/bmesh_tools.c +++ b/source/blender/editors/mesh/bmesh_tools.c @@ -99,7 +99,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) ts->editbutflag|flag, cuts, 0, RNA_enum_get(op->ptr, "quadcorner"), RNA_boolean_get(op->ptr, "quadtri"), - 1, RNA_int_get(op->ptr, "seed")); + TRUE, RNA_int_get(op->ptr, "seed")); DAG_id_tag_update(obedit->data, OB_RECALC_DATA); WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); @@ -1215,8 +1215,9 @@ static int editbmesh_edge_split(bContext *C, wmOperator *op) BMOperator bmop; int len = 0; - if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%d", - BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts"))) { + if (!EDBM_InitOpf(em, &bmop, op, "edgesplit edges=%he numcuts=%i", + BM_ELEM_SELECT, RNA_int_get(op->ptr,"number_cuts"))) + { return OPERATOR_CANCELLED; } BMO_op_exec(bm, &bmop); @@ -1380,7 +1381,7 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) if (!eed) return OPERATOR_CANCELLED; - EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%d", eed, do_ccw); + EDBM_InitOpf(em, &bmop, op, "edgerotate edges=%e ccw=%b", eed, do_ccw); /* avoid adding to the selection if we start off with only a selected edge, * we could also just deselect the single edge easily but use the BMO api @@ -1564,7 +1565,7 @@ static int normals_make_consistent_exec(bContext *C, wmOperator *op) /* doflip has to do with bmesh_rationalize_normals, it's an internal * thing */ - if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf doflip=%d", BM_ELEM_SELECT, 1)) + if (!EDBM_CallOpf(em, op, "righthandfaces faces=%hf do_flip=%d", BM_ELEM_SELECT, TRUE)) return OPERATOR_CANCELLED; if (RNA_boolean_get(op->ptr, "inside")) @@ -1600,7 +1601,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; ModifierData *md; - int mirrx = 0, mirry = 0, mirrz = 0; + int mirrx = FALSE, mirry = FALSE, mirrz = FALSE; int i, repeat; float clipdist = 0.0f; @@ -1618,11 +1619,11 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) if (mmd->flag & MOD_MIR_CLIPPING) { if (mmd->flag & MOD_MIR_AXIS_X) - mirrx = 1; + mirrx = TRUE; if (mmd->flag & MOD_MIR_AXIS_Y) - mirry = 1; + mirry = TRUE; if (mmd->flag & MOD_MIR_AXIS_Z) - mirrz = 1; + mirrz = TRUE; clipdist = mmd->tolerance; } @@ -1635,7 +1636,7 @@ static int do_smooth_vertex(bContext *C, wmOperator *op) for (i = 0; i < repeat; i++) { if (!EDBM_CallOpf(em, op, - "vertexsmooth verts=%hv mirror_clip_x=%d mirror_clip_y=%d mirror_clip_z=%d clipdist=%f", + "vertexsmooth verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f", BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist)) { return OPERATOR_CANCELLED; @@ -1840,7 +1841,7 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) int dir = RNA_enum_get(op->ptr, "direction"); /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%d", BM_ELEM_SELECT, dir); + EDBM_InitOpf(em, &bmop, op, "meshrotateuvs faces=%hf dir=%i", BM_ELEM_SELECT, dir); /* execute the operator */ BMO_op_exec(em->bm, &bmop); @@ -1893,7 +1894,7 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) int dir = RNA_enum_get(op->ptr, "direction"); /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%d", BM_ELEM_SELECT, dir); + EDBM_InitOpf(em, &bmop, op, "meshrotatecolors faces=%hf dir=%i", BM_ELEM_SELECT, dir); /* execute the operator */ BMO_op_exec(em->bm, &bmop); @@ -2197,8 +2198,7 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) BMOperator bmop; int count; - EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f", - BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist")); + EDBM_InitOpf(em, &bmop, op, "finddoubles verts=%hv dist=%f", BM_ELEM_SELECT, RNA_float_get(op->ptr, "mergedist")); BMO_op_exec(em->bm, &bmop); count = BMO_slot_map_count(em->bm, &bmop, "targetmapout"); @@ -2276,7 +2276,7 @@ static int select_vertex_path_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* initialize the bmop using EDBM api, which does various ui error reporting and other stuff */ - EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%d", sv->data, ev->data, type); + EDBM_InitOpf(em, &bmop, op, "vertexshortestpath startv=%e endv=%e type=%i", sv->data, ev->data, type); /* execute the operator */ BMO_op_exec(em->bm, &bmop); @@ -3162,8 +3162,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op) BMO_slot_int_set(&bmop, "flag", B_KNIFE); BMO_slot_int_set(&bmop, "quadcornertype", SUBD_STRAIGHT_CUT); - BMO_slot_int_set(&bmop, "singleedge", 0); - BMO_slot_int_set(&bmop, "gridfill", 0); + BMO_slot_bool_set(&bmop, "singleedge", FALSE); + BMO_slot_bool_set(&bmop, "gridfill", FALSE); BMO_slot_float_set(&bmop, "radius", 0); @@ -3262,7 +3262,7 @@ static int mesh_separate_selected(Main *bmain, Scene *scene, Base *editbase, wmO EDBM_CallOpf(em, wmop, "del geom=%hvef context=%i", BM_ELEM_SELECT, DEL_VERTS); BM_mesh_normals_update(bmnew); - BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%i", + BMO_op_callf(bmnew, "bmesh_to_mesh mesh=%p object=%p notesselation=%b", basenew->object->data, basenew->object, TRUE); BM_mesh_free(bmnew); @@ -3408,8 +3408,9 @@ static int fill_mesh_exec(bContext *C, wmOperator *op) BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh; BMOperator bmop; - if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) + if (!EDBM_InitOpf(em, &bmop, op, "triangle_fill edges=%he", BM_ELEM_SELECT)) { return OPERATOR_CANCELLED; + } BMO_op_exec(em->bm, &bmop); @@ -3511,9 +3512,9 @@ static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) dovcols = RNA_boolean_get(op->ptr, "vcols"); domaterials = RNA_boolean_get(op->ptr, "materials"); - if (!EDBM_CallOpf(em, op, - "join_triangles faces=%hf limit=%f compare_sharp=%i compare_uvs=%i compare_vcols=%i compare_materials=%i", - BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials)) + if (!EDBM_CallOpf(em, op, + "join_triangles faces=%hf limit=%f cmp_sharp=%b cmp_uvs=%b cmp_vcols=%b cmp_materials=%b", + BM_ELEM_SELECT, limit, dosharp, douvs, dovcols, domaterials)) { return OPERATOR_CANCELLED; } @@ -3684,8 +3685,9 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) mul_m3_v3(imat, axis); if (!EDBM_InitOpf(em, &spinop, op, - "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=%d", - BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli)) { + "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b", + BM_ELEM_SELECT, cent, axis, d, steps, degr, dupli)) + { return OPERATOR_CANCELLED; } BMO_op_exec(bm, &spinop); @@ -3809,8 +3811,8 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) negate_v3(dvec); if (!EDBM_InitOpf(em, &spinop, op, - "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%d ang=%f dupli=0", - BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns)) + "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i ang=%f do_dupli=%b", + BM_ELEM_SELECT, cent, axis, dvec, turns * steps, 360.0f * turns, FALSE)) { return OPERATOR_CANCELLED; } @@ -4506,8 +4508,8 @@ static int mesh_bevel_exec(bContext *C, wmOperator *op) fac = w[recursion - i - 1] * factor; if (!EDBM_InitOpf(em, &bmop, op, - "bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%i use_even=%i use_dist=%i", - BM_ELEM_SELECT, fac, li, 1, use_even, use_dist)) + "bevel geom=%hev percent=%f lengthlayer=%i use_lengths=%b use_even=%b use_dist=%b", + BM_ELEM_SELECT, fac, li, TRUE, use_even, use_dist)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/bmesh_utils.c b/source/blender/editors/mesh/bmesh_utils.c index 92011b46815..7419eb5ba58 100644 --- a/source/blender/editors/mesh/bmesh_utils.c +++ b/source/blender/editors/mesh/bmesh_utils.c @@ -111,8 +111,7 @@ int EDBM_InitOpf(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f va_start(list, fmt); if (!BMO_op_vinitf(bm, bmop, fmt, list)) { - BKE_report(op->reports, RPT_ERROR, - "Parse error in EDBM_CallOpf"); + BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__); va_end(list); return 0; } @@ -173,8 +172,7 @@ int EDBM_CallOpf(BMEditMesh *em, wmOperator *op, const char *fmt, ...) va_start(list, fmt); if (!BMO_op_vinitf(bm, &bmop, fmt, list)) { - BKE_report(op->reports, RPT_ERROR, - "Parse error in EDBM_CallOpf"); + BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__); va_end(list); return 0; } @@ -198,8 +196,7 @@ int EDBM_CallAndSelectOpf(BMEditMesh *em, wmOperator *op, const char *selectslot va_start(list, fmt); if (!BMO_op_vinitf(bm, &bmop, fmt, list)) { - BKE_report(op->reports, RPT_ERROR, - "Parse error in EDBM_CallOpf"); + BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__); va_end(list); return 0; } @@ -415,11 +412,11 @@ void EDBM_select_flush(BMEditMesh *em) void EDBM_select_more(BMEditMesh *em) { BMOperator bmop; - int usefaces = em->selectmode > SCE_SELECT_EDGE; + int use_faces = em->selectmode > SCE_SELECT_EDGE; BMO_op_initf(em->bm, &bmop, - "regionextend geom=%hvef constrict=%d usefaces=%d", - BM_ELEM_SELECT, 0, usefaces); + "regionextend geom=%hvef constrict=%i use_faces=%b", + BM_ELEM_SELECT, FALSE, use_faces); BMO_op_exec(em->bm, &bmop); BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); BMO_op_finish(em->bm, &bmop); @@ -430,11 +427,11 @@ void EDBM_select_more(BMEditMesh *em) void EDBM_select_less(BMEditMesh *em) { BMOperator bmop; - int usefaces = em->selectmode > SCE_SELECT_EDGE; + int use_faces = em->selectmode > SCE_SELECT_EDGE; BMO_op_initf(em->bm, &bmop, - "regionextend geom=%hvef constrict=%d usefaces=%d", - BM_ELEM_SELECT, 0, usefaces); + "regionextend geom=%hvef constrict=%i use_faces=%b", + BM_ELEM_SELECT, FALSE, use_faces); BMO_op_exec(em->bm, &bmop); BMO_slot_buffer_hflag_enable(em->bm, &bmop, "geomout", BM_ELEM_SELECT, BM_ALL); BMO_op_finish(em->bm, &bmop); @@ -525,7 +522,7 @@ static void *editbtMesh_to_undoMesh(void *emv, void *obdata) #endif - BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%i", &um->me, TRUE); + BMO_op_callf(em->bm, "bmesh_to_mesh mesh=%p notesselation=%b", &um->me, TRUE); um->selectmode = em->selectmode; return um; @@ -537,14 +534,15 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *UNUSED(obdata)) Object *ob; undomesh *um = umv; BMesh *bm; - + + /* BMESH_TODO - its possible the name wont be found right?, should fallback */ ob = (Object *)find_id("OB", um->obname); ob->shapenr = em->bm->shapenr; BMEdit_Free(em); bm = BM_mesh_create(ob, bm_mesh_allocsize_default); - BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", &um->me, ob, 0); + BMO_op_callf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%b", &um->me, ob, FALSE); em2 = BMEdit_Create(bm, TRUE); *em = *em2; diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index ea9dc73ee94..c12d28e4166 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -145,8 +145,10 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) em = me->edit_btmesh; if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat)) + "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat)) + { return OPERATOR_CANCELLED; + } make_prim_finish(C, &state, enter_editmode); @@ -188,8 +190,9 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f)) + if (!EDBM_CallAndSelectOpf(em, op, "vertout", "create_cube mat=%m4 size=%f", mat, 2.0f)) { return OPERATOR_CANCELLED; + } /* BMESH_TODO make plane side this: M_SQRT2 - plane (diameter of 1.41 makes it unit size) */ make_prim_finish(C, &state, enter_editmode); @@ -241,11 +244,13 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_circle segments=%i diameter=%f cap_ends=%i cap_tris=%i mat=%m4", - RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"), - cap_end, cap_tri, mat)) + if (!EDBM_CallAndSelectOpf(em, op, "vertout", + "create_circle segments=%i diameter=%f cap_ends=%b cap_tris=%b mat=%m4", + RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"), + cap_end, cap_tri, mat)) + { return OPERATOR_CANCELLED; + } make_prim_finish(C, &state, enter_editmode); @@ -298,11 +303,17 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%i cap_tris=%i depth=%f mat=%m4", - RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius"), - RNA_float_get(op->ptr, "radius"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat)) + if (!EDBM_CallAndSelectOpf( + em, op, "vertout", + "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4", + RNA_int_get(op->ptr, "vertices"), + RNA_float_get(op->ptr, "radius"), + RNA_float_get(op->ptr, "radius"), + cap_end, cap_tri, + RNA_float_get(op->ptr, "depth"), mat)) + { return OPERATOR_CANCELLED; + } make_prim_finish(C, &state, enter_editmode); @@ -357,11 +368,14 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%i cap_tris=%i depth=%f mat=%m4", - RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1"), - RNA_float_get(op->ptr, "radius2"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat)) + if (!EDBM_CallAndSelectOpf( + em, op, "vertout", + "create_cone segments=%i diameter1=%f diameter2=%f cap_ends=%b cap_tris=%b depth=%f mat=%m4", + RNA_int_get(op->ptr, "vertices"), RNA_float_get(op->ptr, "radius1"), + RNA_float_get(op->ptr, "radius2"), cap_end, cap_tri, RNA_float_get(op->ptr, "depth"), mat)) + { return OPERATOR_CANCELLED; + } make_prim_finish(C, &state, enter_editmode); @@ -415,11 +429,11 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", - RNA_int_get(op->ptr, "x_subdivisions"), - RNA_int_get(op->ptr, "y_subdivisions"), - RNA_float_get(op->ptr, "size") * dia, mat)) + if (!EDBM_CallAndSelectOpf(em, op, "vertout", + "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", + RNA_int_get(op->ptr, "x_subdivisions"), + RNA_int_get(op->ptr, "y_subdivisions"), + RNA_float_get(op->ptr, "size") * dia, mat)) { return OPERATOR_CANCELLED; } @@ -517,11 +531,13 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4", - RNA_int_get(op->ptr, "ring_count"), RNA_int_get(op->ptr, "segments"), - RNA_float_get(op->ptr,"size"), mat)) + if (!EDBM_CallAndSelectOpf(em, op, "vertout", + "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4", + RNA_int_get(op->ptr, "ring_count"), RNA_int_get(op->ptr, "segments"), + RNA_float_get(op->ptr,"size"), mat)) + { return OPERATOR_CANCELLED; + } make_prim_finish(C, &state, enter_editmode); @@ -571,10 +587,12 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_CallAndSelectOpf(em, op, "vertout", - "create_icosphere subdivisions=%i diameter=%f mat=%m4", - RNA_int_get(op->ptr, "subdivisions"), - RNA_float_get(op->ptr, "size"), mat)) { + if (!EDBM_CallAndSelectOpf( + em, op, "vertout", + "create_icosphere subdivisions=%i diameter=%f mat=%m4", + RNA_int_get(op->ptr, "subdivisions"), + RNA_float_get(op->ptr, "size"), mat)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 794356510aa..dbcc0447a89 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -310,7 +310,7 @@ static void ringsel_finish(bContext *C, wmOperator *op) if (lcd->do_cut) { BM_mesh_esubdivideflag(lcd->ob, em->bm, BM_ELEM_SELECT, 0.0f, 0.0f, 0, cuts, SUBDIV_SELECT_LOOPCUT, - SUBD_PATH, 0, 0, 0); + SUBD_PATH, 0, FALSE, 0); /* force edge slide to edge select mode in in face select mode */ if (em->selectmode & SCE_SELECT_FACE) { diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 6b0ed5c14d6..e495908b56e 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -59,12 +59,6 @@ ok: the EDBM module is for editmode bmesh stuff. in contrast, the /*calls a bmesh op, reporting errors to the user, etc*/ int EDBM_CallOpf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...); -/*calls a bmesh op, reporting errors to the user, etc. - - selects an output slot specified by selslot*/ -//int EDBM_CallAndSelectOpf(struct BMEditMesh *em, struct wmOperator *op, char *selslot, char *fmt, ...); -//moved to ED_mesh.h - /*same as above, but doesn't report errors.*/ int EDBM_CallOpfSilent(struct BMEditMesh *em, const char *fmt, ...); -- cgit v1.2.3