Fix T39886: Transformed parents of Rigid Bodies cause problems with Bake To Keyframes
Need to convert transforms to parent space for objects with parents.
This commit is contained in:
parent
3b75d6c4f9
commit
258e30f2c7
@ -143,6 +143,9 @@ class BakeToKeyframes(Operator):
|
||||
scene.frame_set(f)
|
||||
for j, obj in enumerate(objects):
|
||||
mat = bake[i][j]
|
||||
# convert world space transform to parent space, so parented objects don't get offset after baking
|
||||
if (obj.parent):
|
||||
mat = obj.matrix_parent_inverse.inverted() * obj.parent.matrix_world.inverted() * mat
|
||||
|
||||
obj.location = mat.to_translation()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user