svn merge ^/trunk/blender -r46380:HEAD
[blender-staging.git] / source / blender / editors / mesh / editmesh_tools.c
index 2f317ed87c2b1632a98868871133c6ea2eed3989..eccc1e5ed1a40e5c145ce983d7a11a3e5d0d842a 100644 (file)
@@ -89,7 +89,6 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
        int cuts = RNA_int_get(op->ptr, "number_cuts");
        float smooth = 0.292f * RNA_float_get(op->ptr, "smoothness");
        float fractal = RNA_float_get(op->ptr, "fractal") / 2.5f;
-       float along_normal = RNA_float_get(op->ptr, "fractal_along_normal");
 
        if (RNA_boolean_get(op->ptr, "quadtri") && 
            RNA_enum_get(op->ptr, "quadcorner") == SUBD_STRAIGHT_CUT)
@@ -98,7 +97,7 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
        }
        
        BM_mesh_esubdivide(em->bm, BM_ELEM_SELECT,
-                          smooth, fractal, along_normal,
+                          smooth, fractal,
                           cuts,
                           SUBDIV_SELECT_ORIG, RNA_enum_get(op->ptr, "quadcorner"),
                           RNA_boolean_get(op->ptr, "quadtri"), TRUE,
@@ -146,7 +145,6 @@ void MESH_OT_subdivide(wmOperatorType *ot)
                     "Quad Corner Type", "How to subdivide quad corners (anything other than Straight Cut will prevent ngons)");
 
        RNA_def_float(ot->srna, "fractal", 0.0f, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor", 0.0f, 1000.0f);
-       RNA_def_float(ot->srna, "fractal_along_normal", 0.0f, 0.0f, 1.0f, "Along Normal", "Apply fractal displacement along normal only", 0.0f, 1.0f);
        RNA_def_int(ot->srna, "seed", 0, 0, 10000, "Random Seed", "Seed for the random number generator", 0, 50);
 }
 
@@ -2349,7 +2347,7 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
                        if (!BM_elem_flag_test(ev, BM_ELEM_HIDDEN)) {
                                switch (mode) {
                                        case -1: /* aligned */
-                                               if (fabsf(ev->co[axis] - value) < limit)
+                                               if (fabs(ev->co[axis] - value) < limit)
                                                        BM_vert_select_set(em->bm, ev, TRUE);
                                                break;
                                        case 0: /* neg */
@@ -2596,21 +2594,21 @@ static float bm_edge_seg_isect(BMEdge *e, CutCurve *c, int len, char mode,
                                m1 = MAXSLOPE;
                                b1 = x12;
                        }
-                       x2max = MAX2(x21, x22) + 0.001f; /* prevent missed edges   */
-                       x2min = MIN2(x21, x22) - 0.001f; /* due to round off error */
-                       y2max = MAX2(y21, y22) + 0.001f;
-                       y2min = MIN2(y21, y22) - 0.001f;
+                       x2max = MAX2(x21, x22) + 0.001; /* prevent missed edges   */
+                       x2min = MIN2(x21, x22) - 0.001; /* due to round off error */
+                       y2max = MAX2(y21, y22) + 0.001;
+                       y2min = MIN2(y21, y22) - 0.001;
                        
                        /* Found an intersect,  calc intersect point */
                        if (m1 == m2) { /* co-incident lines */
                                /* cut at 50% of overlap area */
                                x1max = MAX2(x11, x12);
                                x1min = MIN2(x11, x12);
-                               xi = (MIN2(x2max, x1max) + MAX2(x2min, x1min)) / 2.0f;
+                               xi = (MIN2(x2max, x1max) + MAX2(x2min, x1min)) / 2.0;
                                
                                y1max = MAX2(y11, y12);
                                y1min = MIN2(y11, y12);
-                               yi = (MIN2(y2max, y1max) + MAX2(y2min, y1min)) / 2.0f;
+                               yi = (MIN2(y2max, y1max) + MAX2(y2min, y1min)) / 2.0;
                        }
                        else if (m2 == MAXSLOPE) {
                                xi = x22;
@@ -3209,45 +3207,11 @@ static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BMEdit_FromObject(obedit);
-       BMesh *bm = em->bm;
        float angle_limit = RNA_float_get(op->ptr, "angle_limit");
 
-       char dissolve_flag;
-
-       if (em->selectmode == SCE_SELECT_FACE) {
-               /* flush selection to tags and untag edges/verts with partially selected faces */
-               BMIter iter;
-               BMIter liter;
-
-               BMElem *ele;
-               BMFace *f;
-               BMLoop *l;
-
-               BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) {
-                       BM_elem_flag_set(ele, BM_ELEM_TAG, BM_elem_flag_test(ele, BM_ELEM_SELECT));
-               }
-               BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) {
-                       BM_elem_flag_set(ele, BM_ELEM_TAG, BM_elem_flag_test(ele, BM_ELEM_SELECT));
-               }
-
-               BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
-                       if (!BM_elem_flag_test(f, BM_ELEM_SELECT)) {
-                               BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
-                                       BM_elem_flag_disable(l->v, BM_ELEM_TAG);
-                                       BM_elem_flag_disable(l->e, BM_ELEM_TAG);
-                               }
-                       }
-               }
-
-               dissolve_flag = BM_ELEM_TAG;
-       }
-       else {
-               dissolve_flag = BM_ELEM_SELECT;
-       }
-
        if (!EDBM_op_callf(em, op,
                           "dissolve_limit edges=%he verts=%hv angle_limit=%f",
-                          dissolve_flag, dissolve_flag, angle_limit))
+                          BM_ELEM_SELECT, BM_ELEM_SELECT, angle_limit))
        {
                return OPERATOR_CANCELLED;
        }
@@ -4256,7 +4220,7 @@ static int edbm_noise_exec(bContext *C, wmOperator *op)
 
        if (tex->type == TEX_STUCCI) {
                float b2, vec[3];
-               float ofs = tex->turbul / 200.0f;
+               float ofs = tex->turbul / 200.0;
                BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
                                b2 = BLI_hnoise(tex->noisesize, eve->co[0], eve->co[1], eve->co[2]);
@@ -4343,7 +4307,7 @@ static int edbm_bevel_exec(bContext *C, wmOperator *op)
                w[i] = s;
                ftot += s;
 
-               df *= 2.0f;
+               df *= 2.0;
        }
 
        mul_vn_fl(w, recursion, 1.0f / (float)ftot);