[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36108] trunk/blender/source/blender/ editors/gpencil/drawgpencil.c: modify the method for calculating ghost alpha.
Campbell Barton
ideasman42 at gmail.com
Tue Apr 12 12:13:10 CEST 2011
Revision: 36108
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36108
Author: campbellbarton
Date: 2011-04-12 10:13:09 +0000 (Tue, 12 Apr 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/editors/gpencil/drawgpencil.c
Modified: trunk/blender/source/blender/editors/gpencil/drawgpencil.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/drawgpencil.c 2011-04-12 08:41:26 UTC (rev 36107)
+++ trunk/blender/source/blender/editors/gpencil/drawgpencil.c 2011-04-12 10:13:09 UTC (rev 36108)
@@ -601,8 +601,8 @@
/* 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 @@
/* 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
More information about the Bf-blender-cvs
mailing list