Bugfix #21739: Extend in the NLA crashes (Ekey)
authorJoshua Leung <aligorith@gmail.com>
Fri, 26 Mar 2010 00:25:14 +0000 (00:25 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 26 Mar 2010 00:25:14 +0000 (00:25 +0000)
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_ops.c

index 02e4ee5da91cde708b66b0c0237d084e7f694b27..8e8e2aeb5af0e6399a0199e552f8d6185bdee32f 100644 (file)
@@ -2600,7 +2600,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                float xmouse, ymouse;
                
                UI_view2d_region_to_view(&ac.ar->v2d, t->imval[0], t->imval[1], &xmouse, &ymouse);
-               t->frame_side= (xmouse > CFRA) ? 'R' : 'L'; // XXX use t->frame_side
+               t->frame_side= (xmouse > CFRA) ? 'R' : 'L';
        }
        else {
                /* normal transform - both sides of current frame are considered */
@@ -2691,7 +2691,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                                                        tdn->handle= -1;
                                                        
                                                        /* now, link the transform data up to this data */
-                                                       if (t->mode == TFM_TRANSLATION) {
+                                                       if (ELEM(t->mode, TFM_TRANSLATION, TFM_TIME_EXTEND)) {
                                                                td->loc= tdn->h1;
                                                                VECCOPY(td->iloc, tdn->h1);
                                                                
@@ -2722,7 +2722,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                                                        tdn->handle= (tdn->handle) ? 2 : 1;
                                                        
                                                        /* now, link the transform data up to this data */
-                                                       if (t->mode == TFM_TRANSLATION) {
+                                                       if (ELEM(t->mode, TFM_TRANSLATION, TFM_TIME_EXTEND)) {
                                                                td->loc= tdn->h2;
                                                                VECCOPY(td->iloc, tdn->h2);
                                                                
index b12de7fd6f8f18ec8fede3c9a49849d88fea0bec..fb1282495a42b1f2f489f93333e84a7bbf2f10d9 100644 (file)
@@ -869,30 +869,29 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
                case SPACE_ACTION:
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", GKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
-
+                       
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
-
+                       
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
-
+                       
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
-
+                       
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", TKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE);
                        break;
                case SPACE_IPO:
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, GKEY, KM_PRESS, 0, 0);
-
+                       
                        km= WM_keymap_add_item(keymap, OP_TRANSLATION, EVT_TWEAK_S, KM_ANY, 0, 0);
-
-                               // XXX the 'mode' identifier here is not quite right
+                       
                        km= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", EKEY, KM_PRESS, 0, 0);
                        RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
-
+                       
                        km = WM_keymap_add_item(keymap, OP_ROTATION, RKEY, KM_PRESS, 0, 0);
-
+                       
                        km = WM_keymap_add_item(keymap, OP_RESIZE, SKEY, KM_PRESS, 0, 0);
                        break;
                case SPACE_NLA: