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:
authorBastien Montagne <montagne29@wanadoo.fr>2013-12-17 12:40:52 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-12-17 12:51:27 +0400
commit51f5c994e9f03ec2c488ac3a2af02b43c34d7ca6 (patch)
tree16d0e592b9f5b827bda5b8f238a943a5a5b12984 /release
parente68144aed71497015384ab1a1504667a36fde330 (diff)
Fix T37103: Keyframing custom properties issue (FCurve would not reflect Custom props type changes).
Add an helper func to re-compute integer-only fcurve flags, and call it when editing custom props. Reviewed by aligorith, thanks! Summary: Proposal fix for "keyframing custom properties issue" (T37103). Reviewers: aligorith Maniphest Tasks: T37103 Differential Revision: http://developer.blender.org/D111
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/wm.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 4b954e81ee1..6a54a1ea15c 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1045,6 +1045,7 @@ class WM_OT_properties_edit(Operator):
# First remove
item = eval("context.%s" % data_path)
+ prop_type_old = type(item[prop_old])
rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % prop_old
@@ -1067,6 +1068,33 @@ class WM_OT_properties_edit(Operator):
prop_ui["description"] = self.description
+ # If we have changed the type of the property, update its potential anim curves!
+ if prop_type_old != prop_type:
+ data_path = '["%s"]' % prop
+ done = set()
+ def _update(fcurves):
+ for fcu in fcurves:
+ if fcu not in done and fcu.data_path == data_path:
+ fcu.update_autoflags(item)
+ done.add(fcu)
+
+ def _update_strips(strips):
+ for st in strips:
+ if st.type in {'CLIP'} and st.action:
+ _update(st.action.fcurves)
+ elif st.type in {'META'}:
+ _update_strips(st.strips)
+
+ adt = getattr(item, "animation_data", None)
+ if adt is not None:
+ if adt.action:
+ _update(adt.action.fcurves)
+ if adt.drivers:
+ _update(adt.drivers)
+ if adt.nla_tracks:
+ for nt in adt.nla_tracks:
+ _update_strips(nt.strips)
+
# otherwise existing buttons which reference freed
# memory may crash blender [#26510]
# context.area.tag_redraw()