Merged changes in the trunk up to revision 54802.
[blender.git] / source / blender / blenkernel / intern / scene.c
index 9a1a146c2710664864624ec13ea4bb5b605662a2..e1e4563e89f873d1b3221ebb2fd95de04fe7c52d 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>
@@ -207,6 +211,18 @@ Scene *BKE_scene_copy(Scene *sce, int type)
                /* remove animation used by sequencer */
                if (type != SCE_COPY_FULL)
                        remove_sequencer_fcurves(scen);
+
+#ifdef WITH_FREESTYLE
+               {
+                       SceneRenderLayer *srl, *new_srl;
+
+                       new_srl = scen->r.layers.first;
+                       for (srl = sce->r.layers.first; srl; srl = srl->next) {
+                               FRS_copy_freestyle_config(&new_srl->freestyleConfig, &srl->freestyleConfig);
+                               new_srl = new_srl->next;
+                       }
+               }
+#endif
        }
 
        /* tool settings */
@@ -332,6 +348,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->freestyleConfig);
+               }
+       }
+#endif
+       
        BLI_freelistN(&sce->markers);
        BLI_freelistN(&sce->transform_spaces);
        BLI_freelistN(&sce->r.layers);
@@ -1272,6 +1298,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_init_freestyle_config(&srl->freestyleConfig);
+#endif
 
        return srl;
 }