diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2014-07-17 17:20:22 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2014-07-17 17:20:22 +0400 |
commit | 70453c578dcdce5577015e1cd7be99d1b810215d (patch) | |
tree | a0e4a6a3e82b8dd9012ca9a6b8ce70ef011e9139 /source/blender/editors | |
parent | 737cb8cf7c6e52ed7eef159b06df247be7d3406f (diff) |
Fix T34664: bevel face material can be set in tool and modifier.
Now the bevel tool, modifier, and internal operator have a material
slot # parameter that the user can set. If left at default of -1,
behavior is as current -- bevel face material is taken from the
closest original face (this may be ambiguous). If material slot
is >= 0, it gives the material slot index number for the material
to use.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_bevel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index e25919b7400..a03cfe79b0d 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -146,15 +146,19 @@ static bool edbm_bevel_calc(wmOperator *op) 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"); + int material = RNA_int_get(op->ptr, "material"); /* revert to original mesh */ if (opdata->is_modal) { EDBM_redo_state_restore(opdata->mesh_backup, em, false); } + if (em->ob) + material = CLAMPIS(material, -1, em->ob->totcol - 1); + EDBM_op_init(em, &bmop, op, - "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); + "bevel geom=%hev offset=%f segments=%i vertex_only=%b offset_type=%i profile=%f material=%i", + BM_ELEM_SELECT, offset, segments, vertex_only, offset_type, profile, material); BMO_op_exec(em->bm, &bmop); @@ -445,4 +449,5 @@ void MESH_OT_bevel(wmOperatorType *ot) 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"); + RNA_def_int(ot->srna, "material", -1, -1, INT_MAX, "Material", "Material for bevel faces (-1 means use adjacent faces)", -1, 100); } |