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-06-20 08:02:49 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-20 08:02:49 +0400
commit6394ee9e8143988b2a0f9316fb7bca5dc78e6e53 (patch)
treeac6a3c209f6b8b7eca45742b2cf4b8ba0a0f38f7 /source
parent6393e9b3ca7e40e95830d009020b0f106c00b529 (diff)
NLA SoC: Drawing + Editing Fixes
* Strips using the same action as the 'tweaking action' now get the error flag cleared after tweakmode is exited. (These strips draw with red shading) * The direction in which strips get played (as a result of the 'reversed' option) now gets indicated on strips by the direction of the arrow text printed on each strip * The active strip flag is now cleared after duplicating/splitting strips.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/nla.c12
-rw-r--r--source/blender/editors/space_nla/nla_draw.c12
-rw-r--r--source/blender/editors/space_nla/nla_edit.c7
3 files changed, 23 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 0684d943754..1ce6d9f98c7 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -648,7 +648,6 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
/* if block is already in tweakmode, just leave, but we should report
* that this block is in tweakmode (as our returncode)
*/
- // FIXME: hopefully the flag is correct!
if (adt->flag & ADT_NLA_EDIT_ON)
return 1;
@@ -707,6 +706,7 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
/* Exit tweakmode for this AnimData block */
void BKE_nla_tweakmode_exit (AnimData *adt)
{
+ NlaStrip *strip;
NlaTrack *nlt;
/* verify that data is valid */
@@ -719,9 +719,15 @@ void BKE_nla_tweakmode_exit (AnimData *adt)
// TODO: need to sync the user-strip with the new state of the action!
- /* for all NLA-tracks, clear the 'disabled' flag */
- for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next)
+ /* for all NLA-tracks, clear the 'disabled' flag
+ * for all NLA-strips, clear the 'tweak-user' flag
+ */
+ for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) {
nlt->flag &= ~NLATRACK_DISABLED;
+
+ for (strip= nlt->strips.first; strip; strip= strip->next)
+ strip->flag &= ~NLASTRIP_FLAG_TWEAKUSER;
+ }
/* handle AnimData level changes:
* - 'temporary' active action needs its usercount decreased, since we're removing this reference
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 9a9cbeeff21..2ac2b557243 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -212,19 +212,25 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2
/* add the relevant text to the cache of text-strings to draw in pixelspace */
static void nla_draw_strip_text (NlaTrack *nlt, NlaStrip *strip, int index, View2D *v2d, float yminc, float ymaxc)
{
- char str[256];
+ char str[256], dir[3];
rctf rect;
+ /* 'dir' - direction that strip is played in */
+ if (strip->flag & NLASTRIP_FLAG_REVERSE)
+ sprintf(dir, "<-");
+ else
+ sprintf(dir, "->");
+
/* for now, just init the string with fixed-formats */
switch (strip->type) {
case NLASTRIP_TYPE_TRANSITION: /* Transition */
- sprintf(str, "%d | Transition | %.2f <-> %.2f", index, strip->start, strip->end);
+ sprintf(str, "%d | Transition | %.2f %s %.2f", index, strip->start, dir, strip->end);
break;
case NLASTRIP_TYPE_CLIP: /* Action-Clip (default) */
default:
if (strip->act)
- sprintf(str, "%d | Act: %s | %.2f <-> %.2f", index, strip->act->id.name+2, strip->start, strip->end);
+ sprintf(str, "%d | Act: %s | %.2f %s %.2f", index, strip->act->id.name+2, strip->start, dir, strip->end);
else
sprintf(str, "%d | Act: <NONE>", index); // xxx... need a better format?
break;
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 8b7c6bb99c6..ebb0589a82d 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -492,8 +492,8 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op)
BKE_nlatrack_add_strip(track, nstrip);
}
- /* deselect the original */
- strip->flag &= ~NLASTRIP_FLAG_SELECT;
+ /* deselect the original and the active flag */
+ strip->flag &= ~(NLASTRIP_FLAG_SELECT|NLASTRIP_FLAG_ACTIVE);
done++;
}
@@ -666,6 +666,9 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op)
strip->actend= midaframe;
nstrip->actstart= midaframe;
+
+ /* clear the active flag from the copy */
+ nstrip->flag &= ~NLASTRIP_FLAG_ACTIVE;
}
}
}