Fix #110108: NLA absolute snapping #111984
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
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111984
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChrisLend/blender:fix_nla_marker_snap"
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?
Before this patch the following snapping options were broken
The issue was that each end of the strip would snap individually. Potentially collapsing the strip.
This would happen e.g. when snapping to markers but with only 1 marker present.
This PR fixes the issue by finding out the closest snap offset and shifting the strip as a whole by that amount.
That means either the start or the end of the strip will snap to the target.
By doing it that way the length of the strip is never changed by snapping.
This means when snapping to Seconds with "Absolute Time Snap" turned on, the start of the strip might not be on a full second when the end is.
Here is a video demo as an example.
@blender-bot package
Package build started. Download here when ready.
@ -668,0 +671,4 @@
transform_snap_anim_flush_data(t, &td, snap_mode, &snap_value);
/* In order to move the strip in a block and not each end individually, find the minimal snap
* offset and shift the whole strip by that amount. */
Minor: first line in comment is a little long.
Might read better.
@ -668,0 +681,4 @@
for (int i = 0; i < tc->data_len; i++) {
TransData td = tc->data[i];
*td.loc = td.iloc[0] + offset;
is there a reason we update
*td.loc
in it's own loop? Couldn't that be done at the bottom of the other loop?I need to first find the smallest snap delta of all points, then I can apply that offset to all points.
That gives me the behavior of snapping the whole block to the closest snapping point of either side.
I renamed the variables and added a comment to make that clearer
I didn't see it in detail, but if it doesn't change the behavior too much, could you use the generic snap solution?
See
transform_snap_mixed_apply
.You would only need to edit the callbacks:
t->tsnap.snap_target_fn
t->tsnap.snap_source_fn
t->tsnap.snap_apply_fn
The fix to snap the entire clip is what I was expecting it to do and so while there are other issues to address in other patches (I was reminded) I am happy to see this current result.
Thanks for the hint that those exist. I am not too familiar with the snapping system yet but will definitely have a look at those
I would keep that for a different patch though, that way this PR can be backported to the LTS tasks more easily.
But yeah upgrading to generic snapping is definitely the way to go.