[Bf-blender-cvs] [554d921124e] master: UI: Remove confusing "Unset" context menu entry

Julian Eisel noreply at git.blender.org
Wed Apr 7 18:20:59 CEST 2021


Commit: 554d921124e556a40d8ba1da46f8f5a3cd832ab5
Author: Julian Eisel
Date:   Wed Apr 7 18:04:43 2021 +0200
Branches: master
https://developer.blender.org/rB554d921124e556a40d8ba1da46f8f5a3cd832ab5

UI: Remove confusing "Unset" context menu entry

This was added in 37b82a2d260e, doesn't have much purpose and doesn't even do
anything in the vast majority of cases. It only affects custom properties. So
at the very least it shouldn't be shown for regular RNA property buttons. But
even for cases where it may do something, we couldn't find a good use-case. If
this operator has use-cases with some add-ons, the add-ons can expose it
differently, e.g. with a little 'x' icon next to the button, like it's done in
the keymap editor.

So removing the context menu entry now. Should this turn out to be a problem,
it can be brought back but much more selectively (only where it actually does
something). Or we could combine it with "Reset to Default".

Differential Revision: https://developer.blender.org/D8727

Reviewed by: Brecht Van Lommel, Hans Goudey

===================================================================

M	source/blender/editors/interface/interface_context_menu.c

===================================================================

diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 91c19ff2850..c594b61acd3 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -542,9 +542,7 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
     const PropertyType type = RNA_property_type(prop);
     const PropertySubType subtype = RNA_property_subtype(prop);
     bool is_anim = RNA_property_animateable(ptr, prop);
-    const bool is_editable = RNA_property_editable(ptr, prop);
     const bool is_idprop = RNA_property_is_idprop(prop);
-    const bool is_set = RNA_property_is_set(ptr, prop);
 
     /* second slower test,
      * saved people finding keyframe items in menus when its not possible */
@@ -893,12 +891,6 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
                      "all",
                      1);
     }
-    if (is_editable /*&& is_idprop*/ && is_set) {
-      uiItemO(layout,
-              CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Unset"),
-              ICON_NONE,
-              "UI_OT_unset_property_button");
-    }
 
     if (is_idprop && !is_array && ELEM(type, PROP_INT, PROP_FLOAT)) {
       uiItemO(layout,



More information about the Bf-blender-cvs mailing list