Use string escaping when renaming custom properties

This commit is contained in:
Campbell Barton 2014-02-25 16:49:14 +11:00
parent 18f6bb04fa
commit 24e1ce25d1
1 changed files with 5 additions and 5 deletions

View File

@ -1081,12 +1081,12 @@ class WM_OT_properties_edit(Operator):
prop_type_old = type(item[prop_old])
rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % prop_old
exec_str = "del item[%r]" % prop_old
# print(exec_str)
exec(exec_str)
# Reassign
exec_str = "item['%s'] = %s" % (prop, repr(value_eval))
exec_str = "item[%r] = %s" % (prop, repr(value_eval))
# print(exec_str)
exec(exec_str)
self._last_prop[:] = [prop]
@ -1103,7 +1103,7 @@ class WM_OT_properties_edit(Operator):
# If we have changed the type of the property, update its potential anim curves!
if prop_type_old != prop_type:
data_path = '["%s"]' % prop
data_path = '["%s"]' % bpy.utils.escape_identifier(prop)
done = set()
def _update(fcurves):
@ -1114,9 +1114,9 @@ class WM_OT_properties_edit(Operator):
def _update_strips(strips):
for st in strips:
if st.type in {'CLIP'} and st.action:
if st.type == 'CLIP' and st.action:
_update(st.action.fcurves)
elif st.type in {'META'}:
elif st.type == 'META':
_update_strips(st.strips)
adt = getattr(item, "animation_data", None)