[Bf-blender-cvs] [42c8d93c5f4] master: Fix 'API defined' ID properties still having 'remove' button in UI.

Bastien Montagne noreply at git.blender.org
Wed Apr 19 09:57:21 CEST 2017


Commit: 42c8d93c5f433e980c35cf4d6355819f86dd4d00
Author: Bastien Montagne
Date:   Wed Apr 19 09:51:36 2017 +0200
Branches: master
https://developer.blender.org/rB42c8d93c5f433e980c35cf4d6355819f86dd4d00

Fix 'API defined' ID properties still having 'remove' button in UI.

We could not edit them, but still could delete them, which makes no
sense, API-defined properties are similar to class members, removing
them from single instances is pure garbage. And it was broken anyway.

Found by @a.romanov while checking on T51198, thanks.

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

M	release/scripts/modules/rna_prop_ui.py

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

diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index c0d92c331b7..e50922593de 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -176,12 +176,11 @@ def draw(layout, context, context_member, property_type, use_edit=True):
             if not is_rna:
                 props = row.operator("wm.properties_edit", text="Edit")
                 assign_props(props, val_draw, key)
+                props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
+                assign_props(props, val_draw, key)
             else:
                 row.label(text="API Defined")
 
-            props = row.operator("wm.properties_remove", text="", icon='ZOOMOUT')
-            assign_props(props, val_draw, key)
-
 
 class PropertyPanel:
     """




More information about the Bf-blender-cvs mailing list