Skip to content
Snippets Groups Projects
Commit 03ccc18d authored by Chris Want's avatar Chris Want
Browse files

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.
parent 34aa59c5
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,83 @@ extern int nla_filter (Base* base, int flags); /* From drawnla.c */ ...@@ -102,6 +102,83 @@ extern int nla_filter (Base* base, int flags); /* From drawnla.c */
/* ******************** SPACE: NLA ********************** */ /* ******************** 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) void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
{ {
unsigned short event= evt->event; unsigned short event= evt->event;
...@@ -141,6 +218,14 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt) ...@@ -141,6 +218,14 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
do_nla_buttons(B_NLAHOME); do_nla_buttons(B_NLAHOME);
break; break;
case PADMINUS:
shift_nlastrips_up();
break;
case PADPLUSKEY:
shift_nlastrips_down();
break;
case AKEY: case AKEY:
if (G.qual & LR_SHIFTKEY){ if (G.qual & LR_SHIFTKEY){
add_nlablock(mval); add_nlablock(mval);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment