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
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-10-14 13:36:08 +0400
committerJoshua Leung <aligorith@gmail.com>2008-10-14 13:36:08 +0400
commit8fa76a3c43922815fe33973836ddf4da9450fc92 (patch)
tree7858ac32638c3cb41f0822d5fc0e27f3a59c2f12 /source
parentc51539506798fdf3f98337f03bdc018c70a5b845 (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/drawgpencil.c12
-rw-r--r--source/blender/src/editaction.c8
2 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/src/drawgpencil.c b/source/blender/src/drawgpencil.c
index 5f9df666c67..9c12871aa54 100644
--- a/source/blender/src/drawgpencil.c
+++ b/source/blender/src/drawgpencil.c
@@ -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
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index d10f354ed7a..4d3e9c236ca 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -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);