Merged changes in the trunk up to revision 48893.
[blender-staging.git] / source / blender / blenkernel / intern / scene.c
index d9afd1eefb48edd2865130cf376721caea9fab51..4a5267be7b36c0f84bb2e68a5017015ea73b0ef2 100644 (file)
@@ -79,6 +79,8 @@
 //XXX #include "BIF_previewrender.h"
 //XXX #include "BIF_editseq.h"
 
+#include "FRS_freestyle_config.h"
+
 #ifdef WIN32
 #else
 #include <sys/time.h>
@@ -248,7 +250,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--;
@@ -288,6 +291,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);
@@ -1117,6 +1124,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;
 }