NLA Bugfixes:

* Fixed crash when anim-playback is running and a strip beside a transition gets transformed. 
Transition strips no-longer assume that their neighbours are action-clips, using the standard NLA-strip evaluation function instead to evaluate their neighbours. However, a check for ping-pong recursion needed to be added there, so that a transition beside a meta-strip, with the meta having a transition nested at the start of one of its levels, wouldn't fail with stack overflow.

* Moved 'Tweak Mode' menu entry to Edit menu, since it's not really that modal.
This commit is contained in:
2009-07-12 04:29:36 +00:00
parent bb158ad572
commit fa8bd34d95
2 changed files with 26 additions and 12 deletions

View File

@@ -1049,12 +1049,12 @@ static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, L
/* first strip */
tmp_nes.strip_mode= NES_TIME_TRANSITION_START;
tmp_nes.strip= s1;
nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
/* second strip */
tmp_nes.strip_mode= NES_TIME_TRANSITION_END;
tmp_nes.strip= s2;
nlastrip_evaluate_actionclip(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
nlastrip_evaluate(ptr, &tmp_channels, &tmp_modifiers, &tmp_nes);
/* assumulate temp-buffer and full-buffer, using the 'real' strip */
@@ -1108,8 +1108,18 @@ static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, ListBas
/* evaluates the given evaluation strip */
void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
{
NlaStrip *strip= nes->strip;
/* to prevent potential infinite recursion problems (i.e. transition strip, beside meta strip containing a transition
* several levels deep inside it), we tag the current strip as being evaluated, and clear this when we leave
*/
// TODO: be careful with this flag, since some edit tools may be running and have set this while animplayback was running
if (strip->flag & NLASTRIP_FLAG_EDIT_TOUCHED)
return;
strip->flag |= NLASTRIP_FLAG_EDIT_TOUCHED;
/* actions to take depend on the type of strip */
switch (nes->strip->type) {
switch (strip->type) {
case NLASTRIP_TYPE_CLIP: /* action-clip */
nlastrip_evaluate_actionclip(ptr, channels, modifiers, nes);
break;
@@ -1120,6 +1130,9 @@ void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers
nlastrip_evaluate_meta(ptr, channels, modifiers, nes);
break;
}
/* clear temp recursion safe-check */
strip->flag &= ~NLASTRIP_FLAG_EDIT_TOUCHED;
}
/* write the accumulated settings to */

View File

@@ -83,7 +83,6 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
bScreen *sc= CTX_wm_screen(C);
ScrArea *sa= CTX_wm_area(C);
Scene *scene= CTX_data_scene(C);
SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C);
PointerRNA spaceptr;
@@ -104,11 +103,6 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemS(layout);
if (scene->flag & SCE_NLA_EDIT_ON)
uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_exit");
else
uiItemO(layout, NULL, 0, "NLA_OT_tweakmode_enter");
uiItemS(layout);
uiItemO(layout, NULL, 0, "ANIM_OT_previewrange_set");
@@ -153,6 +147,8 @@ static void nla_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
{
Scene *scene= CTX_data_scene(C);
uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu);
uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu);
@@ -160,9 +156,6 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemO(layout, NULL, 0, "NLA_OT_duplicate");
uiItemO(layout, NULL, 0, "NLA_OT_split");
uiItemS(layout);
uiItemO(layout, NULL, 0, "NLA_OT_delete");
uiItemS(layout);
@@ -178,6 +171,14 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused)
uiItemO(layout, NULL, 0, "NLA_OT_move_up");
uiItemO(layout, NULL, 0, "NLA_OT_move_down");
uiItemS(layout);
// TODO: names of these tools for 'tweakmode' need changing?
if (scene->flag & SCE_NLA_EDIT_ON)
uiItemO(layout, "Stop Tweaking Strip Actions", 0, "NLA_OT_tweakmode_exit");
else
uiItemO(layout, "Start Tweaking Strip Actions", 0, "NLA_OT_tweakmode_enter");
}
static void nla_addmenu(bContext *C, uiLayout *layout, void *arg_unused)