diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2014-08-26 15:22:12 +0400 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2014-08-26 15:39:39 +0400 |
commit | 8f15be2feef6b4aee3c7de34080ccdd5bbad6658 (patch) | |
tree | 21592f3190c8d621dc05ec42f6556dbb811d8a30 /source/blender/editors/transform/transform_ops.c | |
parent | b198500c027231709686ed600cfeff8dde70d8cd (diff) |
Fix T37534 remaining issue: auto-enable bevel weight view
whenever enter edge bevel weight editing.
This is what happens when one makes an edge sharp, for instance.
The edge bevel weight display is not on by default for performance
reasons, but seems reasonable to enable it when user indicates
interest by editing bevel weight values.
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 0b5241e5563..81e065ee33a 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -26,6 +26,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_mesh_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -883,6 +884,27 @@ static void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot) Transform_Properties(ot, P_SNAP); } +static int edge_bevelweight_exec(bContext *C, wmOperator *op) +{ + Mesh *me = (Mesh *)CTX_data_edit_object(C)->data; + + /* auto-enable bevel edge weight drawing, then chain to common transform code */ + me->drawflag |= ME_DRAWBWEIGHTS; + + return transform_exec(C, op); +} + +static int edge_bevelweight_invoke(bContext *C, wmOperator *op, const wmEvent *event) +{ + Mesh *me = (Mesh *)CTX_data_edit_object(C)->data; + + /* auto-enable bevel edge weight drawing, then chain to common transform code */ + me->drawflag |= ME_DRAWBWEIGHTS; + + return transform_invoke(C, op, event); +} + + static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot) { /* identifiers */ @@ -892,8 +914,8 @@ static void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; /* api callbacks */ - ot->invoke = transform_invoke; - ot->exec = transform_exec; + ot->invoke = edge_bevelweight_invoke; + ot->exec = edge_bevelweight_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; ot->poll = ED_operator_editmesh; |