Merged changes in the trunk up to revision 53280.
[blender.git] / source / blender / blenkernel / intern / scene.c
index baf2e7e47e3a6f33abcd301dee425bafe5f64ccb..538f21ce20b0f53e2a96e680c2bc6a6923ec727a 100644 (file)
 //XXX #include "BIF_previewrender.h"
 //XXX #include "BIF_editseq.h"
 
+#ifdef WITH_FREESTYLE
+#  include "FRS_freestyle_config.h"
+#endif
+
 #ifdef WIN32
 #else
 #include <sys/time.h>
@@ -326,6 +330,16 @@ void BKE_scene_free(Scene *sce)
                sce->r.ffcodecdata.properties = NULL;
        }
        
+#ifdef WITH_FREESTYLE
+       {
+               SceneRenderLayer *srl;
+
+               for (srl = sce->r.layers.first; srl; srl = srl->next) {
+                       FRS_free_freestyle_config(srl);
+               }
+       }
+#endif
+       
        BLI_freelistN(&sce->markers);
        BLI_freelistN(&sce->transform_spaces);
        BLI_freelistN(&sce->r.layers);
@@ -1184,6 +1198,9 @@ 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;
+#ifdef WITH_FREESTYLE
+       FRS_add_freestyle_config(srl);
+#endif
 
        return srl;
 }