Fix 'API defined' ID properties still having 'remove' button in UI.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 19 Apr 2017 07:51:36 +0000 (09:51 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 19 Apr 2017 07:54:47 +0000 (09:54 +0200)
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.

release/scripts/modules/rna_prop_ui.py

index c0d92c331b74cd334f10e0a1229b708c1c28a29b..e50922593de6c1c02ae54c7a41de61a28289ccc5 100644 (file)
@@ -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:
     """