Revision: 33654
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33654
Author:   campbellbarton
Date:     2010-12-14 11:17:13 +0100 (Tue, 14 Dec 2010)

Log Message:
-----------
Change set handle types back to menu now menus have key access - V+A, V+V, V+L, 
V+F
for Graph & Edit Curve view.

Editcurve can be Hkey for hide again.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_info.py
    trunk/blender/source/blender/editors/curve/curve_ops.c
    trunk/blender/source/blender/editors/curve/editcurve.c
    trunk/blender/source/blender/editors/space_graph/graph_edit.c
    trunk/blender/source/blender/editors/space_graph/graph_intern.h
    trunk/blender/source/blender/editors/space_graph/graph_ops.c

Modified: trunk/blender/release/scripts/ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/ui/space_info.py      2010-12-14 08:35:56 UTC 
(rev 33653)
+++ trunk/blender/release/scripts/ui/space_info.py      2010-12-14 10:17:13 UTC 
(rev 33654)
@@ -250,19 +250,7 @@
         layout.operator("surface.primitive_nurbs_surface_sphere_add", 
icon='SURFACE_NSPHERE', text="NURBS Sphere")
         layout.operator("surface.primitive_nurbs_surface_torus_add", 
icon='SURFACE_NTORUS', text="NURBS Torus")
 
-class INFO_MT_curve_handle_type_set(bpy.types.Menu):
-    bl_idname = "INFO_MT_curve_handle_type_set"
-    bl_label = "Handle Type"
 
-    def draw(self, context):
-        layout = self.layout
-        layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator("curve.handle_type_set", text="Automatic").type = 
"AUTOMATIC"
-        layout.operator("curve.handle_type_set", text="Vector").type = "VECTOR"
-        layout.operator("curve.handle_type_set", text="Align").type = "ALIGN"
-        layout.operator("curve.handle_type_set", text="Free Align").type = 
"FREE_ALIGN"
-
-
 class INFO_MT_armature_add(bpy.types.Menu):
     bl_idname = "INFO_MT_armature_add"
     bl_label = "Armature"

Modified: trunk/blender/source/blender/editors/curve/curve_ops.c
===================================================================
--- trunk/blender/source/blender/editors/curve/curve_ops.c      2010-12-14 
08:35:56 UTC (rev 33653)
+++ trunk/blender/source/blender/editors/curve/curve_ops.c      2010-12-14 
10:17:13 UTC (rev 33654)
@@ -196,12 +196,9 @@
        keymap->poll= ED_operator_editsurfcurve;
 
        WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, 
KM_SHIFT, 0);
-                                                                               
                                                                                
                /* XXX will fix it with proper defines (ton) */
-       RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", 
HKEY, KM_PRESS, 0, 0)->ptr, "type", 5);
-       RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", 
HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", HD_AUTO);
-       RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", 
HKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", 6);
-       RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", 
VKEY, KM_PRESS, 0, 0)->ptr, "type", HD_VECT);
        
+       WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", VKEY, KM_PRESS, 
0, 0);
+
        WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, 
KM_CTRL, 0);
 
        WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0);
@@ -226,7 +223,7 @@
        RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, 
KM_PRESS, KM_ALT, 0)->ptr, "mode", TFM_CURVE_SHRINKFATTEN);
 
        WM_keymap_add_item(keymap, "CURVE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 
0);
-       WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, 
KM_ALT|KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT, 0);
        RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, 
KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "unselected", 1);
 
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, 
KM_PRESS, KM_CTRL, 0);

Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c      2010-12-14 
08:35:56 UTC (rev 33653)
+++ trunk/blender/source/blender/editors/curve/editcurve.c      2010-12-14 
10:17:13 UTC (rev 33654)
@@ -3538,11 +3538,12 @@
 
 void CURVE_OT_handle_type_set(wmOperatorType *ot)
 {
-       static EnumPropertyItem type_items[]= {
+       /* keep in sync with graphkeys_handle_type_items */
+       static EnumPropertyItem editcurve_handle_type_items[]= {
                {HD_AUTO, "AUTOMATIC", 0, "Automatic", ""},
                {HD_VECT, "VECTOR", 0, "Vector", ""},
-               {5, "ALIGN", 0, "Align", ""},
-               {6, "FREE_ALIGN", 0, "Free Align", ""},
+               {5, "ALIGNED", 0, "Aligned", ""},
+               {6, "FREE_ALIGN", 0, "Free", ""},
                {3, "TOGGLE_FREE_ALIGN", 0, "Toggle Free/Align", ""},
                {0, NULL, 0, NULL, NULL}};
 
@@ -3551,6 +3552,7 @@
        ot->idname= "CURVE_OT_handle_type_set";
        
        /* api callbacks */
+       ot->invoke= WM_menu_invoke;
        ot->exec= set_handle_type_exec;
        ot->poll= ED_operator_editcurve;
        
@@ -3558,7 +3560,7 @@
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
        /* properties */
-       RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Spline type");
+       ot->prop= RNA_def_enum(ot->srna, "type", editcurve_handle_type_items, 
1, "Type", "Spline type");
 }
 
 /***************** make segment operator **********************/

Modified: trunk/blender/source/blender/editors/space_graph/graph_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_edit.c       
2010-12-14 08:35:56 UTC (rev 33653)
+++ trunk/blender/source/blender/editors/space_graph/graph_edit.c       
2010-12-14 10:17:13 UTC (rev 33654)
@@ -1352,14 +1352,6 @@
 
 /* ******************** Set Handle-Type Operator *********************** */
 
-EnumPropertyItem graphkeys_handle_type_items[] = {
-       {HD_FREE, "FREE", 0, "Free", ""},
-       {HD_VECT, "VECTOR", 0, "Vector", ""},
-       {HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
-       {HD_AUTO, "AUTO", 0, "Auto", "Handles that are automatically adjusted 
upon moving the keyframe. Whole curve"},
-       {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Auto handles clamped 
to not overshoot. Whole curve"},
-       {0, NULL, 0, NULL, NULL}};
-
 /* ------------------- */
 
 /* this function is responsible for setting handle-type of selected keyframes 
*/
@@ -1424,14 +1416,24 @@
        return OPERATOR_FINISHED;
 }
  
- void GRAPH_OT_handle_type (wmOperatorType *ot)
+ void GRAPH_OT_handle_type_set (wmOperatorType *ot)
 {
+        /* sync with editcurve_handle_type_items */
+        static EnumPropertyItem graphkeys_handle_type_items[] = {
+                {HD_AUTO, "AUTO", 0, "Automatic", "Handles that are 
automatically adjusted upon moving the keyframe. Whole curve"},
+                {HD_VECT, "VECTOR", 0, "Vector", ""},
+                {HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
+                {HD_FREE, "FREE_ALIGN", 0, "Free", ""},
+                {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Auto 
handles clamped to not overshoot. Whole curve"},
+                {0, NULL, 0, NULL, NULL}};      
+
        /* identifiers */
        ot->name= "Set Keyframe Handle Type";
-       ot->idname= "GRAPH_OT_handle_type";
+       ot->idname= "GRAPH_OT_handle_type_set";
        ot->description= "Set type of handle for selected keyframes";
        
        /* api callbacks */
+       ot->invoke= WM_menu_invoke;
        ot->exec= graphkeys_handletype_exec;
        ot->poll= graphop_editable_keyframes_poll;
        

Modified: trunk/blender/source/blender/editors/space_graph/graph_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_intern.h     
2010-12-14 08:35:56 UTC (rev 33653)
+++ trunk/blender/source/blender/editors/space_graph/graph_intern.h     
2010-12-14 10:17:13 UTC (rev 33654)
@@ -106,7 +106,7 @@
 void GRAPH_OT_sound_bake(struct wmOperatorType *ot);
 void GRAPH_OT_smooth(struct wmOperatorType *ot);
 
-void GRAPH_OT_handle_type(struct wmOperatorType *ot);
+void GRAPH_OT_handle_type_set(struct wmOperatorType *ot);
 void GRAPH_OT_interpolation_type(struct wmOperatorType *ot);
 void GRAPH_OT_extrapolation_type(struct wmOperatorType *ot);
 

Modified: trunk/blender/source/blender/editors/space_graph/graph_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_ops.c        
2010-12-14 08:35:56 UTC (rev 33653)
+++ trunk/blender/source/blender/editors/space_graph/graph_ops.c        
2010-12-14 10:17:13 UTC (rev 33654)
@@ -239,7 +239,7 @@
        WM_operatortype_append(GRAPH_OT_snap);
        WM_operatortype_append(GRAPH_OT_mirror);
        WM_operatortype_append(GRAPH_OT_frame_jump);
-       WM_operatortype_append(GRAPH_OT_handle_type);
+       WM_operatortype_append(GRAPH_OT_handle_type_set);
        WM_operatortype_append(GRAPH_OT_interpolation_type);
        WM_operatortype_append(GRAPH_OT_extrapolation_type);
        WM_operatortype_append(GRAPH_OT_sample);
@@ -332,12 +332,8 @@
        WM_keymap_add_item(keymap, "GRAPH_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 
0);
        WM_keymap_add_item(keymap, "GRAPH_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 
0);
        
-       RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, 
KM_PRESS, 0, 0)->ptr, "type", HD_ALIGN);
-       RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, 
KM_PRESS, KM_SHIFT, 0)->ptr, "type", HD_AUTO);
-       RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, 
KM_PRESS, KM_ALT, 0)->ptr, "type", HD_FREE);
-       RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", VKEY, 
KM_PRESS, 0, 0)->ptr, "type", HD_VECT);
-       
-       
+       WM_keymap_add_item(keymap, "GRAPH_OT_handle_type_set", VKEY, KM_PRESS, 
0, 0);
+
        WM_keymap_add_item(keymap, "GRAPH_OT_interpolation_type", TKEY, 
KM_PRESS, KM_SHIFT, 0);
        
                /* destructive */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to