Fix #29101: 2D Tilt on Bezier Curve Bug?
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 1 Nov 2011 11:00:08 +0000 (11:00 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 1 Nov 2011 11:00:08 +0000 (11:00 +0000)
Changing tilt for 2D curves doesn't really hurt, just makes things not so
clear tosee what's going on because you're changing value which isn't used
at all for 2D curves. Disallwo to run TRANSFORM_OT_tilt operator for 2D curves.

Also made a correct fix for incorrect shortcut for tilt in 3D viewport toolbar,
it was really confusing to have almost the same operators (TRANSFORM_OT_tilt and
TRANSFORM_OT_transform with mode=tilt) in keymap. Better to use tilt operator
in toolbar.

release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/curve/curve_ops.c
source/blender/editors/include/ED_screen.h
source/blender/editors/screen/screen_ops.c
source/blender/editors/transform/transform_ops.c

index 14774c2215aa654c9a6947e287c3efa9190c90fc..9518ccb5f80be51f4e3b3deae08f415c303ce658 100644 (file)
@@ -209,7 +209,7 @@ class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
         col.operator("transform.resize", text="Scale")
 
         col = layout.column(align=True)
-        col.operator("transform.transform", text="Tilt").mode = 'TILT'
+        col.operator("transform.tilt", text="Tilt")
         col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
 
         col = layout.column(align=True)
index be6b322e6b46de480ee5bc30ceb8cc1f4c6842e0..95f3bb55ba5907355ce63b2dc9acfcdab9b334e1 100644 (file)
@@ -223,7 +223,6 @@ void ED_keymap_curve(wmKeyConfig *keyconf)
 
        WM_keymap_add_item(keymap, "CURVE_OT_tilt_clear", TKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "TRANSFORM_OT_tilt", TKEY, KM_PRESS, KM_CTRL, 0);
-       RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", TFM_TILT);
 
        RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", TFM_CURVE_SHRINKFATTEN);
 
index f92ee724f6fe40492408510b39775c7f074e7f5b..05537004927d7601fae2c41cd1aeb1552703cd45 100644 (file)
@@ -159,6 +159,7 @@ int         ED_operator_editmesh_view3d(struct bContext *C);
 int            ED_operator_editmesh_region_view3d(struct bContext *C);
 int            ED_operator_editarmature(struct bContext *C);
 int            ED_operator_editcurve(struct bContext *C);
+int            ED_operator_editcurve_3d(struct bContext *C);
 int            ED_operator_editsurf(struct bContext *C);
 int            ED_operator_editsurfcurve(struct bContext *C);
 int            ED_operator_editsurfcurve_region_view3d(struct bContext *C);
index 0a7e3a2763a551cf106ffc1fcf035618bc97213e..171adc8d89ac8e23a9a51d3c419faaa7de9988e5 100644 (file)
@@ -406,6 +406,17 @@ int ED_operator_editcurve(bContext *C)
        return 0;
 }
 
+int ED_operator_editcurve_3d(bContext *C)
+{
+       Object *obedit= CTX_data_edit_object(C);
+       if(obedit && obedit->type==OB_CURVE) {
+               Curve *cu= (Curve *)obedit->data;
+
+               return (cu->flag&CU_3D) && (NULL != cu->editnurb);
+       }
+       return 0;
+}
+
 int ED_operator_editsurf(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);
index 2d3c1d80d8db52407a97d9eb1159d05b415190f1..f926f442830bde5582a0ede63b7cc3d5264e22db 100644 (file)
@@ -610,7 +610,7 @@ void TRANSFORM_OT_tilt(struct wmOperatorType *ot)
        ot->exec   = transform_exec;
        ot->modal  = transform_modal;
        ot->cancel  = transform_cancel;
-       ot->poll   = ED_operator_editcurve;
+       ot->poll   = ED_operator_editcurve_3d;
 
        RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);