Bake Action Operator offsets keyframes from tweaked strip #57159

Closed
opened 2018-10-11 08:46:48 +02:00 by ¿? · 5 comments

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: Bake_Action_bug.blend

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.

bake_offset.png
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 = action

to

    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

This will:

  • use the tweak mode action
  • insert keyframes in the correct relative/offset positions.
  • not force exit of tweak mode
*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: [Bake_Action_bug.blend](https://archive.blender.org/developer/F5022472/Bake_Action_bug.blend) 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. ![bake_offset.png](https://archive.blender.org/developer/F5022228/bake_offset.png) 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 = action ``` to ``` 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 ``` This will: - use the tweak mode action - insert keyframes in the correct relative/offset positions. - not force exit of tweak mode
Author

Added subscriber: @Ebone

Added subscriber: @Ebone

Added subscribers: @ideasman42, @ZedDB

Added subscribers: @ideasman42, @ZedDB
Campbell Barton was assigned by Sebastian Parborg 2019-02-07 14:24:46 +01:00

@ideasman42 does the fix look resonable?

@ideasman42 does the fix look resonable?
Campbell Barton was unassigned by Dalai Felinto 2019-12-23 16:35:56 +01:00

This issue was referenced by 283d76932a

This issue was referenced by 283d76932a74971b8be06a988c2e0646fdbc1b78

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Alexander Gavrilov self-assigned this 2020-01-14 14:13:34 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#57159
No description provided.