add option so operators can be called with a flag, currently the only flag is to...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 21 Jul 2012 00:58:02 +0000 (00:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 21 Jul 2012 00:58:02 +0000 (00:58 +0000)
this is useful for bmesh tools that operate in object mode or for modifiers which would previously use hidden faces in some cases.

24 files changed:
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_operator_api.h
source/blender/bmesh/intern/bmesh_operators.c
source/blender/bmesh/operators/bmo_bevel.c
source/blender/bmesh/operators/bmo_create.c
source/blender/bmesh/operators/bmo_dissolve.c
source/blender/bmesh/operators/bmo_dupe.c
source/blender/bmesh/operators/bmo_extrude.c
source/blender/bmesh/operators/bmo_mesh_conv.c
source/blender/bmesh/operators/bmo_mirror.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/bmesh/operators/bmo_removedoubles.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/operators/bmo_triangulate.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/modifiers/intern/MOD_array.c
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_skin.c
source/blender/python/bmesh/bmesh_py_ops.c

index 385572c..99d713d 100644 (file)
@@ -318,7 +318,7 @@ static void bm_rationalize_normals(BMesh *bm, int undo)
                return;
        }
        
-       BMO_op_initf(bm, &bmop, "recalc_face_normals faces=%af do_flip=%b", FALSE);
+       BMO_op_initf(bm, &bmop, BMO_FLAG_DEFAULTS, "recalc_face_normals faces=%af do_flip=%b", FALSE);
        
        BMO_push(bm, &bmop);
        bmo_recalc_face_normals_exec(bm, &bmop);
index c4ebd4a..2306293 100644 (file)
@@ -135,13 +135,19 @@ typedef struct BMOpSlot {
 typedef struct BMOperator {
        int type;
        int slot_type;
-       int needflag;
-       int flag;
+       int type_flag;
+       int flag;  /* runtime options */
        struct BMOpSlot slot_args[BMO_OP_MAX_SLOTS];
        void (*exec)(BMesh *bm, struct BMOperator *op);
        struct MemArena *arena;
 } BMOperator;
 
+enum {
+       BMO_FLAG_RESPECT_HIDE = 1,
+};
+
+#define BMO_FLAG_DEFAULTS  BMO_FLAG_RESPECT_HIDE
+
 #define MAX_SLOTNAME   32
 
 typedef struct BMOSlotType {
@@ -153,7 +159,7 @@ typedef struct BMOpDefine {
        const char *name;
        BMOSlotType slot_types[BMO_OP_MAX_SLOTS];
        void (*exec)(BMesh *bm, BMOperator *op);
-       int flag;
+       int type_flag;
 } BMOpDefine;
 
 /* BMOpDefine->flag */
@@ -171,7 +177,7 @@ typedef struct BMOpDefine {
  * have it set directly.  and never use BMO_slot_ptr_set to
  * pass in a list of edges or any arrays, really.*/
 
-void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname);
+void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname);
 
 /* executes an operator, pushing and popping a new tool flag
  * layer as appropriate.*/
@@ -194,7 +200,7 @@ int BMO_mesh_disabled_flag_count(BMesh *bm, const char htype, const short oflag)
  * this system is used to execute or initialize an operator,
  * using a formatted-string system.
  *
- * for example, BMO_op_callf(bm, "delete geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES);
+ * for example, BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "delete geom=%hf context=%i", BM_ELEM_SELECT, DEL_FACES);
  * . . .will execute the delete operator, feeding in selected faces, deleting them.
  *
  * the basic format for the format string is:
@@ -231,16 +237,16 @@ void BMO_push(BMesh *bm, BMOperator *op);
 void BMO_pop(BMesh *bm);
 
 /*executes an operator*/
-int BMO_op_callf(BMesh *bm, const char *fmt, ...);
+int BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...);
 
 /* initializes, but doesn't execute an operator.  this is so you can
  * gain access to the outputs of the operator.  note that you have
  * to execute/finish (BMO_op_exec and BMO_op_finish) yourself. */
-int BMO_op_initf(BMesh *bm, BMOperator *op, const char *fmt, ...);
+int BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...);
 
 /* va_list version, used to implement the above two functions,
  * plus EDBM_op_callf in editmesh_utils.c. */
-int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *fmt, va_list vlist);
+int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, va_list vlist);
 
 /* test whether a named slot exists */
 int BMO_slot_exists(BMOperator *op, const char *slot_name);
index 5447e6b..8b8824f 100644 (file)
@@ -126,7 +126,7 @@ void BMO_pop(BMesh *bm)
  *
  * Initializes an operator structure to a certain type
  */
