add access to bevel weight modal operator (only available in the Shift+E edge menu...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 12 May 2012 23:07:52 +0000 (23:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 12 May 2012 23:07:52 +0000 (23:07 +0000)
release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c

index 7486eb32f5c85a28843af6e8f6107628ecb558a1..6efbb99701a8f16c201598a56d190b5329bc1487 100644 (file)
@@ -1795,6 +1795,11 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
 
         layout.separator()
 
+        layout.operator("transform.edge_crease")
+        layout.operator("transform.edge_bevelweight")
+
+        layout.separator()
+
         layout.operator("mesh.mark_seam").clear = False
         layout.operator("mesh.mark_seam", text="Clear Seam").clear = True
 
index b986bda4c13ce9b3a2d0c9028b1310b2a026f7b3..a9179f95d4ee6f2570767462a8290456bcb1c4d4 100644 (file)
@@ -1016,7 +1016,7 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        }
 
        /* Crease needs edge flag */
-       if (t->mode == TFM_CREASE) {
+       if (ELEM(t->mode, TFM_CREASE, TFM_BWEIGHT)) {
                t->options |= CTX_EDGE;
        }
 
index ccd794d01012c69747677fec3a35732e51eed0a2..744925dbffd1243e045d07113309dc65a8a3994b 100644 (file)
@@ -72,6 +72,7 @@ static char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
 static char OP_MIRROR[] = "TRANSFORM_OT_mirror";
 static char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
 static char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
+static char OP_EDGE_BWEIGHT[] = "TRANSFORM_OT_edge_bevelweight";
 static char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
 
 void TRANSFORM_OT_translate(struct wmOperatorType *ot);
@@ -87,6 +88,7 @@ void TRANSFORM_OT_trackball(struct wmOperatorType *ot);
 void TRANSFORM_OT_mirror(struct wmOperatorType *ot);
 void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot);
 void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot);
+void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot);
 void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot);
 
 static TransformModeItem transform_modes[] =
@@ -104,6 +106,7 @@ static TransformModeItem transform_modes[] =
        {OP_MIRROR, TFM_MIRROR, TRANSFORM_OT_mirror},
        {OP_EDGE_SLIDE, TFM_EDGE_SLIDE, TRANSFORM_OT_edge_slide},
        {OP_EDGE_CREASE, TFM_CREASE, TRANSFORM_OT_edge_crease},
+       {OP_EDGE_BWEIGHT, TFM_BWEIGHT, TRANSFORM_OT_edge_bevelweight},
        {OP_SEQ_SLIDE, TFM_SEQ_SLIDE, TRANSFORM_OT_seq_slide},
        {NULL, 0}
 };
@@ -764,6 +767,26 @@ void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
        Transform_Properties(ot, P_SNAP);
 }
 
+void TRANSFORM_OT_edge_bevelweight(struct wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name   = "Edge Bevel Weight";
+       ot->description = "Change the bevel weight of edges";
+       ot->idname = OP_EDGE_BWEIGHT;
+       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING;
+
+       /* api callbacks */
+       ot->invoke = transform_invoke;
+       ot->exec   = transform_exec;
+       ot->modal  = transform_modal;
+       ot->cancel = transform_cancel;
+       ot->poll   = ED_operator_editmesh;
+
+       RNA_def_float_factor(ot->srna, "value", 0, -1.0f, 1.0f, "Factor", "", -1.0f, 1.0f);
+
+       Transform_Properties(ot, P_SNAP);
+}
+
 void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
 {
        /* identifiers */