Add 'loop slide' option to bevel. See T45260
[blender.git] / source / blender / editors / mesh / editmesh_bevel.c
index 1abb7a308898ad38cbe8b4624b7e516d9c693a85..709977629096715cda0cf8ef52ca64a1d928d650 100644 (file)
@@ -156,6 +156,7 @@ static bool edbm_bevel_calc(wmOperator *op)
        const bool vertex_only = RNA_boolean_get(op->ptr, "vertex_only");
        const bool clamp_overlap = RNA_boolean_get(op->ptr, "clamp_overlap");
        int material = RNA_int_get(op->ptr, "material");
+       const bool loop_slide = RNA_boolean_get(op->ptr, "loop_slide");
 
        /* revert to original mesh */
        if (opdata->is_modal) {
@@ -167,8 +168,8 @@ static bool edbm_bevel_calc(wmOperator *op)
 
        EDBM_op_init(em, &bmop, op,
                     "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f clamp_overlap=%b "
-                    "material=%i",
-                    BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile, clamp_overlap, material);
+                    "material=%i loop_slide=%b",
+                    BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile, clamp_overlap, material, loop_slide);
 
        BMO_op_exec(em->bm, &bmop);
 
@@ -501,5 +502,6 @@ void MESH_OT_bevel(wmOperatorType *ot)
        RNA_def_boolean(ot->srna, "vertex_only", false, "Vertex Only", "Bevel only vertices");
        RNA_def_boolean(ot->srna, "clamp_overlap", false, "Clamp Overlap",
                        "Do not allow beveled edges/vertices to overlap each other");
+       RNA_def_boolean(ot->srna, "loop_slide", false, "Loop Slide", "Prefer slide along edge to even widths");
        RNA_def_int(ot->srna, "material", -1, -1, INT_MAX, "Material", "Material for bevel faces (-1 means use adjacent faces)", -1, 100);
 }