-void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname)
+void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname)
 {
        int i, opcode = bmo_opname_to_opcode(opname);
 
@@ -142,7 +142,8 @@ void BMO_op_init(BMesh *bm, BMOperator *op, const char *opname)
 
        memset(op, 0, sizeof(BMOperator));
        op->type = opcode;
-       op->flag = opdefines[opcode]->flag;
+       op->type_flag = opdefines[opcode]->type_flag;
+       op->flag = flag;
        
        /* initialize the operator slot types */
        for (i = 0; opdefines[opcode]->slot_types[i].type; i++) {
@@ -697,13 +698,14 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *sl
 {
        BMOpSlot *output = BMO_slot_get(op, slot_name);
        int totelement = 0, i = 0;
+       const int respecthide = (op->flag & BMO_FLAG_RESPECT_HIDE) != 0;
 
        BLI_assert(ELEM(test_for_enabled, TRUE, FALSE));
 
        if (test_for_enabled)
-               totelement = BM_mesh_elem_hflag_count_enabled(bm, htype, hflag, TRUE);
+               totelement = BM_mesh_elem_hflag_count_enabled(bm, htype, hflag, respecthide);
        else
-               totelement = BM_mesh_elem_hflag_count_disabled(bm, htype, hflag, TRUE);
+               totelement = BM_mesh_elem_hflag_count_disabled(bm, htype, hflag, respecthide);
 
        if (totelement) {
                BMIter iter;
@@ -715,7 +717,7 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *sl
 
                if (htype & BM_VERT) {
                        BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) {
-                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+                               if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) &&
                                    BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
                                {
                                        ((BMElem **)output->data.p)[i] = ele;
@@ -726,7 +728,7 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *sl
 
                if (htype & BM_EDGE) {
                        BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) {
-                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+                               if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) &&
                                    BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
                                {
                                        ((BMElem **)output->data.p)[i] = ele;
@@ -737,7 +739,7 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, BMOperator *op, const char *sl
 
                if (htype & BM_FACE) {
                        BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) {
-                               if (!BM_elem_flag_test(ele, BM_ELEM_HIDDEN) &&
+                               if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) &&
                                    BM_elem_flag_test_bool(ele, hflag) == test_for_enabled)
                                {
                                        ((BMElem **)output->data.p)[i] = ele;
@@ -1320,7 +1322,7 @@ static int bmo_opname_to_opcode(const char *opname)
 }
 
 /* Example:
- * BMO_op_callf(bm, "delete %i %hv", DEL_ONLYFACES, BM_ELEM_SELECT);
+ * BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "delete %i %hv", DEL_ONLYFACES, BM_ELEM_SELECT);
  *
  *  i - int
  *  b - boolean (same as int but 1/0 only)
@@ -1336,7 +1338,7 @@ static int bmo_opname_to_opcode(const char *opname)
  * Hv, He, Hf, Fv, Fe, Ff,
  */
 
-int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
+int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, va_list vlist)
 {
        BMOpDefine *def;
        char *opname, *ofmt, *fmt;
@@ -1376,7 +1378,7 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *_fmt, va_list vlist)
                return FALSE;
        }
 
-       BMO_op_init(bm, op, opname);
+       BMO_op_init(bm, op, flag, opname);
        def = opdefines[i];
        
        i = 0;
@@ -1556,12 +1558,12 @@ error:
 }
 
 
-int BMO_op_initf(BMesh *bm, BMOperator *op, const char *fmt, ...)
+int BMO_op_initf(BMesh *bm, BMOperator *op, const int flag, const char *fmt, ...)
 {
        va_list list;
 
        va_start(list, fmt);
-       if (!BMO_op_vinitf(bm, op, fmt, list)) {
+       if (!BMO_op_vinitf(bm, op, flag, fmt, list)) {
                printf("%s: failed\n", __func__);
                va_end(list);
                return FALSE;
@@ -1571,13 +1573,13 @@ int BMO_op_initf(BMesh *bm, BMOperator *op, const char *fmt, ...)
        return TRUE;
 }
 
-int BMO_op_callf(BMesh *bm, const char *fmt, ...)
+int BMO_op_callf(BMesh *bm, const int flag, const char *fmt, ...)
 {
        va_list list;
        BMOperator op;
 
        va_start(list, fmt);
-       if (!BMO_op_vinitf(bm, &op, fmt, list)) {
+       if (!BMO_op_vinitf(bm, &op, flag, fmt, list)) {
                printf("%s: failed, format is:\n    \"%s\"\n", __func__, fmt);
                va_end(list);
                return FALSE;
index ef4a2a2..8210ea9 100644 (file)
@@ -865,7 +865,7 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
        }
 #endif
 
-       BMO_op_callf(bm, "delete geom=%fv context=%i", BEVEL_DEL, DEL_VERTS);
+       BMO_op_callf(bm, op->flag, "delete geom=%fv context=%i", BEVEL_DEL, DEL_VERTS);
 
        /* clean up any edges that might not get properly delete */
        BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
@@ -873,8 +873,8 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op)
                        BMO_elem_flag_enable(bm, e, BEVEL_DEL);
        }
 
-       BMO_op_callf(bm, "delete geom=%fe context=%i", BEVEL_DEL, DEL_EDGES);
-       BMO_op_callf(bm, "delete geom=%ff context=%i", BEVEL_DEL, DEL_FACES);
+       BMO_op_callf(bm, op->flag, "delete geom=%fe context=%i", BEVEL_DEL, DEL_EDGES);
+       BMO_op_callf(bm, op->flag, "delete geom=%ff context=%i", BEVEL_DEL, DEL_FACES);
        
        BLI_smallhash_release(&hash);
        BLI_array_free(tags);
index f1063d1..c17f23e 100644 (file)
@@ -1365,12 +1365,12 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
 
        /* call edgenet create */
        /* call edgenet prepare op so additional face creation cases wore */
-       BMO_op_initf(bm, &op2, "edgenet_prepare edges=%fe", ELE_NEW);
+       BMO_op_initf(bm, &op2, op->flag, "edgenet_prepare edges=%fe", ELE_NEW);
        BMO_op_exec(bm, &op2);
        BMO_slot_buffer_flag_enable(bm, &op2, "edgeout", BM_EDGE, ELE_NEW);
        BMO_op_finish(bm, &op2);
 
-       BMO_op_initf(bm, &op2,
+       BMO_op_initf(bm, &op2, op->flag,
                     "edgenet_fill edges=%fe use_fill_check=%b mat_nr=%i use_smooth=%b",
                     ELE_NEW, TRUE, mat_nr, use_smooth);
 
@@ -1386,7 +1386,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op)
        BMO_op_finish(bm, &op2);
        
        /* now call dissolve face */
-       BMO_op_initf(bm, &op2, "dissolve_faces faces=%ff", ELE_NEW);
+       BMO_op_initf(bm, &op2, op->flag, "dissolve_faces faces=%ff", ELE_NEW);
        BMO_op_exec(bm, &op2);
        
        /* if we dissolved anything, then return */
index f932b8c..b10556a 100644 (file)
@@ -164,7 +164,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
 
        }
 
-       BMO_op_callf(bm, "delete geom=%ff context=%i", FACE_ORIG, DEL_FACES);
+       BMO_op_callf(bm, op->flag, "delete geom=%ff context=%i", FACE_ORIG, DEL_FACES);
 
 
        if (use_verts) {
@@ -383,7 +383,7 @@ void bmo_dissolve_verts_exec(BMesh *bm, BMOperator *op)
                }
        }
 
-       BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_MARK);
+       BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_MARK);
        if (BMO_error_occurred(bm)) {
                const char *msg;
 
index 1421ae2..4d4d7e3 100644 (file)
@@ -381,8 +381,8 @@ void bmo_split_exec(BMesh *bm, BMOperator *op)
        const short use_only_faces = BMO_slot_bool_get(op, "use_only_faces");
 
        /* initialize our sub-operator */
-       BMO_op_init(bm, &dupeop, "duplicate");
-       BMO_op_init(bm, &delop, "delete");
+       BMO_op_init(bm, &dupeop, op->flag, "duplicate");
+       BMO_op_init(bm, &delop, op->flag, "delete");
        
        BMO_slot_copy(splitop, &dupeop, "geom", "geom");
        BMO_op_exec(bm, &dupeop);
@@ -487,18 +487,20 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
        BMO_slot_copy(op, op, "geom", "lastout");
        for (a = 0; a < steps; a++) {
                if (do_dupli) {
-                       BMO_op_initf(bm, &dupop, "duplicate geom=%s", op, "lastout");
+                       BMO_op_initf(bm, &dupop, op->flag, "duplicate geom=%s", op, "lastout");
                        BMO_op_exec(bm, &dupop);
-                       BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s",
+                       BMO_op_callf(bm, op->flag,
+                                    "rotate cent=%v mat=%m3 verts=%s",
                                     cent, rmat, &dupop, "newout");
                        BMO_slot_copy(&dupop, op, "newout", "lastout");
                        BMO_op_finish(bm, &dupop);
                }
                else {
-                       BMO_op_initf(bm, &extop, "extrude_face_region edgefacein=%s",
+                       BMO_op_initf(bm, &extop, op->flag, "extrude_face_region edgefacein=%s",
                                     op, "lastout");
                        BMO_op_exec(bm, &extop);
-                       BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s",
+                       BMO_op_callf(bm, op->flag,
+                                    "rotate cent=%v mat=%m3 verts=%s",
                                     cent, rmat, &extop, "geomout");
                        BMO_slot_copy(&extop, op, "geomout", "lastout");
                        BMO_op_finish(bm, &extop);
@@ -506,7 +508,9 @@ void bmo_spin_exec(BMesh *bm, BMOperator *op)
 
                if (usedvec) {
                        mul_m3_v3(rmat, dvec);
-                       BMO_op_callf(bm, "translate vec=%v verts=%s", dvec, op, "lastout");
+                       BMO_op_callf(bm, op->flag,
+                                    "translate vec=%v verts=%s",
+                                    dvec, op, "lastout");
                }
        }
 }
index b8993b4..7b59a4a 100644 (file)
@@ -118,7 +118,9 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
 
        BLI_array_free(edges);
 
-       BMO_op_callf(bm, "delete geom=%ff context=%i", EXT_DEL, DEL_ONLYFACES);
+       BMO_op_callf(bm, op->flag,
+                    "delete geom=%ff context=%i",
+                    EXT_DEL, DEL_ONLYFACES);
        BMO_slot_buffer_from_enabled_flag(bm, op, "faceout", BM_FACE, EXT_KEEP);
 }
 
@@ -195,7 +197,7 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op)
                BMO_elem_flag_enable(bm, e->v2, EXT_INPUT);
        }
 
