Merged changes in the trunk up to revision 26856.
[blender-staging.git] / source / blender / blenkernel / intern / scene.c
index fe97d892a743bcf5014f26f707e7ebb7df04f7ac..aeeae28e54c7d6d8aec86b3d29249dc7de9957f2 100644 (file)
@@ -95,6 +95,8 @@
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 
+#include "FRS_freestyle_config.h"
+
 //XXX #include "nla.h"
 
 #ifdef WIN32
@@ -244,7 +246,8 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type)
 void free_scene(Scene *sce)
 {
        Base *base;
-
+       SceneRenderLayer *srl;
+       
        base= sce->base.first;
        while(base) {
                base->object->id.us--;
@@ -284,6 +287,10 @@ void free_scene(Scene *sce)
                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);
@@ -955,6 +962,7 @@ void scene_add_render_layer(Scene *sce)
        srl->lay= (1<<20) -1;
        srl->layflag= 0x7FFF;   /* solid ztra halo edge strand */
        srl->passflag= SCE_PASS_COMBINED|SCE_PASS_Z;
+       FRS_add_freestyle_config( srl );
 }
 
 /* render simplification */