Anim: update some uses of listbases of fcurves #127920
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127920
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "nathanvegdahl/blender:fcurve_listbase_loops"
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?
Because we're moving to layered actions, which don't store their
fcurves in a list base, we need to update the places that assume the old
listbase-based structure.
This commit addresses the low-hanging fruit where code was previously
using the
LISTBASE_FOREACH
macro on a listbase of fcurves and it wasfairly obvious how to correctly update the code with minimal changes.
Other cases that either weren't immediately obvious or required
non-trivial code changes (or both) have been left for future PRs.
Additionally, uses of the list base that didn't use
LISTBASE_FOREACH
were not investigated as part of this PR, whether trivial to update or
not.
Ref: #123424
@blender-bot build
@blender-bot build
Gah, Monday brain. Already did a build bot run...
@ -959,0 +963,4 @@
newName,
oldKey,
newKey,
blender::animrig::legacy::fcurves_all(strip->act),
fcurves_all()
returns a Vector, which only should be destructed after the call tofcurves_path_rename_fix()
returns. Keep a reference in a local variable to do that.Same for the other places where
fcurves_all()
is used directly a function parameter.I could have sworn that wasn't necessary. See: https://stackoverflow.com/questions/37946437/when-exactly-does-the-destruction-of-a-temporary-object-happen-in-a-function-cal
But maybe there's something additional going on here that makes that not apply...?
Linked from there is https://eel.is/c++draft/class.temporary#4 so yeah, my comment is moot.
@ -4743,3 +4745,3 @@
AnimData *adt = ob->adt;
if (adt->action != nullptr) {
LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
for (FCurve *fcu : blender::animrig::legacy::fcurves_all(adt->action)) {
This should use
legacy::fcurves_for_action_slot(adt->action, adt->slot_handle)
to avoid false positives.@ -371,3 +372,3 @@
AnimKeylist *keylist = ED_keylist_create();
LISTBASE_FOREACH (FCurve *, fcu, &ob->adt->action->curves) {
for (FCurve *fcu : blender::animrig::legacy::fcurves_all(ob->adt->action)) {
This should use
legacy::fcurves_for_action_slot(adt->action, adt->slot_handle)
to only consider keys of the relevant slot.@ -513,3 +515,3 @@
int frame_end = PEFRA;
LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
for (FCurve *fcu : blender::animrig::legacy::fcurves_all(adt->action)) {
Since this is for a specific ADT, it should use the slot for that ADT (
legacy::fcurves_for_action_slot(adt->action, adt->slot_handle)
)@ -752,3 +754,3 @@
}
void bc_enable_fcurves(bAction *act, char *bone_name)
void bc_enable_fcurves(bAction *act, blender::animrig::slot_handle_t slot_handle, char *bone_name)
const
But also, according to #123424, this change shouldn't even be here as the Collada stuff was excluded?
The Collada todo in #123424 is for
add_keyframes_from()
and the things it impacts. This change is separate from that, and was a low-hanging fruit.@blender-bot build
LGTM!