diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-03 17:41:34 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-02-03 17:44:20 +0300 |
commit | 2d4980e68ebbff4cd78f71abb42e767b0d9a1247 (patch) | |
tree | e89fea92c4697f5a2ad08d7c1781362118004db7 /release/scripts/modules/bpy_extras/anim_utils.py | |
parent | 3ff9e52dca8ce9e5900eb89fd06842f41b817b3d (diff) |
Fix T42510: bake animation wrong result.
Caused by own rBfb7ff31315a1c9 - not surprising code using Object.matrix_local
in other contexts than mere Object parenting fails, since it was using a broken
implementation before...
Note that whole NLA_OT_Bake op would need some love, it is quite brittle in many aspects.
Diffstat (limited to 'release/scripts/modules/bpy_extras/anim_utils.py')
-rw-r--r-- | release/scripts/modules/bpy_extras/anim_utils.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py index d87c207e2d0..8905f327f18 100644 --- a/release/scripts/modules/bpy_extras/anim_utils.py +++ b/release/scripts/modules/bpy_extras/anim_utils.py @@ -25,6 +25,7 @@ __all__ = ( import bpy +# XXX visual keying is actually always considered as True in this code... def bake_action(frame_start, frame_end, frame_step=1, @@ -85,15 +86,15 @@ def bake_action(frame_start, if do_parents_clear: def obj_frame_info(obj, do_visual_keying): + return obj.matrix_world.copy() if do_visual_keying else obj.matrix_world.copy() + else: + def obj_frame_info(obj, do_visual_keying): parent = obj.parent - matrix = obj.matrix_local if do_visual_keying else obj.matrix_local + matrix = obj.matrix_world if do_visual_keying else obj.matrix_world if parent: - return parent.matrix_world * matrix + return parent.matrix_world.inverted_safe() * matrix else: return matrix.copy() - else: - def obj_frame_info(obj, do_visual_keying): - return obj.matrix_local.copy() if do_visual_keying else obj.matrix_local.copy() # ------------------------------------------------------------------------- # Setup the Context |