Bugfix [#26792] blender crash when scaling action strip in NLA

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)
This commit is contained in:
Joshua Leung 2011-04-05 11:04:00 +00:00
parent 165a40e742
commit bbf82877cf
3 changed files with 8 additions and 4 deletions

@ -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__)

@ -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;
}

@ -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);
}