Fix T48397: Can not bake tweaked NLA

We need to leave tweak mode before trying to modifiy the action as doing
so will leave Blender in a semi-corrupted state.

Reviewers: #animation

Reviewed by: aligorith

Maniphest Tasks: T48397

Differential Revision: https://developer.blender.org/D2119
This commit is contained in:
Kévin Dietrich
2016-07-24 03:18:40 +02:00
parent e4efa16b00
commit f283aa61c5
2 changed files with 28 additions and 0 deletions

View File

@@ -155,6 +155,11 @@ def bake_action(frame_start,
atd = obj.animation_data_create()
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 = action
# -------------------------------------------------------------------------