diff options
author | Chris Want <cwant@ualberta.ca> | 2004-09-18 22:36:11 +0400 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2004-09-18 22:36:11 +0400 |
commit | 03ccc18d99bd47e29629c351abda4085b9b98a5c (patch) | |
tree | 48fd11c5fb84b5bc976d31bfd0577a8fe0669813 /source/blender/src/editnla.c | |
parent | 34aa59c5c3739e7fd96e0e68558540c0dec285cf (diff) |
For the Bass* people: pad plus/ pad minus moves nla strips up/down in
the nla editor.
Release note blurb:
Selected nla strips may be reordered down or up in the nla editor using
numpad plus/minus.
Diffstat (limited to 'source/blender/src/editnla.c')
-rw-r--r-- | source/blender/src/editnla.c | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c index 8f129cc7ff6..e4d86eea879 100644 --- a/source/blender/src/editnla.c +++ b/source/blender/src/editnla.c @@ -102,6 +102,83 @@ extern int nla_filter (Base* base, int flags); /* From drawnla.c */ /* ******************** SPACE: NLA ********************** */ +static void shift_nlastrips_up(void) { + + Base *base; + bActionStrip *strip, *prevstrip; + + for (base=G.scene->base.first; base; base=base->next) { + if (base->object->type == OB_ARMATURE) { + + for (strip = base->object->nlastrips.first; + strip; strip=strip->next){ + if (strip->flag & ACTSTRIP_SELECT) { + if ( (prevstrip = strip->prev) ) { + if (prevstrip->prev) + prevstrip->prev->next = strip; + if (strip->next) + strip->next->prev = prevstrip; + strip->prev = prevstrip->prev; + prevstrip->next = strip->next; + strip->next = prevstrip; + prevstrip->prev = strip; + + if (prevstrip == base->object->nlastrips.first) + base->object->nlastrips.first = strip; + if (strip == base->object->nlastrips.last) + base->object->nlastrips.last = prevstrip; + + strip = prevstrip; + } + else { + break; + } + } + } + } + } + allqueue (REDRAWNLA, 0); + +} + +static void shift_nlastrips_down(void) { + + Base *base; + bActionStrip *strip, *nextstrip; + + for (base=G.scene->base.first; base; base=base->next) { + if (base->object->type == OB_ARMATURE) { + for (strip = base->object->nlastrips.last; + strip; strip=strip->prev){ + if (strip->flag & ACTSTRIP_SELECT) { + if ( (nextstrip = strip->next) ) { + if (nextstrip->next) + nextstrip->next->prev = strip; + if (strip->prev) + strip->prev->next = nextstrip; + strip->next = nextstrip->next; + nextstrip->prev = strip->prev; + strip->prev = nextstrip; + nextstrip->next = strip; + + if (nextstrip == base->object->nlastrips.last) + base->object->nlastrips.last = strip; + if (strip == base->object->nlastrips.first) + base->object->nlastrips.first = nextstrip; + + strip = nextstrip; + } + else { + break; + } + } + } + } + } + allqueue (REDRAWNLA, 0); + +} + void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt) { unsigned short event= evt->event; @@ -141,6 +218,14 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt) do_nla_buttons(B_NLAHOME); break; + case PADMINUS: + shift_nlastrips_up(); + break; + + case PADPLUSKEY: + shift_nlastrips_down(); + break; + case AKEY: if (G.qual & LR_SHIFTKEY){ add_nlablock(mval); |