diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-25 06:31:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-25 06:31:29 +0300 |
commit | 06d4fad31326b54cff9b90762179f2bf0dd067cc (patch) | |
tree | a10d10cbef269ece0a480f1f5bbb8b0d7a2a03c9 /source/blender/editors/mesh/editmesh_extrude_spin.c | |
parent | 10fbea8845d6994bce0ccbdad763793548ef757d (diff) |
BMesh: option to flip normals for extrude/spin
Diffstat (limited to 'source/blender/editors/mesh/editmesh_extrude_spin.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude_spin.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c index 5f1670bf57d..03176bae2f6 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin.c @@ -61,16 +61,13 @@ static int edbm_spin_exec(bContext *C, wmOperator *op) BMOperator spinop; float cent[3], axis[3]; float d[3] = {0.0f, 0.0f, 0.0f}; - int steps, dupli; - float angle; RNA_float_get_array(op->ptr, "center", cent); RNA_float_get_array(op->ptr, "axis", axis); - steps = RNA_int_get(op->ptr, "steps"); - angle = RNA_float_get(op->ptr, "angle"); - //if (ts->editbutflag & B_CLOCKWISE) - angle = -angle; - dupli = RNA_boolean_get(op->ptr, "dupli"); + const int steps = RNA_int_get(op->ptr, "steps"); + const float angle = -RNA_float_get(op->ptr, "angle"); + const bool use_normal_flip = RNA_boolean_get(op->ptr, "use_normal_flip"); + const bool dupli = RNA_boolean_get(op->ptr, "dupli"); if (is_zero_v3(axis)) { BKE_report(op->reports, RPT_ERROR, "Invalid/unset axis"); @@ -78,9 +75,11 @@ static int edbm_spin_exec(bContext *C, wmOperator *op) } /* keep the values in worldspace since we're passing the obmat */ - if (!EDBM_op_init(em, &spinop, op, - "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 use_duplicate=%b", - BM_ELEM_SELECT, cent, axis, d, steps, angle, obedit->obmat, dupli)) + if (!EDBM_op_init( + em, &spinop, op, + "spin geom=%hvef cent=%v axis=%v dvec=%v steps=%i angle=%f space=%m4 " + "use_normal_flip=%b use_duplicate=%b", + BM_ELEM_SELECT, cent, axis, d, steps, angle, obedit->obmat, use_normal_flip, dupli)) { return OPERATOR_CANCELLED; } @@ -141,6 +140,7 @@ void MESH_OT_spin(wmOperatorType *ot) prop = RNA_def_float(ot->srna, "angle", DEG2RADF(90.0f), -1e12f, 1e12f, "Angle", "Rotation for each step", DEG2RADF(-360.0f), DEG2RADF(360.0f)); RNA_def_property_subtype(prop, PROP_ANGLE); + RNA_def_boolean(ot->srna, "use_normal_flip", 0, "Flip Normals", ""); RNA_def_float_vector(ot->srna, "center", 3, NULL, -1e12f, 1e12f, "Center", "Center in global view space", -1e4f, 1e4f); |