[Bf-blender-cvs] [bb62f9a] master: Fix T38778: Properties from bpy.props could be edited as custom props

Campbell Barton noreply at git.blender.org
Tue Feb 25 07:04:58 CET 2014


Commit: bb62f9a582d44e347f81b11610b8e18acc590b35
Author: Campbell Barton
Date:   Tue Feb 25 17:01:46 2014 +1100
https://developer.blender.org/rBbb62f9a582d44e347f81b11610b8e18acc590b35

Fix T38778: Properties from bpy.props could be edited as custom props

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

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 e73b035..5180bdb 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -140,18 +140,23 @@ def draw(layout, context, context_member, property_type, use_edit=True):
         row.label(text=key, translate=False)
 
         # explicit exception for arrays
+        is_rna = (key in rna_properties)
+
         if to_dict or to_list:
             row.label(text=val_draw, translate=False)
         else:
-            if key in rna_properties:
+            if is_rna:
                 row.prop(rna_item, key, text="")
             else:
                 row.prop(rna_item, '["%s"]' % escape_identifier(key), text="")
 
         if use_edit:
             row = split.row(align=True)
-            props = row.operator("wm.properties_edit", text="Edit")
-            assign_props(props, val_draw, key)
+            if not is_rna:
+                props = row.operator("wm.properties_edit", text="Edit")
+                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)




More information about the Bf-blender-cvs mailing list