-       BMO_op_initf(bm, &dupeop, "duplicate geom=%fve", EXT_INPUT);
+       BMO_op_initf(bm, &dupeop, op->flag, "duplicate geom=%fve", EXT_INPUT);
        BMO_op_exec(bm, &dupeop);
 
        /* disable root flag on all new skin nodes */
@@ -273,7 +275,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
        int found, fwd, delorig = FALSE;
 
        /* initialize our sub-operators */
-       BMO_op_init(bm, &dupeop, "duplicate");
+       BMO_op_init(bm, &dupeop, op->flag, "duplicate");
        
        BMO_slot_buffer_flag_enable(bm, op, "edgefacein", BM_EDGE | BM_FACE, EXT_INPUT);
        
@@ -341,7 +343,8 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op)
        }
 
        if (delorig == TRUE) {
-               BMO_op_initf(bm, &delop, "delete geom=%fvef context=%i",
+               BMO_op_initf(bm, &delop, op->flag,
+                            "delete geom=%fvef context=%i",
                             EXT_DEL, DEL_ONLYTAGGED);
        }
 
@@ -647,13 +650,13 @@ void bmo_solidify_face_region_exec(BMesh *bm, BMOperator *op)
        thickness = BMO_slot_float_get(op, "thickness");
 
        /* Flip original faces (so the shell is extruded inward) */
-       BMO_op_init(bm, &reverseop, "reverse_faces");
+       BMO_op_init(bm, &reverseop, op->flag, "reverse_faces");
        BMO_slot_copy(op, &reverseop, "geom", "faces");
        BMO_op_exec(bm, &reverseop);
        BMO_op_finish(bm, &reverseop);
 
        /* Extrude the region */
-       BMO_op_initf(bm, &extrudeop, "extrude_face_region alwayskeeporig=%b", TRUE);
+       BMO_op_initf(bm, &extrudeop, op->flag, "extrude_face_region alwayskeeporig=%b", TRUE);
        BMO_slot_copy(op, &extrudeop, "geom", "edgefacein");
        BMO_op_exec(bm, &extrudeop);
 
index c550a17..c4b988a 100644 (file)
@@ -70,7 +70,9 @@ void bmo_object_load_bmesh_exec(BMesh *bm, BMOperator *op)
        /* Scene *scene = BMO_slot_ptr_get(op, "scene"); */
        Mesh *me = ob->data;
 
-       BMO_op_callf(bm, "bmesh_to_mesh mesh=%p object=%p notessellation=%b", me, ob, TRUE);
+       BMO_op_callf(bm, op->flag,
+                    "bmesh_to_mesh mesh=%p object=%p notessellation=%b",
+                    me, ob, TRUE);
 }
 
 void bmo_bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
