Orange bugfixes in NLA editor;

- ALT+C "convert action into strip" didn't calculate the mouse position
  correct. Also changed menu a bit to tell which action it makes a strip
- Select action strips  now activates Object too
- Icons in Object 'row' (denoting NLA override or not) now draw blended
This commit is contained in:
Ton Roosendaal
2005-10-26 19:34:32 +00:00
parent d5617f7f59
commit ccfc821412
2 changed files with 23 additions and 18 deletions

View File

@@ -126,10 +126,12 @@ static void draw_nla_channels(void)
/* icon to indicate nla or action */
if(ob->nlastrips.first && ob->action) {
glEnable(GL_BLEND);
if(ob->nlaflag & OB_NLA_OVERRIDE)
BIF_draw_icon(x+5, y-8, ICON_NLA);
BIF_draw_icon_blended(x+5, y-8, ICON_NLA, TH_HEADER, 0);
else
BIF_draw_icon(x+5, y-8, ICON_ACTION);
BIF_draw_icon_blended(x+5, y-8, ICON_ACTION, TH_HEADER, 0);
glDisable(GL_BLEND);
}
y-=NLACHANNELHEIGHT+NLACHANNELSKIP;

View File

@@ -373,12 +373,13 @@ static void set_active_strip(Object *ob, bActionStrip *act)
static void convert_nla(short mval[2])
{
short event;
float ymax, ymin;
bActionStrip *strip, *nstrip;
Base *base;
float x,y;
float ymax, ymin;
int sel=0;
bActionStrip *strip, *nstrip;
short event;
char str[128];
/* Find out what strip we're over */
ymax = count_nla_levels() * (NLACHANNELSKIP+NLACHANNELHEIGHT);
@@ -388,17 +389,18 @@ static void convert_nla(short mval[2])
for (base=G.scene->base.first; base; base=base->next){
if (nla_filter(base)) {
/* Check object ipo */
ymin= ymax-(NLACHANNELSKIP+NLACHANNELHEIGHT);
if (y>=ymin && y<=ymax)
break;
/* Area that encloses object name (or ipo) */
ymin=ymax-(NLACHANNELHEIGHT+NLACHANNELSKIP);
ymax=ymin;
/* Check action ipo */
ymin=ymax-(NLACHANNELSKIP+NLACHANNELHEIGHT);
if (y>=ymin && y<=ymax)
break;
ymax=ymin;
if (base->object->action) {
ymin=ymax-(NLACHANNELSKIP+NLACHANNELHEIGHT);
if (y>=ymin && y<=ymax)
break;
ymax=ymin;
}
/* Check nlastrips */
for (strip=base->object->nlastrips.first; strip; strip=strip->next){
@@ -414,10 +416,12 @@ static void convert_nla(short mval[2])
}
}
if (!base)
if (base==0 || base->object->action==NULL)
return;
event = pupmenu("Convert%t|Action to NLA Strip%x1");
sprintf(str, "Convert Action%%t|%s to NLA Strip%%x1", base->object->action->id.name+2);
event = pupmenu(str);
switch (event){
case 1:
if (base->object->action){
@@ -439,9 +443,6 @@ static void convert_nla(short mval[2])
BLI_addtail(&base->object->nlastrips, nstrip);
/* Unlink action */
base->object->action = NULL;
BIF_undo_push("Convert NLA");
allqueue (REDRAWNLA, 0);
}
@@ -1278,6 +1279,8 @@ static void mouse_nla(int selectmode)
rstrip->flag |= ACTSTRIP_SELECT;
set_active_strip(base->object, rstrip);
if(base!=BASACT) set_active_base(base);
}
}
}