== Action Editor ==

Now Action/IPO-Curve/Constraint Channels draw so that they open downwards. The only noticeable differences are that when expanding/collapsing channels, all the channels above won't get shunted out of the way again. Also, on loading some older files, all the channels may be out of view (TODO: make version patch for this...)
This commit is contained in:
2007-05-23 09:21:32 +00:00
parent 2a63a47a56
commit 80914f22ae
3 changed files with 19 additions and 50 deletions

View File

@@ -280,7 +280,7 @@ static void action_icu_buts(SpaceAction *saction)
UI_EMBOSS, UI_HELV, curarea->win);
x = NAMEWIDTH + 1;
y = count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
y = 0.0;
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -379,7 +379,7 @@ static void draw_action_channel_names(bAction *act)
float x, y;
x = 0.0;
y= count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
y = 0.0f;
for (achan=act->chanbase.first; achan; achan= achan->next) {
if(VISIBLE_ACHAN(achan)) {
@@ -706,7 +706,7 @@ static void draw_channel_strips(SpaceAction *saction)
map_active_strip(di, OBACT, 1);
/* first backdrop strips */
y= count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
y = 0.0;
glEnable(GL_BLEND);
for (achan=act->chanbase.first; achan; achan= achan->next) {
if(VISIBLE_ACHAN(achan)) {
@@ -776,8 +776,8 @@ static void draw_channel_strips(SpaceAction *saction)
if (G.saction->pin==0 && OBACT)
map_active_strip(di, OBACT, 0);
/* dot thingies */
y= count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
/* keyframes */
y = 0.0;
for (achan= act->chanbase.first; achan; achan= achan->next) {
if(VISIBLE_ACHAN(achan)) {
@@ -828,8 +828,7 @@ static void draw_channel_strips(SpaceAction *saction)
static void draw_mesh_strips(SpaceAction *saction, Key *key)
{
/* draw the RVK keyframes as those little square button things
*/
/* draw the RVK keyframes */
rcti scr_rct;
gla2DDrawInfo *di;
float y, ybase;

View File

@@ -305,7 +305,6 @@ static void *get_nearest_actionchannel_key (float *selx, short *sel, short *ret_
float xmin, xmax, x, y;
float xrange[2];
int clickmin, clickmax;
int wsize;
short mval[2];
getmouseco_areawin (mval);
@@ -318,15 +317,8 @@ static void *get_nearest_actionchannel_key (float *selx, short *sel, short *ret_
return NULL;
}
/* wsize is the greatest possible height (in pixels) that would be
* needed to draw all of the action channels, ipo-curve channels and constraint
* channels.
*/
wsize = count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
wsize += CHANNELHEIGHT/2;
areamouseco_to_ipoco(G.v2d, mval, &x, &y);
clickmin = (int) ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmax = clickmin;
mval[0]-=7;
@@ -908,8 +900,7 @@ void borderselect_action(void)
rectf.xmax= get_action_frame(OBACT, rectf.xmax);
}
ymax = count_action_levels(act) * (CHANNELHEIGHT+CHANNELSKIP);
ymax += CHANNELHEIGHT/2;
ymax = CHANNELHEIGHT/2;
for (achan=act->chanbase.first; achan; achan= achan->next) {
if(VISIBLE_ACHAN(achan)) {
@@ -1865,7 +1856,6 @@ static void borderselect_actionchannels(bAction *act, short *mval,
IpoCurve *icu;
float click, x,y;
int clickmin, clickmax;
int wsize;
if (!act)
return;
@@ -1875,15 +1865,8 @@ static void borderselect_actionchannels(bAction *act, short *mval,
selectmode = SELECT_ADD;
}
/* wsize is the greatest possible height (in pixels) that would be
* needed to draw all of the action channels and constraint
* channels.
*/
wsize = count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
wsize += CHANNELHEIGHT/2;
areamouseco_to_ipoco(G.v2d, mval, &x, &y);
clickmin = (int) ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
/* Only one click */
if (mvalo == NULL) {
@@ -1892,7 +1875,7 @@ static void borderselect_actionchannels(bAction *act, short *mval,
/* Two click values (i.e., border select */
else {
areamouseco_to_ipoco(G.v2d, mvalo, &x, &y);
click = ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
click = (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
if ( ((int) click) < clickmin) {
clickmax = clickmin;
@@ -2781,7 +2764,6 @@ static void select_all_keys_channels(bAction *act, short *mval,
bConstraintChannel *conchan;
float click, x,y;
int clickmin, clickmax;
int wsize;
/* This function selects all the action keys that
* are in the mouse selection range defined by
@@ -2801,16 +2783,8 @@ static void select_all_keys_channels(bAction *act, short *mval,
selectmode = SELECT_ADD;
}
/* wsize is the greatest possible height (in pixels) that would be
* needed to draw all of the action channels and constraint
* channels.
*/
wsize = count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
wsize += CHANNELHEIGHT/2;
areamouseco_to_ipoco(G.v2d, mval, &x, &y);
clickmin = (int) ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
/* Only one click */
if (mvalo == NULL) {
@@ -2819,7 +2793,7 @@ static void select_all_keys_channels(bAction *act, short *mval,
/* Two click values (i.e., border select) */
else {
areamouseco_to_ipoco(G.v2d, mvalo, &x, &y);
click = ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
click = (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
if ( ((int) click) < clickmin) {
clickmax = clickmin;
@@ -3611,22 +3585,14 @@ void *get_nearest_act_channel(short mval[], short *ret_type)
float x,y;
int clickmin, clickmax;
int wsize;
if (act == NULL) {
*ret_type= ACTTYPE_NONE;
return NULL;
}
/* wsize is the greatest possible height (in pixels) that would be
* needed to draw all of the groups, action channels and constraint
* channels.
*/
wsize = count_action_levels(act)*(CHANNELHEIGHT+CHANNELSKIP);
wsize += CHANNELHEIGHT/2;
areamouseco_to_ipoco(G.v2d, mval, &x, &y);
clickmin = (int) ((wsize - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmin = (int) (((CHANNELHEIGHT/2) - y) / (CHANNELHEIGHT+CHANNELSKIP));
clickmax = clickmin;
if (clickmax < 0) {

View File

@@ -69,6 +69,7 @@
#include "BKE_main.h"
#include "BKE_utildefines.h"
#include "BDR_drawaction.h"
#include "BSE_drawipo.h"
#include "BSE_headerbuttons.h"
#include "BSE_time.h"
@@ -173,13 +174,16 @@ void do_action_buttons(unsigned short event)
G.v2d->cur.xmax= -5;
G.v2d->cur.xmax= 100;
}
G.v2d->cur.ymin= -(count_action_levels(G.saction->action)*(CHANNELHEIGHT+CHANNELSKIP));
G.v2d->cur.ymax= 0;
}
else { /* shapekeys and/or no action */
G.v2d->cur.xmax= -5;
G.v2d->cur.xmax= 100;
G.v2d->cur.ymax= 1000;
G.v2d->cur.ymin= 0;
}
G.v2d->cur.ymin= 0.0f;
G.v2d->cur.ymax= 1000.0f;
G.v2d->tot= G.v2d->cur;
test_view2d(G.v2d, curarea->winx, curarea->winy);