index 1ab439b..c6b228b 100644 (file)
@@ -62,7 +62,7 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
        BMO_slot_mat4_get(op, "mat", mtx);
        invert_m4_m4(imtx, mtx);
        
-       BMO_op_initf(bm, &dupeop, "duplicate geom=%s", op, "geom");
+       BMO_op_initf(bm, &dupeop, op->flag, "duplicate geom=%s", op, "geom");
        BMO_op_exec(bm, &dupeop);
        
        BMO_slot_buffer_flag_enable(bm, &dupeop, "newout", BM_ALL, ELE_NEW);
@@ -80,11 +80,11 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
 
        /* feed old data to transform bmo */
        scale[axis] = -1.0f;
-       BMO_op_callf(bm, "transform verts=%fv mat=%m4", ELE_NEW, mtx);
-       BMO_op_callf(bm, "scale verts=%fv vec=%v", ELE_NEW, scale);
-       BMO_op_callf(bm, "transform verts=%fv mat=%m4", ELE_NEW, imtx);
+       BMO_op_callf(bm, op->flag, "transform verts=%fv mat=%m4", ELE_NEW, mtx);
+       BMO_op_callf(bm, op->flag, "scale verts=%fv vec=%v", ELE_NEW, scale);
+       BMO_op_callf(bm, op->flag, "transform verts=%fv mat=%m4", ELE_NEW, imtx);
        
-       BMO_op_init(bm, &weldop, "weld_verts");
+       BMO_op_init(bm, &weldop, op->flag, "weld_verts");
 
        v = BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL);
        for (i = 0; i < ototvert; i++) {
index d59a90b..70173d9 100644 (file)
@@ -267,19 +267,19 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
 
        for (a = 0; a < seg - 1; a++) {
                if (a) {
-                       BMO_op_initf(bm, &bmop, "extrude_edge_only edges=%s", &prevop, "geomout");
+                       BMO_op_initf(bm, &bmop, op->flag, "extrude_edge_only edges=%s", &prevop, "geomout");
                        BMO_op_exec(bm, &bmop);
                        BMO_op_finish(bm, &prevop);
 
                        BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
                }
                else {
-                       BMO_op_initf(bm, &bmop, "extrude_edge_only edges=%fe", EDGE_ORIG);
+                       BMO_op_initf(bm, &bmop, op->flag, "extrude_edge_only edges=%fe", EDGE_ORIG);
                        BMO_op_exec(bm, &bmop);
                        BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
                }
 
-               BMO_op_callf(bm, "translate vec=%v verts=%s", vec, &bmop, "geomout");
+               BMO_op_callf(bm, op->flag, "translate vec=%v verts=%s", vec, &bmop, "geomout");
                prevop = bmop;
        }
 
@@ -333,17 +333,17 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
 
        for (a = 0; a < seg; a++) {
                if (a) {
-                       BMO_op_initf(bm, &bmop, "extrude_edge_only edges=%s", &prevop, "geomout");
+                       BMO_op_initf(bm, &bmop, op->flag, "extrude_edge_only edges=%s", &prevop, "geomout");
                        BMO_op_exec(bm, &bmop);
                        BMO_op_finish(bm, &prevop);
                }
                else {
-                       BMO_op_initf(bm, &bmop, "extrude_edge_only edges=%fe", EDGE_ORIG);
+                       BMO_op_initf(bm, &bmop, op->flag, "extrude_edge_only edges=%fe", EDGE_ORIG);
                        BMO_op_exec(bm, &bmop);
                }
 
                BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_VERT, VERT_MARK);
-               BMO_op_callf(bm, "rotate cent=%v mat=%m3 verts=%s", vec, cmat, &bmop, "geomout");
+               BMO_op_callf(bm, op->flag, "rotate cent=%v mat=%m3 verts=%s", vec, cmat, &bmop, "geomout");
                
                prevop = bmop;
        }
@@ -365,7 +365,7 @@ void bmo_create_uvsphere_exec(BMesh *bm, BMOperator *op)
                len2 = len_v3v3(vec, vec2);
 
                /* use shortest segment length divided by 3 as merge threshold */
-               BMO_op_callf(bm, "remove_doubles verts=%fv dist=%f", VERT_MARK, MIN2(len, len2) / 3.0f);
+               BMO_op_callf(bm, op->flag, "remove_doubles verts=%fv dist=%f", VERT_MARK, MIN2(len, len2) / 3.0f);
        }
 
        /* and now do imat */
@@ -426,7 +426,7 @@ void bmo_create_icosphere_exec(BMesh *bm, BMOperator *op)
        if (subdiv > 1) {
                BMOperator bmop;
 
-               BMO_op_initf(bm, &bmop,
+               BMO_op_initf(bm, &bmop, op->flag,
                             "subdivide_edges edges=%fe "
                             "smooth=%f "
                             "numcuts=%i "
@@ -563,7 +563,7 @@ void bmo_create_circle_exec(BMesh *bm, BMOperator *op)
        }
        
        if (!cap_tris) {
-               BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_NEW);
+               BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_NEW);
        }
        
        BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
