[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41439] trunk/blender: Fix #29101: 2D Tilt on Bezier Curve Bug?

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Nov 1 12:00:08 CET 2011


Revision: 41439
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41439
Author:   blendix
Date:     2011-11-01 11:00:08 +0000 (Tue, 01 Nov 2011)
Log Message:
-----------
Fix #29101: 2D Tilt on Bezier Curve Bug?

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.

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

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-11-01 09:53:30 UTC (rev 41438)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-11-01 11:00:08 UTC (rev 41439)
@@ -209,7 +209,7 @@
         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)

Modified: trunk/blender/source/blender/editors/curve/curve_ops.c
===================================================================
--- trunk/blender/source/blender/editors/curve/curve_ops.c	2011-11-01 09:53:30 UTC (rev 41438)
+++ trunk/blender/source/blender/editors/curve/curve_ops.c	2011-11-01 11:00:08 UTC (rev 41439)
@@ -223,7 +223,6 @@
 
 	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);
 

Modified: trunk/blender/source/blender/editors/include/ED_screen.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_screen.h	2011-11-01 09:53:30 UTC (rev 41438)
+++ trunk/blender/source/blender/editors/include/ED_screen.h	2011-11-01 11:00:08 UTC (rev 41439)
@@ -159,6 +159,7 @@
 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);

Modified: trunk/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_ops.c	2011-11-01 09:53:30 UTC (rev 41438)
+++ trunk/blender/source/blender/editors/screen/screen_ops.c	2011-11-01 11:00:08 UTC (rev 41439)
@@ -406,6 +406,17 @@
 	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);

Modified: trunk/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_ops.c	2011-11-01 09:53:30 UTC (rev 41438)
+++ trunk/blender/source/blender/editors/transform/transform_ops.c	2011-11-01 11:00:08 UTC (rev 41439)
@@ -610,7 +610,7 @@
 	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);
 




More information about the Bf-blender-cvs mailing list