[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17065] trunk/blender/source/blender/src: Grease Pencil Bugfixes:

Joshua Leung aligorith at gmail.com
Tue Oct 14 11:36:08 CEST 2008


Revision: 17065
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17065
Author:   aligorith
Date:     2008-10-14 11:36:08 +0200 (Tue, 14 Oct 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawgpencil.c
    trunk/blender/source/blender/src/editaction.c

Modified: trunk/blender/source/blender/src/drawgpencil.c
===================================================================
--- trunk/blender/source/blender/src/drawgpencil.c	2008-10-14 06:14:25 UTC (rev 17064)
+++ trunk/blender/source/blender/src/drawgpencil.c	2008-10-14 09:36:08 UTC (rev 17065)
@@ -801,14 +801,15 @@
 			/* 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 @@
 				}
 				
 				/* 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 

Modified: trunk/blender/source/blender/src/editaction.c
===================================================================
--- trunk/blender/source/blender/src/editaction.c	2008-10-14 06:14:25 UTC (rev 17064)
+++ trunk/blender/source/blender/src/editaction.c	2008-10-14 09:36:08 UTC (rev 17065)
@@ -803,6 +803,14 @@
 				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);





More information about the Bf-blender-cvs mailing list