diff options
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 59da7c84b45..39938f819ef 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -33,6 +33,7 @@ #include "BLT_translation.h" #include "BKE_collection.h" +#include "BKE_freestyle.h" #include "BKE_global.h" #include "BKE_idprop.h" #include "BKE_layer.h" @@ -113,7 +114,7 @@ SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name) IDPropertyTemplate val = {0}; SceneLayer *sl = MEM_callocN(sizeof(SceneLayer), "Scene Layer"); - sl->flag |= SCENE_LAYER_RENDER; + sl->flag = SCENE_LAYER_RENDER | SCENE_LAYER_FREESTYLE; sl->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); layer_engine_settings_init(sl->properties, false); @@ -127,6 +128,12 @@ SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name) SceneCollection *sc = BKE_collection_master(scene); layer_collection_add(sl, NULL, sc); + /* Pure rendering pipeline settings. */ + sl->layflag = 0x7FFF; /* solid ztra halo edge strand */ + sl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z; + sl->pass_alpha_threshold = 0.5f; + BKE_freestyle_config_init(&sl->freestyle_config); + return sl; } @@ -172,6 +179,13 @@ void BKE_scene_layer_free(SceneLayer *sl) MEM_SAFE_FREE(sl->stats); + BKE_freestyle_config_free(&sl->freestyle_config); + + if (sl->id_properties) { + IDP_FreeProperty(sl->id_properties); + MEM_freeN(sl->id_properties); + } + MEM_freeN(sl); } |