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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-06-16 11:03:26 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-06-16 11:03:54 +0400
commit5ca44ff9521d83a2b4acd164c30fbd3815084560 (patch)
tree5432c1953ca2c3187285cedf91be07251924d38f /source
parent31e15b56a4a011dd61a5e04c344418ad0658de92 (diff)
Fix T40648: Bevel Tool - Amount value slider maximum does not adapt to Amount Type settings automaticly.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 75ba84aaffd..ec1ea3e8e62 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -400,8 +400,21 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
+static void mesh_ot_bevel_offset_range_func(PointerRNA *ptr, PropertyRNA *UNUSED(prop),
+ float *min, float *max, float *softmin, float *softmax)
+{
+ const int offset_type = RNA_enum_get(ptr, "offset_type");
+
+ *min = -FLT_MAX;
+ *max = FLT_MAX;
+ *softmin = 0.0f;
+ *softmax = (offset_type == BEVEL_AMT_PERCENT) ? 100.0f : 1.0f;
+}
+
void MESH_OT_bevel(wmOperatorType *ot)
{
+ PropertyRNA *prop;
+
static EnumPropertyItem offset_type_items[] = {
{BEVEL_AMT_OFFSET, "OFFSET", 0, "Offset", "Amount is offset of new edges from original"},
{BEVEL_AMT_WIDTH, "WIDTH", 0, "Width", "Amount is width of new face"},
@@ -426,7 +439,8 @@ void MESH_OT_bevel(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_GRAB_POINTER | OPTYPE_BLOCKING;
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);
+ prop = RNA_def_float(ot->srna, "offset", 0.0f, -FLT_MAX, FLT_MAX, "Amount", "", 0.0f, 1.0f);
+ RNA_def_property_float_array_funcs_runtime(prop, NULL, NULL, mesh_ot_bevel_offset_range_func);
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");