@@ -656,12 +656,12 @@ void bmo_create_cone_exec(BMesh *bm, BMOperator *op)
        }
        
        if (!cap_tris) {
-               BMO_op_callf(bm, "dissolve_faces faces=%ff", FACE_NEW);
+               BMO_op_callf(bm, op->flag, "dissolve_faces faces=%ff", FACE_NEW);
        }
        
        BM_face_create_quad_tri(bm, v1, v2, firstv2, firstv1, NULL, FALSE);
 
-       BMO_op_callf(bm, "remove_doubles verts=%fv dist=%f", VERT_MARK, 0.000001);
+       BMO_op_callf(bm, op->flag, "remove_doubles verts=%fv dist=%f", VERT_MARK, 0.000001);
        BMO_slot_buffer_from_enabled_flag(bm, op, "vertout", BM_VERT, VERT_MARK);
 }
 
index b3c348a..e1a5ef9 100644 (file)
@@ -227,7 +227,7 @@ void bmo_weld_verts_exec(BMesh *bm, BMOperator *op)
                }
        }
 
-       BMO_op_callf(bm, "delete geom=%fvef context=%i", ELE_DEL, DEL_ONLYTAGGED);
+       BMO_op_callf(bm, op->flag, "delete geom=%fvef context=%i", ELE_DEL, DEL_ONLYTAGGED);
 
        BLI_array_free(edges);
        BLI_array_free(loops);
@@ -347,8 +347,8 @@ void bmo_pointmerge_exec(BMesh *bm, BMOperator *op)
        
        BMO_slot_vec_get(op, "merge_co", vec);
 
-       //BMO_op_callf(bm, "collapse_uvs edges=%s", op, "edges");
-       BMO_op_init(bm, &weldop, "weld_verts");
+       //BMO_op_callf(bm, op->flag, "collapse_uvs edges=%s", op, "edges");
+       BMO_op_init(bm, &weldop, op->flag, "weld_verts");
        
        BMO_ITER (v, &siter, bm, op, "verts", BM_VERT) {
                if (!snapv) {
@@ -374,8 +374,8 @@ void bmo_collapse_exec(BMesh *bm, BMOperator *op)
        float min[3], max[3];
        int i, tot;
        
-       BMO_op_callf(bm, "collapse_uvs edges=%s", op, "edges");
-       BMO_op_init(bm, &weldop, "weld_verts");
+       BMO_op_callf(bm, op->flag, "collapse_uvs edges=%s", op, "edges");
+       BMO_op_init(bm, &weldop, op->flag, "weld_verts");
 
        BMO_slot_buffer_flag_enable(bm, op, "edges", BM_EDGE, EDGE_MARK);
 
@@ -561,7 +561,7 @@ void bmo_remove_doubles_exec(BMesh *bm, BMOperator *op)
 {
        BMOperator weldop;
 
-       BMO_op_init(bm, &weldop, "weld_verts");
+       BMO_op_init(bm, &weldop, op->flag, "weld_verts");
        bmesh_find_doubles_common(bm, op, &weldop, "targetmap");
        BMO_op_exec(bm, &weldop);
        BMO_op_finish(bm, &weldop);
@@ -591,12 +591,12 @@ void bmo_automerge_exec(BMesh *bm, BMOperator *op)
 
        /* Search for doubles among all vertices, but only merge non-VERT_KEEP
         * vertices into VERT_KEEP vertices. */
-       BMO_op_initf(bm, &findop, "find_doubles verts=%av keep_verts=%fv", VERT_KEEP);
+       BMO_op_initf(bm, &findop, op->flag, "find_doubles verts=%av keep_verts=%fv", VERT_KEEP);
        BMO_slot_copy(op, &findop, "dist", "dist");
        BMO_op_exec(bm, &findop);
 
        /* weld the vertices */
-       BMO_op_init(bm, &weldop, "weld_verts");
+       BMO_op_init(bm, &weldop, op->flag, "weld_verts");
        BMO_slot_copy(&findop, &weldop, "targetmapout", "targetmap");
        BMO_op_exec(bm, &weldop);
 
index ee3e34c..a03aa0c 100644 (file)
@@ -1037,7 +1037,7 @@ void BM_mesh_esubdivide(BMesh *bm, const char edge_hflag,
        BMOperator op;
        
        /* use_sphere isnt exposed here since its only used for new primitives */
-       BMO_op_initf(bm, &op,
+       BMO_op_initf(bm, &op, BMO_FLAG_DEFAULTS,
                     "subdivide_edges edges=%he "
                     "smooth=%f fractal=%f along_normal=%f "
                     "numcuts=%i "
index 0903620..de87647 100644 (file)
@@ -212,7 +212,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op)
        BLI_smallhash_release(&hash);
        
        /* clean up fill */
-       BMO_op_initf(bm, &bmop, "beautify_fill faces=%ff constrain_edges=%fe", ELE_NEW, EDGE_MARK);
+       BMO_op_initf(bm, &bmop, op->flag, "beautify_fill faces=%ff constrain_edges=%fe", ELE_NEW, EDGE_MARK);
        BMO_op_exec(bm, &bmop);
        BMO_slot_buffer_flag_enable(bm, &bmop, "geomout", BM_FACE | BM_EDGE, ELE_NEW);
        BMO_op_finish(bm, &bmop);
index ccab6c2..5664c48 100644 (file)
@@ -73,7 +73,7 @@ void bmo_translate_exec(BMesh *bm, BMOperator *op)
        unit_m4(mat);
        copy_v3_v3(mat[3], vec);
 
-       BMO_op_callf(bm, "transform mat=%m4 verts=%s", mat, op, "verts");
+       BMO_op_callf(bm, op->flag, "transform mat=%m4 verts=%s", mat, op, "verts");
 }
 
 void bmo_scale_exec(BMesh *bm, BMOperator *op)
@@ -87,7 +87,7 @@ void bmo_scale_exec(BMesh *bm, BMOperator *op)
        mat[1][1] = vec[1];
        mat[2][2] = vec[2];
 
-       BMO_op_callf(bm, "transform mat=%m3 verts=%s", mat, op, "verts");
+       BMO_op_callf(bm, op->flag, "transform mat=%m3 verts=%s", mat, op, "verts");
 }
 
 void bmo_rotate_exec(BMesh *bm, BMOperator *op)
@@ -100,12 +100,12 @@ void bmo_rotate_exec(BMesh *bm, BMOperator *op)
         * this is how editmesh did it and I'm too tired to think
         * through the math right now. */
        mul_v3_fl(vec, -1.0f);
-       BMO_op_callf(bm, "translate verts=%s vec=%v", op, "verts", vec);
+       BMO_op_callf(bm, op->flag, "translate verts=%s vec=%v", op, "verts", vec);
 
-       BMO_op_callf(bm, "transform mat=%s verts=%s", op, "mat", op, "verts");
+       BMO_op_callf(bm, op->flag, "transform mat=%s verts=%s", op, "mat", op, "verts");
 
        mul_v3_fl(vec, -1.0f);
-       BMO_op_callf(bm, "translate verts=%s vec=%v", op, "verts", vec);
+       BMO_op_callf(bm, op->flag, "translate verts=%s vec=%v", op, "verts", vec);
 }
 
 void bmo_reverse_faces_exec(BMesh *bm, BMOperator *op)
index 882d311..5907d06 100644 (file)
@@ -2008,9 +2008,9 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd)
        remerge_faces(kcd);
 
        /* delete left over faces */
-       BMO_op_callf(bm, "delete geom=%ff context=%i", DEL, DEL_ONLYFACES);
-       BMO_op_callf(bm, "delete geom=%fe context=%i", DEL, DEL_EDGES);
-       BMO_op_callf(bm, "delete geom=%fv context=%i", DEL, DEL_VERTS);
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "delete geom=%ff context=%i", DEL, DEL_ONLYFACES);
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "delete geom=%fe context=%i", DEL, DEL_EDGES);
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS, "delete geom=%fv context=%i", DEL, DEL_VERTS);
 
        if (face_nets) 
                MEM_freeN(face_nets);
