[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34409] trunk/blender/source/blender/ blenloader/intern/writefile.c: Bugfix [#25721] Unable to delete grease pencil data blocks

Joshua Leung aligorith at gmail.com
Wed Jan 19 23:49:11 CET 2011


Revision: 34409
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34409
Author:   aligorith
Date:     2011-01-19 22:49:09 +0000 (Wed, 19 Jan 2011)
Log Message:
-----------
Bugfix [#25721] Unable to delete grease pencil data blocks

Missing check for id-block users before saving

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/writefile.c

Modified: trunk/blender/source/blender/blenloader/intern/writefile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/writefile.c	2011-01-19 22:23:59 UTC (rev 34408)
+++ trunk/blender/source/blender/blenloader/intern/writefile.c	2011-01-19 22:49:09 UTC (rev 34409)
@@ -1948,21 +1948,23 @@
 	bGPDstroke *gps;
 	
 	for (gpd= lb->first; gpd; gpd= gpd->id.next) {
-		/* write gpd data block to file */
-		writestruct(wd, ID_GD, "bGPdata", 1, gpd);
-		
-		/* write grease-pencil layers to file */
-		for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
-			writestruct(wd, DATA, "bGPDlayer", 1, gpl);
+		if (gpd->id.us>0 || wd->current) {
+			/* write gpd data block to file */
+			writestruct(wd, ID_GD, "bGPdata", 1, gpd);
 			
-			/* write this layer's frames to file */
-			for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
-				writestruct(wd, DATA, "bGPDframe", 1, gpf);
+			/* write grease-pencil layers to file */
+			for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+				writestruct(wd, DATA, "bGPDlayer", 1, gpl);
 				
-				/* write strokes */
-				for (gps= gpf->strokes.first; gps; gps= gps->next) {
-					writestruct(wd, DATA, "bGPDstroke", 1, gps);
-					writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);				
+				/* write this layer's frames to file */
+				for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
+					writestruct(wd, DATA, "bGPDframe", 1, gpf);
+					
+					/* write strokes */
+					for (gps= gpf->strokes.first; gps; gps= gps->next) {
+						writestruct(wd, DATA, "bGPDstroke", 1, gps);
+						writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);				
+					}
 				}
 			}
 		}




More information about the Bf-blender-cvs mailing list