[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40374] branches/soc-2008-mxcurioni/source /blender/blenloader/intern/readfile.c: Fix for default values in Freestyle settings.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Tue Sep 20 00:49:02 CEST 2011


Revision: 40374
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40374
Author:   kjym3
Date:     2011-09-19 22:49:01 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Fix for default values in Freestyle settings.  Now some Freestyle options with
invalid values are fixed when .blend files are loaded.  This will be necessary
after the branch has been merged into the trunk, so that old .blend file dated
before the merge are properly initialized for Freestyle to work.

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

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2011-09-19 22:40:44 UTC (rev 40373)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2011-09-19 22:49:01 UTC (rev 40374)
@@ -12264,6 +12264,28 @@
 				sce->gm.recastData.detailsamplemaxerror = 1.0f;
 		}			
 	}
+
+	/* default values in Freestyle settings */
+	{
+		Scene *sce;
+		SceneRenderLayer *srl;
+		FreestyleLineStyle *linestyle;
+
+		for(sce = main->scene.first; sce; sce = sce->id.next) {
+			for(srl= sce->r.layers.first; srl; srl= srl->next) {
+				if (srl->freestyleConfig.mode == 0)
+					srl->freestyleConfig.mode= FREESTYLE_CONTROL_EDITOR_MODE;
+				if (srl->freestyleConfig.raycasting_algorithm == 0)
+					srl->freestyleConfig.raycasting_algorithm= FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE;
+			}
+		}
+		for(linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+			if (linestyle->chaining == 0)
+				linestyle->chaining= LS_CHAINING_NATURAL;
+			if (linestyle->rounds == 0)
+				linestyle->rounds= 3;
+		}
+	}
 	
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
 	/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */




More information about the Bf-blender-cvs mailing list