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.
This commit is contained in:
Bastien Montagne 2015-02-03 15:41:34 +01:00
parent 3ff9e52dca
commit 2d4980e68e
Notes: blender-bot 2023-02-14 09:51:48 +01:00
Referenced by issue #43510, bake animation wrong result
Referenced by issue #42510, limit by seams bug
1 changed files with 8 additions and 7 deletions

View File

@ -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):
parent = obj.parent
matrix = obj.matrix_local if do_visual_keying else obj.matrix_local
if parent:
return parent.matrix_world * matrix
else:
return matrix.copy()
return obj.matrix_world.copy() if do_visual_keying else obj.matrix_world.copy()
else:
def obj_frame_info(obj, do_visual_keying):
return obj.matrix_local.copy() if do_visual_keying else obj.matrix_local.copy()
parent = obj.parent
matrix = obj.matrix_world if do_visual_keying else obj.matrix_world
if parent:
return parent.matrix_world.inverted_safe() * matrix
else:
return matrix.copy()
# -------------------------------------------------------------------------
# Setup the Context