Note: this is a bug report + a fix suggestion, I don't know how I would go about directly submitting the fix
Here is a quick-easy test example for this:
Win7
There's a bug in the Bake Action operator when using it in tweak mode with NLA strps.
When the strip is moved to a different location and you want to Overwrite the Current Action, the bake will not insert the keyframes relative to the strip's offset.
This image in order from top to bottom shows the current action in the NLA editor:
- Action in tweak mode
- Action's base keyframe locations
- Baked action's result
- Baked action in tweak mode
I don't know why the code is setup the way it is but an easy fix for this is to (only disable tweak mode and specify active animation.action if use_current_action is False).
"..\2.79\scripts\startup\bl_operators\anim.py"
"..\2.79\scripts\modules\bpy_extras\anim_utils.py"
Line #247
Simply change it from:
if action is None:
action = bpy.data.actions.new("Action")
# Leave tweak mode before trying to modify the action (T48397)
if atd.use_tweak_mode:
atd.use_tweak_mode = False
atd.action = actionto
if action is None:
action = bpy.data.actions.new("Action")
# Leave tweak mode before trying to modify the action (T48397)
if atd.use_tweak_mode:
atd.use_tweak_mode = False
atd.action = actionThis will:
- use the tweak mode action
- insert keyframes in the correct relative/offset positions.
- not force exit of tweak mode
