Edge Crease Transform is back. Now in edge menu (Ctrl-E) with Edge Slide and the...
authorMartin Poirier <theeth@yahoo.com>
Sat, 9 Jan 2010 20:42:35 +0000 (20:42 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sat, 9 Jan 2010 20:42:35 +0000 (20:42 +0000)
release/scripts/ui/space_view3d.py
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c

index 5563b7274877575b72ad5dd22629a1083ad4798e..8c430d39aa31953e5a79f3b5b1fb812b9bb2388b 100644 (file)
@@ -1217,7 +1217,8 @@ class VIEW3D_MT_edit_mesh_edges(bpy.types.Menu):
 
         layout.separator()
 
-        layout.operator("TRANSFORM_OT_edge_slide", text="Edge Slide")
+        layout.operator("TRANSFORM_OT_edge_slide")
+        layout.operator("TRANSFORM_OT_edge_crease")
         layout.operator("mesh.loop_multi_select", text="Edge Loop")
 
         # uiItemO(layout, "Loopcut", 0, "mesh.loop_cut"); // CutEdgeloop(em, 1);
index 822c0e5a9615ce7b5b8f59eedd02c9cc03de3dc0..7a89765fef2e837f619de2e0c43d39cd9079c846 100644 (file)
@@ -332,7 +332,7 @@ static void createTransTexspace(bContext *C, TransInfo *t)
 /* ********************* edge (for crease) ***** */
 
 static void createTransEdge(bContext *C, TransInfo *t) {
-#if 0  // TRANSFORM_FIX_ME
+       EditMesh *em = ((Mesh *)t->obedit->data)->edit_mesh;
        TransData *td = NULL;
        EditEdge *eed;
        float mtx[3][3], smtx[3][3];
@@ -390,7 +390,6 @@ static void createTransEdge(bContext *C, TransInfo *t) {
                        td++;
                }
        }
-#endif
 }
 
 /* ********************* pose mode ************* */
@@ -5148,11 +5147,11 @@ void createTransData(bContext *C, TransInfo *t)
        Scene *scene = CTX_data_scene(C);
        Object *ob = OBACT;
 
-       if (t->options == CTX_TEXTURE) {
+       if (t->options & CTX_TEXTURE) {
                t->flag |= T_TEXTURE;
                createTransTexspace(C, t);
        }
-       else if (t->options == CTX_EDGE) {
+       else if (t->options & CTX_EDGE) {
                t->ext = NULL;
                t->flag |= T_EDIT;
                createTransEdge(C, t);
index 061b2adbd793e229b52621c588a356cea1d8f1b5..3be863fc3f7ad1404b94e6bf31c0ee1b05589339 100644 (file)
@@ -919,6 +919,11 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
                t->flag |= T_MODAL;
        }
 
+       /* Crease needs edge flag */
+       if (t->mode == TFM_CREASE) {
+               t->options |= CTX_EDGE;
+       }
+
        t->spacetype = sa->spacetype;
        if(t->spacetype == SPACE_VIEW3D)
        {
index 1ef0bdb0e054ca2e544746f083cb94537098cfd9..f3789880ce9b0119c296c27b7675d98fa601dc28 100644 (file)
@@ -67,6 +67,7 @@ char OP_TILT[] = "TRANSFORM_OT_tilt";
 char OP_TRACKBALL[] = "TRANSFORM_OT_trackball";
 char OP_MIRROR[] = "TRANSFORM_OT_mirror";
 char OP_EDGE_SLIDE[] = "TRANSFORM_OT_edge_slide";
+char OP_EDGE_CREASE[] = "TRANSFORM_OT_edge_crease";
 char OP_SEQ_SLIDE[] = "TRANSFORM_OT_seq_slide";
 
 void TRANSFORM_OT_translate(struct wmOperatorType *ot);
@@ -80,6 +81,7 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot);
 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_seq_slide(struct wmOperatorType *ot);
 
 TransformModeItem transform_modes[] =
@@ -95,6 +97,7 @@ TransformModeItem transform_modes[] =
        {OP_TRACKBALL, TFM_TRACKBALL, TRANSFORM_OT_trackball},
        {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_SEQ_SLIDE, TFM_SEQ_SLIDE, TRANSFORM_OT_seq_slide},
        {NULL, 0}
 };
@@ -697,6 +700,26 @@ void TRANSFORM_OT_edge_slide(struct wmOperatorType *ot)
        Properties_Snapping(ot, 0, 0);
 }
 
+void TRANSFORM_OT_edge_crease(struct wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name   = "Edge Crease";
+       ot->description= "Change the crease of edges.";
+       ot->idname = OP_EDGE_CREASE;
+       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);
+
+       Properties_Snapping(ot, 0, 0);
+}
+
 void TRANSFORM_OT_seq_slide(struct wmOperatorType *ot)
 {
        /* identifiers */