Update for changes in Blender

This commit is contained in:
Campbell Barton 2017-09-10 14:27:56 +10:00
parent c4fc81ee4b
commit d98d1dc3d8
2 changed files with 18 additions and 8 deletions

View File

@ -385,13 +385,15 @@ def bakeAllConstraints(obj, s_frame, e_frame, bones):
constraintStrip.frame_end = e_frame
if selectedBones:
# Use bake function from NLA Bake Action operator
anim_utils.bake_action(s_frame,
e_frame,
action=constraintStrip.action,
only_selected=True,
do_pose=True,
do_object=False,
)
anim_utils.bake_action(
obj,
s_frame,
e_frame,
action=constraintStrip.action,
only_selected=True,
do_pose=True,
do_object=False,
)
if simpleBake:
#Do a "simple" bake, location only, world space only.
locBake(s_frame, e_frame, simpleBake)

View File

@ -521,7 +521,15 @@ def totalRetarget(performer_obj, enduser_obj, scene, s_frame, e_frame):
else:
prepareForBake(enduser_obj)
print("Retargeting pose (Advanced Retarget)")
bake_action(s_frame, e_frame, action=enduser_obj.animation_data.action, only_selected=True, do_pose=True, do_object=False, frame_step=step)
bake_action(
bpy.context.object,
s_frame, e_frame,
action=enduser_obj.animation_data.action,
only_selected=True,
do_pose=True,
do_object=False,
frame_step=step,
)
name = performer_obj.animation_data.action.name[:10]
#We trim the name down to 10 chars because of Action Name length maximum
enduser_obj.animation_data.action.name = "Base " + name