index 61d12b7..7dc0ed7 100644 (file)
@@ -113,7 +113,9 @@ void EDBM_automerge(Scene *scene, Object *obedit, int update)
                if (!em)
                        return;
 
-               BMO_op_callf(em->bm, "automerge verts=%hv dist=%f", BM_ELEM_SELECT, scene->toolsettings->doublimit);
+               BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
+                            "automerge verts=%hv dist=%f",
+                            BM_ELEM_SELECT, scene->toolsettings->doublimit);
                if (update) {
                        DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
                        BMEdit_RecalcTessellation(em);
index 08f70f9..072c66c 100644 (file)
@@ -255,7 +255,7 @@ static short edbm_extrude_edge(Object *obedit, BMEditMesh *em, const char hflag,
        ModifierData *md;
        BMElem *ele;
        
-       BMO_op_init(bm, &extop, "extrude_face_region");
+       BMO_op_init(bm, &extop, BMO_FLAG_DEFAULTS, "extrude_face_region");
        BMO_slot_buffer_from_enabled_hflag(bm, &extop, "edgefacein", BM_VERT | BM_EDGE | BM_FACE, hflag);
 
        /* If a mirror modifier with clipping is on, we need to adjust some 
@@ -395,8 +395,10 @@ static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
 
        for (a = 0; a < steps; a++) {
                edbm_extrude_edge(obedit, em, BM_ELEM_SELECT, nor);
-               //BMO_op_callf(em->bm, "extrude_face_region edgefacein=%hef", BM_ELEM_SELECT);
-               BMO_op_callf(em->bm, "translate vec=%v verts=%hv", (float *)dvec, BM_ELEM_SELECT);
+               //BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS, "extrude_face_region edgefacein=%hef", BM_ELEM_SELECT);
+               BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
+                            "translate vec=%v verts=%hv",
+                            (float *)dvec, BM_ELEM_SELECT);
                //extrudeflag(obedit, em, SELECT, nor);
                //translateflag(em, SELECT, dvec);
        }
@@ -2816,26 +2818,25 @@ static int mesh_separate_tagged(Main *bmain, Scene *scene, Base *base_old, BMesh
 
        ED_base_object_select(base_new, BA_SELECT);
 
-       BMO_op_callf(bm_old, "duplicate geom=%hvef dest=%p", BM_ELEM_TAG, bm_new);
-       BMO_op_callf(bm_old, "delete geom=%hvef context=%i", BM_ELEM_TAG, DEL_FACES);
+       BMO_op_callf(bm_old, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                    "duplicate geom=%hvef dest=%p", BM_ELEM_TAG, bm_new);
+       BMO_op_callf(bm_old, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                    "delete geom=%hvef context=%i", BM_ELEM_TAG, DEL_FACES);
 
        /* clean up any loose edges */
        BM_ITER_MESH (e, &iter, bm_old, BM_EDGES_OF_MESH) {
-               if (!BM_edge_is_wire(e)) {
-                       BM_elem_flag_disable(e, BM_ELEM_TAG);
+               if (BM_edge_is_wire(e)) {
+                       BM_edge_kill(bm_old, e);
                }
        }
-       BMO_op_callf(bm_old, "delete geom=%hvef context=%i", BM_ELEM_TAG, DEL_EDGES);
 
        /* clean up any loose verts */
        BM_ITER_MESH (v, &iter, bm_old, BM_VERTS_OF_MESH) {
-               if (BM_vert_edge_count(v) != 0) {
-                       BM_elem_flag_disable(v, BM_ELEM_TAG);
+               if (BM_vert_edge_count(v) == 0) {
+                       BM_vert_kill(bm_old, v);
                }
        }
 
-       BMO_op_callf(bm_old, "delete geom=%hvef context=%i", BM_ELEM_TAG, DEL_VERTS);
-
        BM_mesh_normals_update(bm_new, FALSE);
 
        BM_mesh_bm_to_me(bm_new, base_new->object->data, FALSE);
@@ -2959,13 +2960,13 @@ static int mesh_separate_loose(Main *bmain, Scene *scene, Base *base_old, BMesh
                }
 
                /* Select the seed explicitly, in case it has no edges */
-               BM_elem_flag_enable(v_seed, BM_ELEM_TAG);
+               if (!BM_elem_flag_test(v_seed, BM_ELEM_TAG)) { BM_elem_flag_enable(v_seed, BM_ELEM_TAG); tot++; }
 
                /* Walk from the single vertex, selecting everything connected
                 * to it */
                BMW_init(&walker, bm_old, BMW_SHELL,
                         BMW_MASK_NOP, BMW_MASK_NOP, BMW_MASK_NOP,
-                        BMW_FLAG_NOP, /* BMESH_TODO - should be BMW_FLAG_TEST_HIDDEN ? */
+                        BMW_FLAG_NOP,
                         BMW_NIL_LAY);
 
                e = BMW_begin(&walker, v_seed);
@@ -5136,7 +5137,9 @@ static int edbm_wireframe_exec(bContext *C, wmOperator *op)
                BM_mesh_elem_hflag_disable_all(em->bm, BM_FACE, BM_ELEM_TAG, FALSE);
                BMO_slot_buffer_hflag_enable(em->bm, &bmop, "faces", BM_FACE, BM_ELEM_TAG, FALSE);
 
-               BMO_op_callf(em->bm, "delete geom=%hvef context=%i", BM_ELEM_TAG, DEL_FACES);
+               BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
+                            "delete geom=%hvef context=%i",
+                            BM_ELEM_TAG, DEL_FACES);
        }
 
        BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, FALSE);
index 274789a..6b7409c 100644 (file)
@@ -166,7 +166,7 @@ int EDBM_op_init(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const char *f
 
        va_start(list, fmt);
 
-       if (!BMO_op_vinitf(bm, bmop, fmt, list)) {
+       if (!BMO_op_vinitf(bm, bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
                return 0;
@@ -235,7 +235,7 @@ int EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt, ...)
 
        va_start(list, fmt);
 
-       if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
+       if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
                return 0;
@@ -259,7 +259,7 @@ int EDBM_op_call_and_selectf(BMEditMesh *em, wmOperator *op, const char *selects
 
        va_start(list, fmt);
 
-       if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
+       if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                BKE_reportf(op->reports, RPT_ERROR, "Parse error in %s", __func__);
                va_end(list);
                return 0;
@@ -287,7 +287,7 @@ int EDBM_op_call_silentf(BMEditMesh *em, const char *fmt, ...)
 
        va_start(list, fmt);
 
-       if (!BMO_op_vinitf(bm, &bmop, fmt, list)) {
+       if (!BMO_op_vinitf(bm, &bmop, BMO_FLAG_DEFAULTS, fmt, list)) {
                va_end(list);
                return 0;
        }
@@ -482,7 +482,7 @@ void EDBM_select_more(BMEditMesh *em)
        BMOperator bmop;
        int use_faces = em->selectmode == SCE_SELECT_FACE;
 
-       BMO_op_initf(em->bm, &bmop,
+       BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
                     "region_extend geom=%hvef constrict=%b use_faces=%b",
                     BM_ELEM_SELECT, FALSE, use_faces);
        BMO_op_exec(em->bm, &bmop);
@@ -498,7 +498,7 @@ void EDBM_select_less(BMEditMesh *em)
        BMOperator bmop;
        int use_faces = em->selectmode == SCE_SELECT_FACE;
 
-       BMO_op_initf(em->bm, &bmop,
+       BMO_op_initf(em->bm, &bmop, BMO_FLAG_DEFAULTS,
                     "region_extend geom=%hvef constrict=%b use_faces=%b",
                     BM_ELEM_SELECT, TRUE, use_faces);
        BMO_op_exec(em->bm, &bmop);
index 57c230f..26682e3 100644 (file)
@@ -172,7 +172,7 @@ static int *find_doubles_index_map(BMesh *bm, BMOperator *dupe_op,
        BMElem *ele;
        int *index_map, i;
 
-       BMO_op_initf(bm, &find_op,
+       BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
                     "find_doubles verts=%av dist=%f keep_verts=%s",
                     amd->merge_dist, dupe_op, "geom");
 
@@ -234,7 +234,7 @@ static void bm_merge_dm_transform(BMesh *bm, DerivedMesh *dm, float mat[4][4],
                BMOIter oiter;
                BMOperator find_op;
 
-               BMO_op_initf(bm, &find_op,
+               BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
                             "find_doubles verts=%Hv dist=%f keep_verts=%s",
                             BM_ELEM_TAG, amd->merge_dist,
                             dupe_op, dupe_slot_name);
@@ -286,7 +286,7 @@ static void merge_first_last(BMesh *bm,
        BMOIter oiter;
        BMVert *v, *v2;
 
-       BMO_op_initf(bm, &find_op,
+       BMO_op_initf(bm, &find_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
                     "find_doubles verts=%s dist=%f keep_verts=%s",
                     dupe_first, "geom", amd->merge_dist,
                     dupe_first, "geom");
@@ -410,9 +410,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
        bmesh_edit_begin(em->bm, 0);
 
        if (amd->flags & MOD_ARR_MERGE)
-               BMO_op_init(em->bm, &weld_op, "weld_verts");
+               BMO_op_init(em->bm, &weld_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                           "weld_verts");
 
-       BMO_op_initf(em->bm, &dupe_op, "duplicate geom=%avef");
+       BMO_op_initf(em->bm, &dupe_op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                    "duplicate geom=%avef");
        first_dupe_op = dupe_op;
 
        for (j = 0; j < count - 1; j++) {
@@ -421,8 +423,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd,
                BMOpSlot *newout_slot;
                BMOIter oiter;
 
-               if (j != 0)
-                       BMO_op_initf(em->bm, &dupe_op, "duplicate geom=%s", &old_dupe_op, "newout");
+               if (j != 0) {
+                       BMO_op_initf(em->bm, &dupe_op,
+                                    (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                                    "duplicate geom=%s", &old_dupe_op, "newout");
+               }
                BMO_op_exec(em->bm, &dupe_op);
 
                geom_slot = BMO_slot_get(&dupe_op, "geom");
index 6c91cd6..cdb200f 100644 (file)
@@ -143,7 +143,8 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *UNUSED(ob),
                }
        }
 
-       BMO_op_callf(bm, "bevel geom=%fe percent=%f use_even=%b use_dist=%b",
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS,
+                    "bevel geom=%fe percent=%f use_even=%b use_dist=%b",
                     EDGE_MARK, bmd->value, (bmd->flags & BME_BEVEL_EVEN) != 0, (bmd->flags & BME_BEVEL_DIST) != 0);
        BMO_pop(bm);
 
index 471317a..b1c3459 100644 (file)
@@ -103,7 +103,8 @@ static DerivedMesh *doEdgeSplit(DerivedMesh *dm, EdgeSplitModifierData *emd, Obj
                }
        }
        
-       BMO_op_callf(bm, "split_edges edges=%fe", EDGE_MARK);
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS,
+                    "split_edges edges=%fe", EDGE_MARK);
        
        BMO_pop(bm);
 
index f24898c..50e7a3e 100644 (file)
@@ -236,7 +236,8 @@ static int build_hull(SkinOutput *so, Frame **frames, int totframe)
         * selected after the operator is run */
        BM_mesh_elem_hflag_disable_all(bm, BM_ALL, BM_ELEM_SELECT, 0);
 
-       BMO_op_initf(bm, &op, "convex_hull input=%hv", BM_ELEM_TAG);
+       BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                    "convex_hull input=%hv", BM_ELEM_TAG);
        BMO_op_exec(bm, &op);
 
        if (BMO_error_occurred(bm)) {
@@ -319,7 +320,9 @@ static int build_hull(SkinOutput *so, Frame **frames, int totframe)
 
        BMO_op_finish(bm, &op);
 
-       BMO_op_callf(bm, "delete geom=%hef context=%i", BM_ELEM_TAG, DEL_ONLYTAGGED);
+       BMO_op_callf(bm, BMO_FLAG_DEFAULTS,
+                    "delete geom=%hef context=%i",
+                    BM_ELEM_TAG, DEL_ONLYTAGGED);
 
        return TRUE;
 }
@@ -1039,7 +1042,7 @@ static BMFace *collapse_face_corners(BMesh *bm, BMFace *f, int n,
                int i;
 
                shortest_edge = BM_face_find_shortest_loop(f)->e;
-               BMO_op_initf(bm, &op, "weld_verts");
+               BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE), "weld_verts");
 
                /* Note: could probably calculate merges in one go to be
                 * faster */
@@ -1179,7 +1182,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f
        /* Extrude the split face */
        BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, FALSE);
        BM_elem_flag_enable(split_face, BM_ELEM_TAG);
-       BMO_op_initf(bm, &op, "extrude_discrete_faces faces=%hf", BM_ELEM_TAG);
+       BMO_op_initf(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                    "extrude_discrete_faces faces=%hf", BM_ELEM_TAG);
        BMO_op_exec(bm, &op);
 
        /* Update split face (should only be one new face created
@@ -1202,7 +1206,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f
                BM_mesh_elem_hflag_disable_all(bm, BM_EDGE, BM_ELEM_TAG, FALSE);
                BM_elem_flag_enable(longest_edge, BM_ELEM_TAG);
 
-               BMO_op_callf(bm, "subdivide_edges edges=%he numcuts=%i quadcornertype=%i",
+               BMO_op_callf(bm, BMO_FLAG_DEFAULTS,
+                            "subdivide_edges edges=%he numcuts=%i quadcornertype=%i",
                             BM_ELEM_TAG, 1, SUBD_STRAIGHT_CUT);
        }
        else if (split_face->len > 4) {
@@ -1234,7 +1239,8 @@ static void skin_fix_hole_no_good_verts(BMesh *bm, Frame *frame, BMFace *split_f
 
        /* Delete split face and merge */
        BM_face_kill(bm, split_face);
-       BMO_op_init(bm, &op, "weld_verts");
+       BMO_op_init(bm, &op, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
+                   "weld_verts");
        for (i = 0; i < 4; i++) {
                BMO_slot_map_ptr_insert(bm, &op, "targetmap",
                                        verts[i], frame->verts[best_order[i]]);
@@ -1399,7 +1405,9 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd)
                }
        }
 
-       BMO_op_callf(so->bm, "delete geom=%hef context=%i", BM_ELEM_TAG, DEL_ONLYTAGGED);
+       BMO_op_callf(so->bm, BMO_FLAG_DEFAULTS,
+                    "delete geom=%hef context=%i",
+                    BM_ELEM_TAG, DEL_ONLYTAGGED);
 
        BLI_heap_free(heap, NULL);
 }
index 53ddcec..9c871f1 100644 (file)
@@ -109,7 +109,8 @@ static PyObject *pyrna_op_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *
        }
 
        /* TODO - error check this!, though we do the error check on attribute access */
-       BMO_op_init(bm, &bmop, self->opname);
+       /* TODO - make flags optional */
+       BMO_op_init(bm, &bmop, BMO_FLAG_DEFAULTS, self->opname);
 
        if (kw && PyDict_Size(kw) > 0) {
                /* setup properties, see bpy_rna.c: pyrna_py_to_prop()