Grease Pencil Bugfixes:

* Onion-skinning with GStep > 0 was not showing enough of a noticable difference between ghosts. Improved method of calculating this.

* Clicking in a Grease-Pencil datablock channel in the Action Editor would crash
This commit is contained in:
Joshua Leung
2008-10-14 09:36:08 +00:00
parent c515395067
commit 8fa76a3c43
2 changed files with 15 additions and 5 deletions

View File

@@ -801,14 +801,15 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* drawing method - only immediately surrounding (gstep = 0), or within a frame range on either side (gstep > 0)*/
if (gpl->gstep) {
bGPDframe *gf;
short i;
float fac;
/* draw previous frames first */
for (gf=gpf->prev, i=0; gf; gf=gf->prev, i++) {
for (gf=gpf->prev; gf; gf=gf->prev) {
/* check if frame is drawable */
if ((gpf->framenum - gf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
tcolor[3] = color[3] - (i/gpl->gstep);
fac= (float)(gpf->framenum - gf->framenum) / (float)gpl->gstep;
tcolor[3] = color[3] - fac;
gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else
@@ -816,11 +817,12 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
}
/* now draw next frames */
for (gf= gpf->next, i=0; gf; gf=gf->next, i++) {
for (gf= gpf->next; gf; gf=gf->next) {
/* check if frame is drawable */
if ((gf->framenum - gpf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
tcolor[3] = color[3] - (i/gpl->gstep);
fac= (float)(gf->framenum - gpf->framenum) / (float)gpl->gstep;
tcolor[3] = color[3] - fac;
gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else

View File

@@ -803,6 +803,14 @@ static void *get_nearest_action_key (float *selx, short *sel, short *ret_type, b
bActionGroup *agrp= (bActionGroup *)ale->data;
agroup_to_keylist(agrp, &act_keys, NULL, NULL);
}
else if (ale->type == ACTTYPE_GPDATABLOCK) {
/* cleanup */
BLI_freelistN(&act_data);
/* this channel currently doens't have any keyframes... must ignore! */
*ret_type= ACTTYPE_NONE;
return NULL;
}
else if (ale->type == ACTTYPE_GPLAYER) {
bGPDlayer *gpl= (bGPDlayer *)ale->data;
gpl_to_keylist(gpl, &act_keys, NULL, NULL);