Graph Editor Bugfixes:
authorJoshua Leung <aligorith@gmail.com>
Sun, 2 Aug 2009 22:56:42 +0000 (22:56 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 2 Aug 2009 22:56:42 +0000 (22:56 +0000)
* Tools such as set handle type, etc. were not being called correctly from the menus. There were missing operator-context calls to make sure that the invoke methods would get skipped.

* Hack for loading old files - buttons region for Graph Editor now gets added. Dunno why this didn't work automatically as for NLA despite the two having the same code.

source/blender/blenloader/intern/readfile.c
source/blender/editors/space_action/action_header.c
source/blender/editors/space_graph/graph_header.c

index 3b976b7d6580cd4e51127a6ae4df3b47a9fec1e2..876b07eef894fe23caa2dc10d1587eb6fee6cb1d 100644 (file)
@@ -5731,6 +5731,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                ar->regiontype= RGN_TYPE_CHANNELS;
                                ar->alignment= RGN_ALIGN_LEFT; 
                                ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+                               
+                                       // for some reason, this doesn't seem to go auto like for NLA...
+                               ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
+                               BLI_addtail(lb, ar);
+                               ar->regiontype= RGN_TYPE_UI;
+                               ar->alignment= RGN_ALIGN_RIGHT;
+                               ar->v2d.scroll= V2D_SCROLL_RIGHT;
+                               ar->v2d.flag = RGN_FLAG_HIDDEN;
                                break;
                                
                        case SPACE_ACTION:
index 7f5e28510705d68d6900bbcce2e310b5cdf14368..b3c3cbaca18879e439953ce6edc26af318d8e655 100644 (file)
@@ -167,6 +167,7 @@ static void act_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unus
 
 static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_CFRA);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_FRAME);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_SECOND);
@@ -175,6 +176,7 @@ static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
 
 static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_CFRA);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_YAXIS);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_XAXIS);
@@ -183,6 +185,7 @@ static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused)
 
 static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_FREE);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_AUTO);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_VECT);
@@ -192,6 +195,7 @@ static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused
 
 static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_CONST);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_LIN);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_BEZ);
@@ -199,6 +203,7 @@ static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
 
 static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT);
        uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR);
 }
index 5a7b7d654b1c2f02ddf8f5393bf79c0211f1a1a6..989f1f8e0cc3608576e8c2062ac8e36d699f9c24 100644 (file)
@@ -158,6 +158,7 @@ static void graph_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_un
 
 static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_FRAME);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_SECOND);
@@ -166,6 +167,7 @@ static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
 
 static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_CFRA);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_YAXIS);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_XAXIS);
@@ -174,6 +176,7 @@ static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unuse
 
 static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_FREE);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_AUTO);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_VECT);
@@ -183,6 +186,7 @@ static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unus
 
 static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_CONST);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_LIN);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_BEZ);
@@ -190,6 +194,7 @@ static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused)
 
 static void graph_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx?
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT);
        uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR);
 }