Fix bake action visual-keying option

Disabling did nothing
This commit is contained in:
Campbell Barton
2015-02-17 07:16:59 +11:00
parent 00a3c9afc8
commit 652b2b656a

View File

@@ -74,7 +74,7 @@ def bake_action(frame_start,
# -------------------------------------------------------------------------
# Helper Functions and vars
def pose_frame_info(obj, do_visual_keying):
def pose_frame_info(obj):
matrix = {}
for name, pbone in obj.pose.bones.items():
if do_visual_keying:
@@ -85,16 +85,29 @@ def bake_action(frame_start,
return matrix
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()
if do_visual_keying:
def obj_frame_info(obj):
return obj.matrix_world.copy()
else:
def obj_frame_info(obj):
parent = obj.parent
matrix = obj.matrix_basis
if parent:
return parent.matrix_world * matrix
else:
return matrix.copy()
else:
def obj_frame_info(obj, do_visual_keying):
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()
if do_visual_keying:
def obj_frame_info(obj):
parent = obj.parent
matrix = obj.matrix_world
if parent:
return parent.matrix_world.inverted_safe() * matrix
else:
return matrix.copy()
else:
def obj_frame_info(obj):
return obj.matrix_basis.copy()
# -------------------------------------------------------------------------
# Setup the Context
@@ -124,9 +137,9 @@ def bake_action(frame_start,
scene.frame_set(f)
scene.update()
if do_pose:
pose_info.append(pose_frame_info(obj, do_visual_keying))
pose_info.append(pose_frame_info(obj))
if do_object:
obj_info.append(obj_frame_info(obj, do_visual_keying))
obj_info.append(obj_frame_info(obj))
# -------------------------------------------------------------------------
# Create action