Bugfix [#26792] blender crash when scaling action strip in NLA
authorJoshua Leung <aligorith@gmail.com>
Tue, 5 Apr 2011 11:04:00 +0000 (11:04 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 5 Apr 2011 11:04:00 +0000 (11:04 +0000)
Two part bug:
Part 1) NLA Editor menu was calling wrong operator
Part 2) r35829 broke NLA scaling, since it only checked that the
transform mode used was allowed in the Action Editor (probably
confused by Part 1)

release/scripts/startup/bl_ui/space_nla.py
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c

index e0b5d84..5c8e8cd 100644 (file)
@@ -188,7 +188,7 @@ class NLA_MT_edit_transform(bpy.types.Menu):
         layout.column()
         layout.operator("transform.translate", text="Grab/Move")
         layout.operator("transform.transform", text="Extend").mode = 'TIME_EXTEND'
-        # layout.operator("transform.resize", text="Scale")  # crashes [#26792]
+        layout.operator("transform.transform", text="Scale").mode= 'TIME_SCALE'
 
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)
index 43e0af5..13564ff 100644 (file)
@@ -5793,8 +5793,10 @@ void initTimeScale(TransInfo *t)
 {
        int center[2];
 
-       /* this tool is only really available in the Action Editor... */
-       if (t->spacetype != SPACE_ACTION) {
+       /* this tool is only really available in the Action Editor
+        * AND NLA Editor (for strip scaling)
+        */
+       if (ELEM(t->spacetype, SPACE_ACTION, SPACE_NLA) == 0) {
                t->state = TRANS_CANCEL;
        }
 
index 99214fe..04783cc 100644 (file)
@@ -2613,6 +2613,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                                                                unit_m3(td->smtx);
                                                        }
                                                        else {
+                                                               /* time scaling only needs single value */
                                                                td->val= &tdn->h1[0];
                                                                td->ival= tdn->h1[0];
                                                        }
@@ -2644,6 +2645,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                                                                unit_m3(td->smtx);
                                                        }
                                                        else {
+                                                               /* time scaling only needs single value */
                                                                td->val= &tdn->h2[0];
                                                                td->ival= tdn->h2[0];
                                                        }
@@ -2664,7 +2666,7 @@ static void createTransNlaData(bContext *C, TransInfo *t)
                        }
                }
        }
-
+       
        /* cleanup temp list */
        BLI_freelistN(&anim_data);
 }