Merged changes in the trunk up to revision 52815.
[blender-staging.git] / source / blender / blenkernel / intern / scene.c
index 9bb2fb2de5234970d06821fb731101da7d60d14d..d0af06d9f90d68c3125076fae1074a5a5cc95b63 100644 (file)
@@ -85,6 +85,8 @@
 //XXX #include "BIF_previewrender.h"
 //XXX #include "BIF_editseq.h"
 
+#include "FRS_freestyle_config.h"
+
 #ifdef WIN32
 #else
 #include <sys/time.h>
@@ -285,7 +287,8 @@ Scene *BKE_scene_copy(Scene *sce, int type)
 void BKE_scene_free(Scene *sce)
 {
        Base *base;
-
+       SceneRenderLayer *srl;
+       
        base = sce->base.first;
        while (base) {
                base->object->id.us--;
@@ -325,6 +328,10 @@ void BKE_scene_free(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);
@@ -1177,6 +1184,7 @@ SceneRenderLayer *BKE_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;
 }