Commit: 2771dfd5632ad6d982ee4bf3e87decdb197ebed7 Author: Julian Eisel Date: Wed Jan 13 15:08:09 2021 +0100 Branches: master https://developer.blender.org/rB2771dfd5632ad6d982ee4bf3e87decdb197ebed7
UI: Revert design changes to data-block selector for the 2.92 release Partially reverts 2250b5cefee7. Removing the user count and fake user count icons was controversial (which was expected) and there are a few further changes needed, that won't make it in time for the release, see D9946. While there is a design to bring back the user count and fake user indicators, a new design idea was proposed that the UI team wants to follow. This came too late for the 2.92 release, the new design is targeted at the 2.93 release now. Meanwhile, UI team decision was to simply revert the design changes. The new design is being worked on in https://developer.blender.org/T84669. Note that this commit does not revert some internal changes done in 2250b5cefee7. Namely the introduction of `ed_util_ops.c` and data-block operators in there. These will still be needed in the new design. =================================================================== M intern/cycles/blender/addon/ui.py M release/scripts/startup/bl_ui/properties_material.py M release/scripts/startup/bl_ui/properties_world.py M release/scripts/startup/bl_ui/space_dopesheet.py M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface.c M source/blender/editors/interface/interface_context_menu.c M source/blender/editors/interface/interface_handlers.c M source/blender/editors/interface/interface_ops.c M source/blender/editors/interface/interface_region_tooltip.c M source/blender/editors/interface/interface_templates.c M source/blender/editors/render/render_intern.h M source/blender/editors/render/render_ops.c M source/blender/editors/render/render_shading.c M source/blender/editors/space_action/action_data.c M source/blender/editors/space_action/action_intern.h M source/blender/editors/space_action/action_ops.c M source/blender/editors/space_api/spacetypes.c M source/blender/editors/space_clip/clip_buttons.c M source/blender/editors/space_file/file_panels.c M source/blender/editors/space_image/image_buttons.c M source/blender/editors/space_nla/nla_buttons.c M source/blender/editors/space_node/drawnode.c M source/blender/makesrna/intern/rna_ui_api.c M source/blender/modifiers/intern/MOD_displace.c M source/blender/modifiers/intern/MOD_nodes.cc M source/blender/modifiers/intern/MOD_volume_displace.cc M source/blender/modifiers/intern/MOD_warp.c M source/blender/modifiers/intern/MOD_wave.c M source/blender/modifiers/intern/MOD_weightvg_util.c M source/blender/windowmanager/intern/wm_operator_type.c =================================================================== diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 579f0c1b040..aa009c15b10 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1148,7 +1148,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel): split = layout.split(factor=0.65) if ob: - split.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate") + split.template_ID(ob, "active_material", new="material.new") row = split.row() if slot: diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index e1f2862f826..47ab98386f4 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -133,7 +133,7 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): row = layout.row() if ob: - row.template_ID(ob, "active_material", new="material.new", duplicate="material.duplicate") + row.template_ID(ob, "active_material", new="material.new") if slot: icon_link = 'MESH_DATA' if slot.link == 'DATA' else 'OBJECT_DATA' diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 74293e02b60..9b61311c2d3 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -51,7 +51,7 @@ class WORLD_PT_context_world(WorldButtonsPanel, Panel): space = context.space_data if scene: - layout.template_ID(scene, "world", new="world.new", duplicate="world.duplicate") + layout.template_ID(scene, "world", new="world.new") elif world: layout.template_ID(space, "pin_id") diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 3f43240eaed..0c222e8c023 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -248,7 +248,7 @@ class DOPESHEET_HT_editor_buttons: layout.separator_spacer() - layout.template_ID(st, "action", new="action.new", duplicate="action.duplicate_assign", unlink="action.unlink") + layout.template_ID(st, "action", new="action.new", unlink="action.unlink") # Layer management if st.mode == 'GPENCIL': diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 9ea6099ff11..7bbb7225f14 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -76,7 +76,6 @@ struct wmWindow; typedef struct uiBlock uiBlock; typedef struct uiBut uiBut; -typedef struct uiButExtraOpIcon uiButExtraOpIcon; typedef struct uiLayout uiLayout; typedef struct uiPopupBlockHandle uiPopupBlockHandle; @@ -1387,16 +1386,13 @@ typedef struct uiStringInfo { /* Note: Expects pointers to uiStringInfo structs as parameters. * Will fill them with translated strings, when possible. * Strings in uiStringInfo must be MEM_freeN'ed by caller. */ -void UI_but_string_info_get(struct bContext *C, uiBut *but, uiButExtraOpIcon *extra_icon, ...) - ATTR_SENTINEL(0); +void UI_but_string_info_get(struct bContext *C, uiBut *but, ...) ATTR_SENTINEL(0); /* Edit i18n stuff. */ /* Name of the main py op from i18n addon. */ #define EDTSRC_I18N_OP_NAME "UI_OT_edittranslation" /** - * TODO This is old stuff, only used by templateID. Should be cleaned up. - * * Special Buttons * * Buttons with a more specific purpose: @@ -1414,16 +1410,14 @@ enum { UI_ID_ALONE = 1 << 4, UI_ID_OPEN = 1 << 3, UI_ID_DELETE = 1 << 5, - UI_ID_MAKE_LOCAL = 1 << 6, - UI_ID_LIB_OVERRIDE_ADD = 1 << 7, - UI_ID_AUTO_NAME = 1 << 8, + UI_ID_LOCAL = 1 << 6, + UI_ID_AUTO_NAME = 1 << 7, + UI_ID_FAKE_USER = 1 << 8, UI_ID_PIN = 1 << 9, UI_ID_PREVIEWS = 1 << 10, - UI_ID_LIB_OVERRIDE_REMOVE = 1 << 11, - UI_ID_LIB_OVERRIDE_RESET = 1 << 12, + UI_ID_OVERRIDE = 1 << 11, UI_ID_FULL = UI_ID_RENAME | UI_ID_BROWSE | UI_ID_ADD_NEW | UI_ID_OPEN | UI_ID_ALONE | - UI_ID_DELETE | UI_ID_MAKE_LOCAL | UI_ID_LIB_OVERRIDE_ADD | - UI_ID_LIB_OVERRIDE_REMOVE | UI_ID_LIB_OVERRIDE_RESET, + UI_ID_DELETE | UI_ID_LOCAL, }; /** @@ -1669,12 +1663,10 @@ void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN); void UI_but_func_pushed_state_set(uiBut *but, uiButPushedStateFunc func, void *arg); -struct uiButExtraOpIcon *UI_but_extra_operator_icon_add(uiBut *but, - const char *opname, - short opcontext, - int icon); -struct wmOperatorType *UI_but_extra_operator_icon_optype_get(struct uiButExtraOpIcon *extra_icon); -struct PointerRNA *UI_but_extra_operator_icon_opptr_get(struct uiButExtraOpIcon *extra_icon); +struct PointerRNA *UI_but_extra_operator_icon_add(uiBut *but, + const char *opname, + short opcontext, + int icon); /* Autocomplete * @@ -1976,7 +1968,6 @@ void uiTemplateID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, const char *newop, - const char *duplicateop, const char *openop, const char *unlinkop, int filter, @@ -2589,11 +2580,6 @@ struct ARegion *UI_tooltip_create_from_button(struct bContext *C, struct ARegion *butregion, uiBut *but, bool is_label); -struct ARegion *UI_tooltip_create_from_button_or_extra_icon(struct bContext *C, - struct ARegion *butregion, - uiBut *but, - uiButExtraOpIcon *extra_icon, - bool is_label); struct ARegion *UI_tooltip_create_from_gizmo(struct bContext *C, struct wmGizmo *gz); void UI_tooltip_free(struct bContext *C, struct bScreen *screen, struct ARegion *region); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9644e6e0238..e53dfa83867 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1168,21 +1168,16 @@ void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_str * \{ */ static bool ui_but_event_operator_string_from_operator(const bContext *C, - wmOperatorCallParams *op_call_params, + uiBut *but, char *buf, const size_t buf_len) { - BLI_assert(op_call_params->optype != NULL); + BLI_assert(but->optype != NULL); bool found = false; - IDProperty *prop = (op_call_params->opptr) ? op_call_params->opptr->data : NULL; - - if (WM_key_event_operator_string(C, - op_call_params->optype->idname, - op_call_params->opcontext, - prop, - true, - buf, - buf_len)) { + IDProperty *prop = (but->opptr) ? but->opptr->data : NULL; + + if (WM_key_event_operator_string( + C, but->optype->idname, but->opcontext, prop, true, buf, buf_len)) { found = true; } return found; @@ -1259,22 +1254,15 @@ static bool ui_but_event_operator_string_from_panel(const bContext *C, return found; } -static bool ui_but_event_operator_string( - const bContext *C, uiBut *but, uiButExtraOpIcon *extra_icon, char *buf, const size_t buf_len) +static bool ui_but_event_operator_string(const bContext *C, + uiBut *but, + char *buf, + const size_t buf_len) { bool found = false; - wmOperatorType *extra_icon_optype = UI_but_extra_operator_icon_optype_get(extra_icon); - if (extra_icon_optype) { - found = ui_but_event_operator_string_from_operator(C, extra_icon->optype_params, buf, buf_len); - } - else if (but->optype != NULL) { - found = ui_but_event_operator_string_from_operator( - C, - &(wmOperatorCallParams){ - .optype = but->optype, .opptr = but->opptr, .opcontext = but->opcontext}, - buf, - buf_len); + if (but->optype != NULL) { + found = ui_but_event_operator_string_from_operator(C, but, buf, buf_len); } else if (UI_but_menutype_get(but) != NULL) { found = ui_but_event_operator_string_from_menu(C, but, buf, buf_len); @@ -1577,7 +1565,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block) continue; } - if (ui_but_event_operator_string(C, but, NULL, buf, sizeof(buf))) { + if (ui_but_event_operator_string(C, but, buf, sizeof(buf))) { ui_but_add_shortcut(but, buf, false); } else if (ui_but_event_property_operator_string(C, but, buf, sizeof(buf))) { @@ -1618,12 +1606,12 @@ typedef enum PredefinedExtraOpIconType { PREDEFINED_EXTRA_OP_ICON_EYEDROPPER, } PredefinedExtraOpIconType; -static uiButExtraOpIcon *ui_but_extra_operator_icon_add_ptr(uiBut *but, - wmOperatorType *optype, - short opcontext, - @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs