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
diff options
context:
space:
mode:
-rw-r--r--source/blender/include/BDR_drawaction.h1
-rw-r--r--source/blender/src/drawaction.c53
-rw-r--r--source/blender/src/editaction.c13
-rw-r--r--source/blender/src/header_action.c12
4 files changed, 23 insertions, 56 deletions
diff --git a/source/blender/include/BDR_drawaction.h b/source/blender/include/BDR_drawaction.h
index 821d8ea6b79..673b13672c1 100644
--- a/source/blender/include/BDR_drawaction.h
+++ b/source/blender/include/BDR_drawaction.h
@@ -71,7 +71,6 @@ typedef struct ActKeyBlock {
/* Action Generics */
void draw_cfra_action(void);
-int count_action_levels (struct bAction *act);
/* Channel Drawing */
void draw_icu_channel(struct gla2DDrawInfo *di, struct IpoCurve *icu, float ypos);
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 4a85f062f11..57ef51702bd 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -100,7 +100,7 @@ static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
{
int i;
char str[64];
- float x, y;
+ float x, y;
uiBlock *block;
uiBut *but;
@@ -116,16 +116,15 @@ static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
myortho2(-0.375, curarea->winx-0.375, G.v2d->cur.ymin, G.v2d->cur.ymax);
sprintf(str, "actionbuttonswin %d", curarea->win);
- block= uiNewBlock (&curarea->uiblocks, str,
- UI_EMBOSS, UI_HELV, curarea->win);
+ block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS, UI_HELV, curarea->win);
x = NAMEWIDTH + 1;
- y = CHANNELHEIGHT/2;
+ y = 0.0f;
/* make the little 'open the sliders' widget */
- BIF_ThemeColor(TH_FACE); // this slot was open...
- glRects(2, y + 2*CHANNELHEIGHT - 2,
- ACTWIDTH - 2, y + CHANNELHEIGHT + 2);
+ // should eventually be removed
+ BIF_ThemeColor(TH_FACE); // this slot was open... (???... Aligorith)
+ glRects(2, y + 2*CHANNELHEIGHT - 2, ACTWIDTH - 2, y + CHANNELHEIGHT + 2);
glColor3ub(0, 0, 0);
glRasterPos2f(4, y + CHANNELHEIGHT + 6);
BMF_DrawString(G.font, "Sliders");
@@ -283,7 +282,7 @@ static void action_icu_buts(SpaceAction *saction)
UI_EMBOSS, UI_HELV, curarea->win);
x = NAMEWIDTH + 1;
- y = 0.0;
+ y = 0.0f;
uiBlockSetEmboss(block, UI_EMBOSSN);
@@ -592,30 +591,10 @@ static void draw_channel_names(void)
/* free tempolary channels */
BLI_freelistN(&act_data);
- /* re-adjust view matrices for correct scaling*/
+ /* re-adjust view matrices for correct scaling */
myortho2(0, NAMEWIDTH, 0, (ofsy+G.v2d->mask.ymax) - (ofsy+G.v2d->mask.ymin)); // Scaling
}
-/* this function could soon be depreceated... */
-int count_action_levels(bAction *act)
-{
- ListBase act_data = {NULL, NULL};
- int filter, y=0;
-
- /* check for invalid action */
- if (act == NULL)
- return 0;
-
- /* build list of channels to count */
- filter= (ACTFILTER_VISIBLE|ACTFILTER_CHANNELS);
- actdata_filter(&act_data, filter, act, ACTCONT_ACTION);
-
- /* count and free data */
- y = BLI_countlist(&act_data);
- BLI_freelistN(&act_data);
- return y;
-}
-
/* sets or clears hidden flags */
void check_action_context(SpaceAction *saction)
{
@@ -843,10 +822,8 @@ void drawactionspace(ScrArea *sa, void *spacedata)
void *data;
short datatype;
-
short ofsx = 0, ofsy = 0;
float col[3];
- short maxymin;
if (!G.saction)
return;
@@ -868,19 +845,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
act = data;
else if (datatype == ACTCONT_SHAPEKEY)
key = data;
-
- /* Damn I hate hunting to find my rvk's because
- * they have scrolled off of the screen ... this
- * oughta fix it
- */
- if (key) {
- if (G.v2d->cur.ymin < -CHANNELHEIGHT)
- G.v2d->cur.ymin = -CHANNELHEIGHT;
-
- maxymin = -(key->totkey*(CHANNELHEIGHT+CHANNELSKIP));
- if (G.v2d->cur.ymin > maxymin) G.v2d->cur.ymin = maxymin;
- }
-
+
/* Lets make sure the width of the left hand of the screen
* is set to an appropriate value based on whether sliders
* are showing of not
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index e204893413b..77f53a4e522 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -637,7 +637,7 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b
}
/* filter data */
- filter= (ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
+ filter= (ACTFILTER_FORDRAWING | ACTFILTER_VISIBLE | ACTFILTER_CHANNELS);
actdata_filter(&act_data, filter, data, datatype);
for (ale= act_data.first; ale; ale= ale->next) {
@@ -645,7 +645,6 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b
break;
if (clickmin <= 0) {
/* found match */
- *ret_type= ale->type;
/* make list of keyframes */
if (ale->key_data) {
@@ -678,9 +677,15 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b
*selx= ((xmax+xmin) / 2);
/* figure out what to return */
- if (datatype == ACTCONT_ACTION)
+ if (datatype == ACTCONT_ACTION) {
*par= ale->owner; /* assume that this is an action channel */
- data = ale->data;
+ *ret_type= ale->type;
+ data = ale->data;
+ }
+ else if (datatype == ACTCONT_SHAPEKEY) {
+ data = ale->key_data;
+ *ret_type= ACTTYPE_ICU;
+ }
/* cleanup tempolary lists */
BLI_freelistN(&act_keys);
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 340a8008883..d39bd004eac 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -171,17 +171,15 @@ 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.xmin= -5.0;
+ G.v2d->cur.xmax= 65.0;
}
+ G.v2d->cur.ymin= -75.0;
+ G.v2d->cur.ymax= 5.0;
+
G.v2d->tot= G.v2d->cur;
test_view2d(G.v2d, curarea->winx, curarea->winy);
view2d_do_locks(curarea, V2D_LOCK_COPY);