Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-05-16 22:40:05 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-05-17 00:13:28 +0300
commite51bf11b15cb2c26b2bd33c377e1eb74fa8bde38 (patch)
tree0772e04362ca16c1511ccc48517e50e061187f22 /source/blender/makesrna/intern/rna_layer.c
parent09e419fa8da930b13651997417a434de308e697d (diff)
Remove ViewLayer settings - cleanup 1/2
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c267
1 files changed, 0 insertions, 267 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index 8b3d59cf95c..e6e90f4f05d 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -247,201 +247,8 @@ static void rna_SceneCollection_object_unlink(
WM_main_add_notifier(NC_SCENE | ND_LAYER | ND_OB_ACTIVE, scene);
}
-/****** layer collection engine settings *******/
-
-#define RNA_LAYER_ENGINE_GET_SET(_TYPE_, _ENGINE_, _NAME_) \
-static _TYPE_ rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_get(PointerRNA *ptr) \
-{ \
- IDProperty *props = (IDProperty *)ptr->data; \
- return BKE_collection_engine_property_value_get_##_TYPE_(props, #_NAME_); \
-} \
- \
-static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, _TYPE_ value) \
-{ \
- IDProperty *props = (IDProperty *)ptr->data; \
- BKE_collection_engine_property_value_set_##_TYPE_(props, #_NAME_, value); \
-}
-
-#define RNA_LAYER_ENGINE_GET_SET_ARRAY(_TYPE_, _ENGINE_, _NAME_, _LEN_) \
-static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_get(PointerRNA *ptr, _TYPE_ *values) \
-{ \
- IDProperty *props = (IDProperty *)ptr->data; \
- IDProperty *idprop = IDP_GetPropertyFromGroup(props, #_NAME_); \
- if (idprop != NULL) { \
- memcpy(values, IDP_Array(idprop), sizeof(_TYPE_) * idprop->len); \
- } \
-} \
- \
-static void rna_LayerEngineSettings_##_ENGINE_##_##_NAME_##_set(PointerRNA *ptr, const _TYPE_ *values) \
-{ \
- IDProperty *props = (IDProperty *)ptr->data; \
- BKE_collection_engine_property_value_set_##_TYPE_##_array(props, #_NAME_, values); \
-}
-
-#undef RNA_LAYER_ENGINE_GET_SET
-
-static void UNUSED_FUNCTION(rna_ViewLayerEngineSettings_update)(bContext *C, PointerRNA *UNUSED(ptr))
-{
- Scene *scene = CTX_data_scene(C);
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(&scene->id, 0);
-}
-
-static void UNUSED_FUNCTION(rna_LayerCollectionEngineSettings_update)(bContext *UNUSED(C), PointerRNA *ptr)
-{
- ID *id = ptr->id.data;
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(id, 0);
-
- /* Instead of passing 'noteflag' to the rna update function, we handle the notifier ourselves.
- * We need to do this because the LayerCollection may be coming from different ID types (Scene or Group)
- * and when using NC_SCENE the id most match the active scene for the listener to receive the notification.*/
-
- WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL);
-}
-
/***********************************/
-static void engine_settings_use(IDProperty *root, IDProperty *props, PointerRNA *props_ptr, const char *identifier)
-{
- PropertyRNA *prop = RNA_struct_find_property(props_ptr, identifier);
-
- switch (RNA_property_type(prop)) {
- case PROP_FLOAT:
- {
- float value = BKE_collection_engine_property_value_get_float(props, identifier);
- BKE_collection_engine_property_add_float(root, identifier, value);
- break;
- }
- case PROP_ENUM:
- {
- int value = BKE_collection_engine_property_value_get_int(props, identifier);
- BKE_collection_engine_property_add_int(root, identifier, value);
- break;
- }
- case PROP_INT:
- {
- int value = BKE_collection_engine_property_value_get_int(props, identifier);
- BKE_collection_engine_property_add_int(root, identifier, value);
- break;
- }
- case PROP_BOOLEAN:
- {
- int value = BKE_collection_engine_property_value_get_int(props, identifier);
- BKE_collection_engine_property_add_bool(root, identifier, value);
- break;
- }
- case PROP_STRING:
- case PROP_POINTER:
- case PROP_COLLECTION:
- default:
- break;
- }
-}
-
-static StructRNA *rna_ViewLayerSettings_refine(PointerRNA *ptr)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- BLI_assert(props && props->type == IDP_GROUP);
-
- switch (props->subtype) {
- case IDP_GROUP_SUB_ENGINE_RENDER:
- break;
- default:
- BLI_assert(!"Mode not fully implemented");
- break;
- }
-
- return &RNA_ViewLayerSettings;
-}
-
-static void rna_ViewLayerSettings_name_get(PointerRNA *ptr, char *value)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- strcpy(value, props->name);
-}
-
-static int rna_ViewLayerSettings_name_length(PointerRNA *ptr)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- return strnlen(props->name, sizeof(props->name));
-}
-
-static void rna_ViewLayerSettings_use(ID *id, IDProperty *props, const char *identifier)
-{
- Scene *scene = (Scene *)id;
- PointerRNA scene_props_ptr;
- IDProperty *scene_props;
-
- scene_props = BKE_view_layer_engine_scene_get(scene, props->name);
- RNA_pointer_create(id, &RNA_ViewLayerSettings, scene_props, &scene_props_ptr);
-
- engine_settings_use(props, scene_props, &scene_props_ptr, identifier);
-
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(id, 0);
-}
-
-static void rna_ViewLayerSettings_unuse(ID *id, IDProperty *props, const char *identifier)
-{
- IDProperty *prop_to_remove = IDP_GetPropertyFromGroup(props, identifier);
- IDP_FreeFromGroup(props, prop_to_remove);
-
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(id, 0);
-}
-
-static StructRNA *rna_LayerCollectionSettings_refine(PointerRNA *ptr)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- BLI_assert(props && props->type == IDP_GROUP);
-
- switch (props->subtype) {
- case IDP_GROUP_SUB_ENGINE_RENDER:
- break;
- default:
- BLI_assert(!"Mode not fully implemented");
- break;
- }
-
- return &RNA_LayerCollectionSettings;
-}
-
-static void rna_LayerCollectionSettings_name_get(PointerRNA *ptr, char *value)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- strcpy(value, props->name);
-}
-
-static int rna_LayerCollectionSettings_name_length(PointerRNA *ptr)
-{
- IDProperty *props = (IDProperty *)ptr->data;
- return strnlen(props->name, sizeof(props->name));
-}
-
-static void rna_LayerCollectionSettings_use(ID *id, IDProperty *props, const char *identifier)
-{
- Scene *scene = (Scene *)id;
- PointerRNA scene_props_ptr;
- IDProperty *scene_props;
-
- scene_props = BKE_layer_collection_engine_scene_get(scene, props->name);
- RNA_pointer_create(id, &RNA_LayerCollectionSettings, scene_props, &scene_props_ptr);
- engine_settings_use(props, scene_props, &scene_props_ptr, identifier);
-
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(id, 0);
-}
-
-static void rna_LayerCollectionSettings_unuse(ID *id, IDProperty *props, const char *identifier)
-{
- IDProperty *prop_to_remove = IDP_GetPropertyFromGroup(props, identifier);
- IDP_FreeFromGroup(props, prop_to_remove);
-
- /* TODO(sergey): Use proper flag for tagging here. */
- DEG_id_tag_update(id, 0);
-}
-
static void rna_LayerCollection_name_get(PointerRNA *ptr, char *value)
{
SceneCollection *sc = ((LayerCollection *)ptr->data)->scene_collection;
@@ -857,78 +664,6 @@ static void rna_def_scene_collection(BlenderRNA *brna)
RNA_def_function_return(func, parm);
}
-static void rna_def_view_layer_settings(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
- FunctionRNA *func;
- PropertyRNA *parm;
-
- srna = RNA_def_struct(brna, "ViewLayerSettings", NULL);
- RNA_def_struct_sdna(srna, "IDProperty");
- RNA_def_struct_ui_text(srna, "Scene Layer Settings",
- "Engine specific settings that can be overriden by ViewLayer");
- RNA_def_struct_refine_func(srna, "rna_ViewLayerSettings_refine");
-
- RNA_define_verify_sdna(0);
-
- prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_ViewLayerSettings_name_get", "rna_ViewLayerSettings_name_length", NULL);
- RNA_def_property_ui_text(prop, "Name", "Engine Name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_struct_name_property(srna, prop);
-
- func = RNA_def_function(srna, "use", "rna_ViewLayerSettings_use");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID);
- RNA_def_function_ui_description(func, "Initialize this property to use");
- parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to set");
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-
- func = RNA_def_function(srna, "unuse", "rna_ViewLayerSettings_unuse");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID);
- RNA_def_function_ui_description(func, "Remove the property");
- parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to unset");
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-
- RNA_define_verify_sdna(1);
-}
-
-static void rna_def_layer_collection_settings(BlenderRNA *brna)
-{
- StructRNA *srna;
- PropertyRNA *prop;
- FunctionRNA *func;
- PropertyRNA *parm;
-
- srna = RNA_def_struct(brna, "LayerCollectionSettings", NULL);
- RNA_def_struct_sdna(srna, "IDProperty");
- RNA_def_struct_ui_text(srna, "Layer Collection Settings",
- "Engine specific settings that can be overriden by LayerCollection");
- RNA_def_struct_refine_func(srna, "rna_LayerCollectionSettings_refine");
-
- RNA_define_verify_sdna(0);
-
- prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
- RNA_def_property_string_funcs(prop, "rna_LayerCollectionSettings_name_get", "rna_LayerCollectionSettings_name_length", NULL);
- RNA_def_property_ui_text(prop, "Name", "Engine Name");
- RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_struct_name_property(srna, prop);
-
- func = RNA_def_function(srna, "use", "rna_LayerCollectionSettings_use");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID);
- RNA_def_function_ui_description(func, "Initialize this property to use");
- parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to set");
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-
- func = RNA_def_function(srna, "unuse", "rna_LayerCollectionSettings_unuse");
- RNA_def_function_flag(func, FUNC_USE_SELF_ID);
- RNA_def_function_ui_description(func, "Remove the property");
- parm = RNA_def_string(func, "identifier", NULL, 0, "Property Name", "Name of the property to unset");
- RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
-
- RNA_define_verify_sdna(1);
-}
-
static void rna_def_layer_collection(BlenderRNA *brna)
{
StructRNA *srna;
@@ -1189,8 +924,6 @@ void RNA_def_view_layer(BlenderRNA *brna)
rna_def_object_base(brna);
RNA_define_animate_sdna(true);
/* *** Animated *** */
- rna_def_view_layer_settings(brna);
- rna_def_layer_collection_settings(brna);
}
#endif