Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2014-01-08 16:40:01 +0400
committerHoward Trickey <howard.trickey@gmail.com>2014-01-08 16:40:01 +0400
commit49aa701645e97ea7a6f698e4063a5327f6c79815 (patch)
tree3469853a0ec2ca2c58c4c50184d05d66ff978d85 /source/blender/editors/mesh/editmesh_bevel.c
parent8094ac91944f080c53943c8319eeaa9c3d1b9720 (diff)
Add profile control parameter to Bevel.
Parameter controls concavity / convexity. <.25 means: concave inward .25 means: straight slanted >.25 means: concave outward .5 means: circular (the default) 1 means: straight along original sides For now, there is a hard lower limit of .15 because more work is needed to get decent results in the range below that. The profile is actually a superellipse, and the parameter is 1/4 of the exponent in the implicit equation for a superellipse, except at the extreme values of 0 and 1.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_bevel.c')
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 9a6131f76e9..75ba84aaffd 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -143,6 +143,7 @@ static bool edbm_bevel_calc(wmOperator *op)
const float offset = RNA_float_get(op->ptr, "offset");
const int offset_type = RNA_enum_get(op->ptr, "offset_type");
const int segments = RNA_int_get(op->ptr, "segments");
+ const float profile = RNA_float_get(op->ptr, "profile");
const bool vertex_only = RNA_boolean_get(op->ptr, "vertex_only");
/* revert to original mesh */
@@ -151,8 +152,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",
- BM_ELEM_SELECT, offset, segments, vertex_only, offset_type);
+ "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f",
+ BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile);
BMO_op_exec(em->bm, &bmop);
@@ -427,5 +428,6 @@ void MESH_OT_bevel(wmOperatorType *ot)
RNA_def_enum(ot->srna, "offset_type", offset_type_items, 0, "Amount Type", "What distance Amount measures");
RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Amount", "", 0.0f, 1.0f);
RNA_def_int(ot->srna, "segments", 1, 1, 50, "Segments", "Segments for curved edge", 1, 8);
+ RNA_def_float(ot->srna, "profile", 0.5f, 0.15f, 1.0f, "Profile", "Controls profile shape (0.5 = round)", 0.15f, 1.0f);
RNA_def_boolean(ot->srna, "vertex_only", false, "Vertex only", "Bevel only vertices");
}