Animation: NLA Vertical Reorder #107990
Merged
Nate Rupsis
merged 35 commits from 2023-06-20 17:10:15 +02:00
nrupsis/blender:NLA-vertical-shuffle-core
into main
Reviewers
Request review
No reviewers
Labels
Clear labels
This issue affects/is about backward or forward compatibility
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
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
This issue affects/is about backward or forward compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
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
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
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
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
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 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 & 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
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
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
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#107990
Reference in New Issue
There is no content yet.
Delete Branch "nrupsis/blender:NLA-vertical-shuffle-core"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Overview
Previously, you could only drag NLA strip vertically through complete clear (no NLA strips) unlocked tracks.
Now, you can vertically drag a NLA though other clips, and locked tracks.
Design Details
WIP: NLA-vertical-shuffle-coreto Animation: NLA Vertical ReorderAnimation: NLA Vertical Reorderto WIP: Animation: NLA Vertical ReorderApproved from animation art side of things. Future plans to add options are nice but not core to having this drag and drop functionality this provides, has been asked for for years and had code in the works for at least two years.
WIP: Animation: NLA Vertical Reorderto Animation: NLA Vertical Reorder@blender-bot package
Package build started. Download here when ready.
@ -56,1 +56,4 @@
int trackIndex;
/** NOTE: This index is relative to the initial first track at the start of transforming and
* thus can be negative when the tracks list grows downward. */
♥
@ -141,0 +162,4 @@
ListBase *tracks = &BKE_animdata_from_id(
((TransDataNla *)((LinkData *)trans_datas->first)->data)->id)
->nla_tracks;
This you may want to split out a little bit. If you get a NULL dereference it's going to be very hard to figure out which
->
caused it. Something like this should work (but do test before committing ;-) )@ -141,0 +185,4 @@
continue;
}
offset = shuffle_down ? 1 : -1;
Instead of having a boolean
shuffle_down
, use anint shuffle_direction
which can be either-1
or1
. That way you don't have to do this, and the direction is more clear from the call site of the function.One thing that's weird, though, is that the
shuffle_down == true
case selects a positive offset here, but in the code down below you havefabs(offset_down) < offset_up
, indicating that the "up" direction is actually positive and the "down" direction is negative.During testing I haven't been able to get any offset that was non-zero, so I found it tricky to either prove or disprove my own comment.
Got it, it required me to lock some tracks. So yes, the
offset_down
is positive, andoffset_up
is negative, and thus thefabs()
is on the wrong one.@ -141,0 +212,4 @@
const bool up_valid = transdata_get_track_shuffle_offset_side(trans_datas, false, &offset_up);
if (down_valid && up_valid) {
if (abs(offset_down) < offset_up) {
Not for this patch, but for future reference: we may want to have a function series
minabs_ff(float a, float b)
(with more_fff
and also_dd
and_ii
just like themin_...
andmax_...
functions) that return the value for which the absolute value is the smallest.@ -141,0 +241,4 @@
bAnimListElem *ale;
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
use
LISTBASE_FOREACH
I'm seeing some strange behaviour in this PR. With the attached file, do this:
@dr.sybren Thanks for blend file! Should be working now.
This is working better, as it feels more consistent / predictable. However, it just prevents the entire operation when one of the selected strips lands on a locked track. This could be an ok approach, but then there should be a warning issued that the operation could not be performed, and that explains why.
Also please update the PR description to include these design choices. How the system behaves when it cannot fully perform a transformation is something that should be an explicit part of the proposed design, and not something that flows out of the current implementation.
Update: going back to the
main
branch and seeing how it behaves there (not even being able to drag through locked tracks), I think this PR is already a huge improvement. Just add a warning when landing on a locked track, and include this in the patch description, and I think (at least behaviour-wise) it's good to land.LGTM!
Reviewers