Merged changes in the trunk up to revision 42116.
[blender.git] / source / blender / blenkernel / intern / scene.c
index b7aa02b2f7bce02567fff0a6752a64f4c096895a..33fb15faa56c1bda15e5505519284745e0abbadc 100644 (file)
@@ -78,6 +78,8 @@
 //XXX #include "BIF_previewrender.h"
 //XXX #include "BIF_editseq.h"
 
+#include "FRS_freestyle_config.h"
+
 //XXX #include "nla.h"
 
 #ifdef WIN32
@@ -242,7 +244,8 @@ Scene *copy_scene(Scene *sce, int type)
 void free_scene(Scene *sce)
 {
        Base *base;
-
+       SceneRenderLayer *srl;
+       
        base= sce->base.first;
        while(base) {
                base->object->id.us--;
@@ -282,6 +285,10 @@ void free_scene(Scene *sce)
                sce->r.ffcodecdata.properties = NULL;
        }
        
+       for(srl= sce->r.layers.first; srl; srl= srl->next) {
+               FRS_free_freestyle_config(srl);
+       }
+       
        BLI_freelistN(&sce->markers);
        BLI_freelistN(&sce->transform_spaces);
        BLI_freelistN(&sce->r.layers);
@@ -1105,6 +1112,7 @@ SceneRenderLayer *scene_add_render_layer(Scene *sce, const char *name)
        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 );
 
        return srl;
 }