Fix for custom property editor when property id's contained quotes

Adds bpy.utils.escape_identifier()
This commit is contained in:
Campbell Barton
2014-02-25 16:18:10 +11:00
parent 6a43c2ac1a
commit 18f6bb04fa
3 changed files with 58 additions and 3 deletions

View File

@@ -92,6 +92,8 @@ def draw(layout, context, context_member, property_type, use_edit=True):
if not rna_item:
return
from bpy.utils import escape_identifier
if rna_item.id_data.library is not None:
use_edit = False
@@ -144,7 +146,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
if key in rna_properties:
row.prop(rna_item, key, text="")
else:
row.prop(rna_item, '["%s"]' % key, text="")
row.prop(rna_item, '["%s"]' % escape_identifier(key), text="")
if use_edit:
row = split.row(align=True)