individual inset was missing relative option.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 25 Apr 2013 16:14:04 +0000 (16:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 25 Apr 2013 16:14:04 +0000 (16:14 +0000)
source/blender/bmesh/intern/bmesh_opdefines.c
source/blender/bmesh/operators/bmo_inset.c
source/blender/editors/mesh/editmesh_inset.c

index 4ce56e23aec49ebef6478e7ec4f4609ff43c460d..09c053ff937c7b2e35690416efbcd0357b9bdf75 100644 (file)
@@ -1512,6 +1512,7 @@ static BMOpDefine bmo_inset_individual_def = {
         {"depth", BMO_OP_SLOT_FLT},
         {"use_even_offset", BMO_OP_SLOT_BOOL},
         {"use_interpolate", BMO_OP_SLOT_BOOL},
+        {"use_relative_offset", BMO_OP_SLOT_BOOL},
         {{'\0'}},
        },
        /* slots_out */
index 2324360291dfcc14b46f61486bd0ae467e34544c..97444a504388ae862d7f2e5d31ab44236df80fe3 100644 (file)
@@ -76,6 +76,7 @@ void bmo_inset_individual_exec(BMesh *bm, BMOperator *op)
        const float thickness = BMO_slot_float_get(op->slots_in, "thickness");
        const float depth = BMO_slot_float_get(op->slots_in, "depth");
        const bool use_even_offset = BMO_slot_bool_get(op->slots_in, "use_even_offset");
+       const bool use_relative_offset = BMO_slot_bool_get(op->slots_in, "use_relative_offset");
        const bool use_interpolate = BMO_slot_bool_get(op->slots_in, "use_interpolate");
 
        /* Only tag faces in slot */
@@ -146,6 +147,10 @@ void bmo_inset_individual_exec(BMesh *bm, BMOperator *op)
                        }
 
                        /* Modify vertices and their normals */
+                       if (use_relative_offset) {
+                               mul_v3_fl(tvec, (BM_edge_calc_length(l_iter->e) + BM_edge_calc_length(l_iter->prev->e)) / 2.0f);
+                       }
+
                        madd_v3_v3fl(v_new_co, tvec, thickness);
 
                        /* Set normal, add depth and write new vertex position*/
index 43c197a7b26a6a8d11035c8eaec95179ad5d43de..ef1767de3bd8d717556dc33f5e758774d4a6ad47 100644 (file)
@@ -208,8 +208,10 @@ static bool edbm_inset_calc(wmOperator *op)
 
        if (use_individual) {
                EDBM_op_init(em, &bmop, op,
-                            "inset_individual faces=%hf thickness=%f depth=%f use_even_offset=%b use_interpolate=%b",
-                            BM_ELEM_SELECT, thickness, depth, use_even_offset, use_interpolate);
+                            "inset_individual faces=%hf use_even_offset=%b  use_relative_offset=%b"
+                            "use_interpolate=%b thickness=%f depth=%f",
+                            BM_ELEM_SELECT, use_even_offset, use_relative_offset, use_interpolate,
+                            thickness, depth);
        }
        else {
                EDBM_op_init(em, &bmop, op,