Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/layer.c
| Show All 27 Lines | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | #include "BLI_string_utf8.h" | ||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_freestyle.h" | |||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "DNA_ID.h" | #include "DNA_ID.h" | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
| SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name) | SceneLayer *BKE_scene_layer_add(Scene *scene, const char *name) | ||||
| { | { | ||||
| if (!name) { | if (!name) { | ||||
| name = DATA_("Render Layer"); | name = DATA_("Render Layer"); | ||||
| } | } | ||||
| IDPropertyTemplate val = {0}; | IDPropertyTemplate val = {0}; | ||||
| SceneLayer *sl = MEM_callocN(sizeof(SceneLayer), "Scene Layer"); | 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); | sl->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); | ||||
| layer_engine_settings_init(sl->properties, false); | layer_engine_settings_init(sl->properties, false); | ||||
| BLI_addtail(&scene->render_layers, sl); | BLI_addtail(&scene->render_layers, sl); | ||||
| /* unique name */ | /* unique name */ | ||||
| BLI_strncpy_utf8(sl->name, name, sizeof(sl->name)); | BLI_strncpy_utf8(sl->name, name, sizeof(sl->name)); | ||||
| BLI_uniquename(&scene->render_layers, sl, DATA_("SceneLayer"), '.', offsetof(SceneLayer, name), sizeof(sl->name)); | BLI_uniquename(&scene->render_layers, sl, DATA_("SceneLayer"), '.', offsetof(SceneLayer, name), sizeof(sl->name)); | ||||
| SceneCollection *sc = BKE_collection_master(scene); | SceneCollection *sc = BKE_collection_master(scene); | ||||
| layer_collection_add(sl, NULL, sc); | 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; | return sl; | ||||
| } | } | ||||
| /** | /** | ||||
| * Free (or release) any data used by this SceneLayer. | * Free (or release) any data used by this SceneLayer. | ||||
| */ | */ | ||||
| void BKE_scene_layer_free(SceneLayer *sl) | void BKE_scene_layer_free(SceneLayer *sl) | ||||
| { | { | ||||
| Show All 29 Lines | if (sled->storage) { | ||||
| } | } | ||||
| MEM_freeN(sled->storage); | MEM_freeN(sled->storage); | ||||
| } | } | ||||
| } | } | ||||
| BLI_freelistN(&sl->drawdata); | BLI_freelistN(&sl->drawdata); | ||||
| MEM_SAFE_FREE(sl->stats); | 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); | MEM_freeN(sl); | ||||
| } | } | ||||
| /** | /** | ||||
| * Tag all the selected objects of a renderlayer | * Tag all the selected objects of a renderlayer | ||||
| */ | */ | ||||
| void BKE_scene_layer_selected_objects_tag(SceneLayer *sl, const int tag) | void BKE_scene_layer_selected_objects_tag(SceneLayer *sl, const int tag) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 872 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* ---------------------------------------------------------------------- */ | /* ---------------------------------------------------------------------- */ | ||||
| /* Override */ | /* Override */ | ||||
| /** | /** | ||||
| * Add a new datablock override | * Add a new datablock override | ||||
| */ | */ | ||||
| void BKE_collection_override_datablock_add(LayerCollection *UNUSED(lc), const char *UNUSED(data_path), ID *UNUSED(id)) | void BKE_override_scene_layer_datablock_add(SceneLayer *scene_layer, int id_type, const char *data_path, const ID *id) | ||||
| { | |||||
| UNUSED_VARS(scene_layer, id_type, data_path, id); | |||||
| TODO_LAYER_OVERRIDE; | |||||
| } | |||||
| /** | |||||
| * Add a new int override | |||||
| */ | |||||
| void BKE_override_scene_layer_int_add(SceneLayer *scene_layer, int id_type, const char *data_path, const int value) | |||||
| { | |||||
| UNUSED_VARS(scene_layer, id_type, data_path, value); | |||||
| TODO_LAYER_OVERRIDE; | |||||
| } | |||||
| /** | |||||
| * Add a new boolean override | |||||
| */ | |||||
| void BKE_override_layer_collection_boolean_add(struct LayerCollection *layer_collection, int id_type, const char *data_path, const bool value) | |||||
| { | { | ||||
| UNUSED_VARS(layer_collection, id_type, data_path, value); | |||||
| TODO_LAYER_OVERRIDE; | TODO_LAYER_OVERRIDE; | ||||
| } | } | ||||
| /* ---------------------------------------------------------------------- */ | /* ---------------------------------------------------------------------- */ | ||||
| /* Engine Settings */ | /* Engine Settings */ | ||||
| ListBase R_layer_collection_engines_settings_callbacks = {NULL, NULL}; | ListBase R_layer_collection_engines_settings_callbacks = {NULL, NULL}; | ||||
| ListBase R_scene_layer_engines_settings_callbacks = {NULL, NULL}; | ListBase R_scene_layer_engines_settings_callbacks = {NULL, NULL}; | ||||
| ▲ Show 20 Lines • Show All 913 Lines • Show Last 20 Lines | |||||