Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-07-12 08:29:36 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-12 08:29:36 +0400
commitfa8bd34d95d91712ffa6dc9066c255e9ee40e7e4 (patch)
treecbc357062cdb8748ac1bd6943724301439e3745e /source
parentbb158ad5721b98086b77a8168a53c4901540907d (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c19
-rw-r--r--source/blender/editors/space_nla/nla_header.c19
2 files changed, 26 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 19337f9de5d..e4882d8f555 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -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 */
diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c
index 8e4c71b9f80..e997a096bce 100644
--- a/source/blender/editors/space_nla/nla_header.c
+++ b/source/blender/editors/space_nla/nla_header.c
@@ -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)