Anim: Add channel type options to the Bake Action operator #111997
No reviewers
Labels
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
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
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111997
Loading…
Reference in New Issue
No description provided.
Delete Branch "nrupsis/blender:anim-bake-components"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Helping land this patch for @cmbasnett & @BClark
Currently, we're limited to the type of Bake Data, without any control over the channels that get baked.
With this change, the user now has a fine degree of control as to which types of f-curve data will be written to the baked action (i.e., location, rotation, scale & b-bone channels).
Recovered from: https://archive.blender.org/developer/D16481
I'd like to re-raise my question from #110903: do we actually want separate options for location/rotation/scale, or should it just be a single "transforms" option?
To clarify:
So my question isn't whether splitting location/rotation/scale is useful or not. My question is where is that line where we stop adding more options and wait for a proper redesign. And the answer may well be that having separate loc/rot/scale options is sufficiently useful to justify adding them right now. But I just want to make sure we consider that in the larger context of option bloat.
I think the function argument count is getting out of hand. Better to do a cleanup pass first, moving the existing options into a class, like below, and pass that instead of the separate arguments.
To keep in mind for that refactor: I don't think it makes much sense to have any default values specified in the
bake_action_iter()
parameters, as I don't think it's ever called without these arguments. There shouldn't be any need to sync up the UI defaults with this particular function (single responsibility principle: only one thing should be responsible for setting the defaults).PS: please make sure that the PR description matches the Ingredients of a Pull Request.
@dr.sybren for creating data classes (types), where should those live? Obviously we'd be using it anim_utils.py, but
bake_action_objects
is called fromanim.py
, and I'd assume we'd want to clean upbake_action_objects
's parameters too?anim.py
importsanim_utils.py
, so IMO the class(es) should be inanim_utils.py
to avoid circular dependencies.Animation: Add channel type options to the Bake Action operatorto Anim: Add channel type options to the Bake Action operatorLooking much better!
Too bad it doesn't work any more ;-)
I think it's better to split apart the PR into a non-functional part (extraction of
BakeOptions
) and a functional part (the actual functional changes in this PR).@ -126,2 +138,2 @@
do_parents_clear=False,
do_clean=False
bake_options: BakeOptions
# only_selected=False,
If this is to be kept, please add a comment that explains why.
@ -148,6 +170,14 @@ def bake_action_iter(
:type do_parents_clear: bool
:arg do_clean: Remove redundant keyframes after baking.
:type do_clean: bool
:arg do_location: Bake location channels.
These arguments no longer exist. Explanation of which option means what could go into
BakeOptions
.@ -257,3 +269,4 @@
from bpy_extras import anim_utils
do_pose = 'POSE' in self.bake_types
do_object = 'OBJECT' in self.bake_types
do_location = 'LOCATION' in self.channel_types
Because these aren't used here directly, I think it's clearer to just have
do_location='LOCATION' in self.channel_types
in theanim_utils.BakeOptions(...)
call.LGTM!
I think this step is pretty reasonable. So let's consider this the last extension of the current code. It's been stretched far enough.