diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-08 16:57:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-08 18:46:20 +0300 |
commit | e6d11c6ce66f94549d1fe896c59b67564ae19d68 (patch) | |
tree | babe12f8b03d92d1a43d880e044bca2394ecd118 /source/blender/editors/interface/interface_ops.c | |
parent | 03dd109a84657ebf778dc3c25776f7a93cccf1ac (diff) |
Collections: remove per collection and view layer engine overrides.
This will be handled by the new view layer override system which will
store data elsewhere, removing the code already for easier refactoring.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index ef328c2cd5e..6f16ad14e40 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -334,128 +334,6 @@ static void UI_OT_unset_property_button(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; } -/* Use/Unuse Property Button Operator ------------------------ */ - -static int use_property_button_exec(bContext *C, wmOperator *UNUSED(op)) -{ - PointerRNA ptr, scene_props_ptr; - PropertyRNA *prop; - IDProperty *props; - - uiBut *but = UI_context_active_but_get(C); - - prop = but->rnaprop; - ptr = but->rnapoin; - props = (IDProperty *)ptr.data; - /* XXX Using existing data struct to pass another RNAPointer */ - scene_props_ptr = but->rnasearchpoin; - - const char *identifier = RNA_property_identifier(prop); - if (IDP_GetPropertyFromGroup(props, identifier)) { - return OPERATOR_CANCELLED; - } - - int array_len = RNA_property_array_length(&scene_props_ptr, prop); - bool is_array = array_len != 0; - - switch (RNA_property_type(prop)) { - case PROP_FLOAT: - { - if (is_array) { - float values[RNA_MAX_ARRAY_LENGTH]; - RNA_property_float_get_array(&scene_props_ptr, prop, values); - BKE_collection_engine_property_add_float_array(props, identifier, values, array_len); - } - else { - float value = RNA_property_float_get(&scene_props_ptr, prop); - BKE_collection_engine_property_add_float(props, identifier, value); - } - break; - } - case PROP_ENUM: - { - int value = RNA_enum_get(&scene_props_ptr, identifier); - BKE_collection_engine_property_add_int(props, identifier, value); - break; - } - case PROP_INT: - { - int value = RNA_int_get(&scene_props_ptr, identifier); - BKE_collection_engine_property_add_int(props, identifier, value); - break; - } - case PROP_BOOLEAN: - { - int value = RNA_boolean_get(&scene_props_ptr, identifier); - BKE_collection_engine_property_add_bool(props, identifier, value); - break; - } - case PROP_STRING: - case PROP_POINTER: - case PROP_COLLECTION: - default: - break; - } - - /* TODO(sergey): Use proper flag for tagging here. */ - DEG_id_tag_update((ID *)CTX_data_scene(C), 0); - - return OPERATOR_FINISHED; -} - -static void UI_OT_use_property_button(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Use property"; - ot->idname = "UI_OT_use_property_button"; - ot->description = "Create a property"; - - /* callbacks */ - ot->poll = ED_operator_regionactive; - ot->exec = use_property_button_exec; - - /* flags */ - ot->flag = OPTYPE_UNDO; -} - -static int unuse_property_button_exec(bContext *C, wmOperator *UNUSED(op)) -{ - PointerRNA ptr; - PropertyRNA *prop; - int index; - - /* try to unset the nominated property */ - UI_context_active_but_prop_get(C, &ptr, &prop, &index); - const char *identifier = RNA_property_identifier(prop); - - IDProperty *props = (IDProperty *)ptr.data; - 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 *)CTX_data_scene(C), 0); - - return OPERATOR_FINISHED; -} - -static void UI_OT_unuse_property_button(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Unuse property"; - ot->idname = "UI_OT_unuse_property_button"; - ot->description = "Remove a property"; - - /* callbacks */ - ot->poll = ED_operator_regionactive; - ot->exec = unuse_property_button_exec; - - /* flags */ - ot->flag = OPTYPE_UNDO; -} - - - - /* Note that we use different values for UI/UX than 'real' override operations, user does not care * whether it's added or removed for the differential operation e.g. */ @@ -1455,8 +1333,6 @@ void ED_operatortypes_ui(void) WM_operatortype_append(UI_OT_copy_python_command_button); WM_operatortype_append(UI_OT_reset_default_button); WM_operatortype_append(UI_OT_unset_property_button); - WM_operatortype_append(UI_OT_use_property_button); - WM_operatortype_append(UI_OT_unuse_property_button); WM_operatortype_append(UI_OT_override_type_set_button); WM_operatortype_append(UI_OT_override_remove_button); WM_operatortype_append(UI_OT_copy_to_selected_button); |