added boolean type for bmesh operators, will make python wrapping clearer and also...
[blender.git] / source / blender / editors / mesh / bmesh_select.c
index b0440eeb14ff0ace62f53f1e208752dcbed7050f..1377970083c379e7a61dac78d62003bd2f36fbf5 100644 (file)
@@ -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);
@@ -1694,6 +1694,38 @@ void EDBM_select_swap(BMEditMesh *em) /* exported for UV */
 //     if (EM_texFaceCheck())
 }
 
+int EDBM_select_interior_faces(struct BMEditMesh *em)
+{
+       BMesh *bm = em->bm;
+       BMIter iter;
+       BMIter eiter;
+       BMFace *efa;
+       BMEdge *eed;
+       int ok;
+       int change = FALSE;
+
+       BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
+               if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN))
+                       continue;
+
+
+               ok = TRUE;
+               BM_ITER(eed, &eiter, bm, BM_EDGES_OF_FACE, efa) {
+                       if (BM_edge_face_count(eed) < 3) {
+                               ok = FALSE;
+                               break;
+                       }
+               }
+
+               if (ok) {
+                       BM_elem_select_set(bm, efa, TRUE);
+                       change = TRUE;
+               }
+       }
+
+       return change;
+}
+
 static void linked_limit_default(bContext *C, wmOperator *op)
 {
        if (!RNA_struct_property_is_set(op->ptr, "limit")) {