Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-25 09:18:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-25 09:19:57 +0400
commit18f6bb04fa6bec6368a9d3e5253c041ba5c474b3 (patch)
treee57c1af0367a8b900d18dcb74f5cedfca55351e4 /release
parent6a43c2ac1ac9a68a1f0b0b2c76a109dfd9337735 (diff)
Fix for custom property editor when property id's contained quotes
Adds bpy.utils.escape_identifier()
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy/utils.py9
-rw-r--r--release/scripts/modules/rna_prop_ui.py4
2 files changed, 11 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index 6c32f95fc03..ce1efa43b3e 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -25,6 +25,7 @@ not associated with blenders internal data.
__all__ = (
"blend_paths",
+ "escape_identifier",
"keyconfig_set",
"load_scripts",
"modules_from_path",
@@ -48,7 +49,13 @@ __all__ = (
"user_resource",
)
-from _bpy import register_class, unregister_class, blend_paths, resource_path
+from _bpy import (
+ escape_identifier,
+ register_class,
+ unregister_class,
+ blend_paths,
+ resource_path,
+ )
from _bpy import script_paths as _bpy_script_paths
from _bpy import user_resource as _user_resource
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index dd0cd632413..e73b0358d00 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -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)