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:
authorCampbell Barton <ideasman42@gmail.com>2011-04-12 14:13:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-12 14:13:09 +0400
commit618690b05eff11ffccb92e3667368d4fd6a590d7 (patch)
tree00349fbaebd3b38668818ed4804c49dc8d72caac /source/blender/editors/gpencil
parent8937d4f9e5adad4f7b860350fbaa45a22ab75e04 (diff)
modify the method for calculating ghost alpha.
* ghost frame 1 did nothing (alpha 0.0). * was subtracting alpha from the existing alpha which could end up with negative alpha. * with larger frame ranges the frames on each size would get too close to being the same as the active frames alpha, use 66% alpha for all non-active frames as well as time based falloff.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 7abdb1f8f07..74e7cae93f5 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -601,8 +601,8 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* check if frame is drawable */
if ((gpf->framenum - gf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
- fac= (float)(gpf->framenum - gf->framenum) / (float)gpl->gstep;
- tcolor[3] = color[3] - fac;
+ fac= 1.0f - ((float)(gpf->framenum - gf->framenum) / (float)(gpl->gstep + 1));
+ tcolor[3] = color[3] * fac * 0.66f;
gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else
@@ -614,8 +614,8 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* check if frame is drawable */
if ((gf->framenum - gpf->framenum) <= gpl->gstep) {
/* alpha decreases with distance from curframe index */
- fac= (float)(gf->framenum - gpf->framenum) / (float)gpl->gstep;
- tcolor[3] = color[3] - fac;
+ fac= 1.0f - ((float)(gf->framenum - gpf->framenum) / (float)(gpl->gstep + 1));
+ tcolor[3] = color[3] * fac * 0.66f;
gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor);
}
else