[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23680] branches/soc-2008-mxcurioni/source /blender: Corrected I/O crash: Freestyle configuration can be saved to/ loaded from file

Maxime Curioni maxime.curioni at gmail.com
Wed Oct 7 09:18:52 CEST 2009


Revision: 23680
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23680
Author:   mxcurioni
Date:     2009-10-07 09:18:50 +0200 (Wed, 07 Oct 2009)

Log Message:
-----------
Corrected I/O crash: Freestyle configuration can be saved to/loaded from file

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/scene.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c

Modified: branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/scene.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/scene.c	2009-10-07 07:11:10 UTC (rev 23679)
+++ branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/scene.c	2009-10-07 07:18:50 UTC (rev 23680)
@@ -240,7 +240,8 @@
 void free_scene(Scene *sce)
 {
 	Base *base;
-
+	SceneRenderLayer *srl;
+	
 	base= sce->base.first;
 	while(base) {
 		base->object->id.us--;
@@ -275,6 +276,10 @@
 		sce->r.ffcodecdata.properties = NULL;
 	}
 	
+	for(srl= sce->r.layers.first; srl; srl= srl->next) {
+		BLI_freelistN( &srl->freestyleConfig.modules);
+	}
+	
 	BLI_freelistN(&sce->markers);
 	BLI_freelistN(&sce->transform_spaces);
 	BLI_freelistN(&sce->r.layers);

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2009-10-07 07:11:10 UTC (rev 23679)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2009-10-07 07:18:50 UTC (rev 23680)
@@ -4235,6 +4235,7 @@
 	Editing *ed;
 	Sequence *seq;
 	MetaStack *ms;
+	SceneRenderLayer *srl;
 
 	sce->theDag = NULL;
 	sce->dagisvalid = 0;
@@ -4405,6 +4406,10 @@
 	link_list(fd, &(sce->transform_spaces));
 	link_list(fd, &(sce->r.layers));
 	
+	for(srl= sce->r.layers.first; srl; srl= srl->next) {
+		link_list(fd, &(srl->freestyleConfig.modules));
+	}
+	
 	sce->nodetree= newdataadr(fd, sce->nodetree);
 	if(sce->nodetree)
 		direct_link_nodetree(fd, sce->nodetree);

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c	2009-10-07 07:11:10 UTC (rev 23679)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c	2009-10-07 07:18:50 UTC (rev 23680)
@@ -1731,6 +1731,7 @@
 	TimeMarker *marker;
 	TransformOrientation *ts;
 	SceneRenderLayer *srl;
+	FreestyleModuleConfig *fmc;
 	ToolSettings *tos;
 	
 	sce= scebase->first;
@@ -1855,8 +1856,14 @@
 		for(ts = sce->transform_spaces.first; ts; ts = ts->next)
 			writestruct(wd, DATA, "TransformOrientation", 1, ts);
 		
-		for(srl= sce->r.layers.first; srl; srl= srl->next)
+		for(srl= sce->r.layers.first; srl; srl= srl->next) {
 			writestruct(wd, DATA, "SceneRenderLayer", 1, srl);
+			
+			for(fmc= srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
+				writestruct(wd, DATA, "FreestyleModuleConfig", 1, fmc);
+			}
+			
+		}
 		
 		if(sce->nodetree) {
 			writestruct(wd, DATA, "bNodeTree", 1, sce->nodetree);





More information about the Bf-blender-cvs mailing list