From 05abdf344bb8366a1a4da145c423688b81a38459 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Mar 2012 05:03:23 +0000 Subject: [PATCH] minor code/style cleanup --- source/blender/editors/mesh/editmesh_add.c | 26 ++++++++-------- source/blender/editors/mesh/editmesh_tools.c | 32 +++++++++----------- source/blender/editors/mesh/mesh_intern.h | 6 ++-- 3 files changed, 31 insertions(+), 33 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index a464e40217a..70d06924f30 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -139,15 +139,15 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) me = obedit->data; em = me->edit_btmesh; - if (!EDBM_op_call_and_selectf(em, op, "vertout", - "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat)) + if (!EDBM_op_call_and_selectf(em, op, "vertout", + "create_grid xsegments=%i ysegments=%i size=%f mat=%m4", 1, 1, dia, mat)) { return OPERATOR_CANCELLED; } make_prim_finish(C, &state, enter_editmode); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; } void MESH_OT_primitive_plane_add(wmOperatorType *ot) @@ -240,9 +240,9 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) em = me->edit_btmesh; if (!EDBM_op_call_and_selectf(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)) + "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; } @@ -425,10 +425,10 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) em = me->edit_btmesh; if (!EDBM_op_call_and_selectf(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)) + "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; } @@ -527,9 +527,9 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) em = me->edit_btmesh; if (!EDBM_op_call_and_selectf(em, op, "vertout", - "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4", - RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"), - RNA_float_get(op->ptr, "size"), mat)) + "create_uvsphere segments=%i revolutions=%i diameter=%f mat=%m4", + RNA_int_get(op->ptr, "segments"), RNA_int_get(op->ptr, "ring_count"), + RNA_float_get(op->ptr, "size"), mat)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index ba1f2924ad9..ac7589d72f5 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -833,7 +833,7 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent if (rot_src) { EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3", - BM_ELEM_SELECT, cent, mat); + BM_ELEM_SELECT, cent, mat); /* also project the source, for retopo workflow */ if (use_proj) @@ -842,9 +842,9 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, wmEvent edbm_extrude_edge(vc.obedit, vc.em, BM_ELEM_SELECT, nor); EDBM_op_callf(vc.em, op, "rotate verts=%hv cent=%v mat=%m3", - BM_ELEM_SELECT, cent, mat); + BM_ELEM_SELECT, cent, mat); EDBM_op_callf(vc.em, op, "translate verts=%hv vec=%v", - BM_ELEM_SELECT, min); + BM_ELEM_SELECT, min); } else { float *curs = give_cursor(vc.scene, vc.v3d); @@ -915,28 +915,26 @@ static int edbm_delete_exec(bContext *C, wmOperator *op) BMEditMesh *em = BMEdit_FromObject(obedit); int type = RNA_enum_get(op->ptr, "type"); - BMEditMesh *bem = BMEdit_FromObject(obedit); - if (type == 0) { - if (!EDBM_op_callf(bem, op, "del geom=%hv context=%i", BM_ELEM_SELECT, DEL_VERTS)) /* Erase Vertices */ + if (!EDBM_op_callf(em, op, "del geom=%hv context=%i", BM_ELEM_SELECT, DEL_VERTS)) /* Erase Vertices */ return OPERATOR_CANCELLED; } else if (type == 1) { - if (!EDBM_op_callf(bem, op, "del geom=%he context=%i", BM_ELEM_SELECT, DEL_EDGES)) /* Erase Edges */ + if (!EDBM_op_callf(em, op, "del geom=%he context=%i", BM_ELEM_SELECT, DEL_EDGES)) /* Erase Edges */ return OPERATOR_CANCELLED; } else if (type == 2) { - if (!EDBM_op_callf(bem, op, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES)) /* Erase Faces */ + if (!EDBM_op_callf(em, op, "del geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES)) /* Erase Faces */ return OPERATOR_CANCELLED; } else if (type == 3) { - if (!EDBM_op_callf(bem, op, "del geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES)) /* Edges and Faces */ + if (!EDBM_op_callf(em, op, "del geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES)) /* Edges and Faces */ return OPERATOR_CANCELLED; } else if (type == 4) { //"Erase Only Faces"; - if (!EDBM_op_callf(bem, op, "del geom=%hf context=%i", - BM_ELEM_SELECT, DEL_ONLYFACES)) + if (!EDBM_op_callf(em, op, "del geom=%hf context=%i", + BM_ELEM_SELECT, DEL_ONLYFACES)) return OPERATOR_CANCELLED; } @@ -1537,8 +1535,8 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) for (i = 0; i < repeat; i++) { if (!EDBM_op_callf(em, op, - "vertexsmooth verts=%hv mirror_clip_x=%b mirror_clip_y=%b mirror_clip_z=%b clipdist=%f", - BM_ELEM_SELECT, mirrx, mirry, mirrz, clipdist)) + "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; } @@ -3331,8 +3329,8 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op) domaterials = RNA_boolean_get(op->ptr, "materials"); if (!EDBM_op_callf(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)) + "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; } @@ -3418,8 +3416,8 @@ static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op) float angle_limit = RNA_float_get(op->ptr, "angle_limit"); if (!EDBM_op_callf(em, op, - "dissolve_limit edges=%he verts=%hv angle_limit=%f", - BM_ELEM_SELECT, BM_ELEM_SELECT, angle_limit)) + "dissolve_limit edges=%he verts=%hv angle_limit=%f", + BM_ELEM_SELECT, BM_ELEM_SELECT, angle_limit)) { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 59d7b24f7b8..2140bc4308b 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -61,7 +61,7 @@ struct wmOperatorType; int EDBM_op_callf(struct BMEditMesh *em, struct wmOperator *op, const char *fmt, ...); int EDBM_op_call_and_selectf(struct BMEditMesh *em, struct wmOperator *op, - const char *selectslot, const char *fmt, ...); + const char *selectslot, const char *fmt, ...); /* same as above, but doesn't report errors.*/ int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...); @@ -72,10 +72,10 @@ int EDBM_op_call_silentf(struct BMEditMesh *em, const char *fmt, ...); * * execute the operator with BM_Exec_Op */ int EDBM_op_init(struct BMEditMesh *em, struct BMOperator *bmop, - struct wmOperator *op, const char *fmt, ...); + struct wmOperator *op, const char *fmt, ...); /*cleans up after a bmesh operator*/ int EDBM_op_finish(struct BMEditMesh *em, struct BMOperator *bmop, - struct wmOperator *op, const int report); + struct wmOperator *op, const int report); void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag); void EDBM_editselection_store(struct BMEditMesh *em, struct BMHeader *ele);