VSE: No simultaneous strip snapping on left & right side [and right side favoured] #90826

Open
opened 2021-08-21 13:11:41 +02:00 by David Salvo · 12 comments

System Information
Operating system: Linux-5.4.0-81-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce 9800 GT/PCIe/SSE2 NVIDIA Corporation 3.3.0 NVIDIA 340.108

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-18 20:22, hash: a217e043be
Worked: Unsure

Short description of error
{F10300365,size=full}
A strip in VSE cannot snap at left and right ends simultaneously. Annoying when the end that does not snap is the end that you're wanting to know the orientation of (especially when you're zoomed out and can't tell by eye).

Further to this, the right side snap will always prefer over the left. It seems it just searches the right side first, and if it snaps it just doesn't check the left side at all. I would find it very odd if dual snapping isn't intended, but if somehow there is no plan to add it in the near future, at least the behaviour should not prefer one side - like maybe prefer the side based on the direction the strip is dragged or something (snap first to the side of the direction the strip is heading?).

Exact steps for others to reproduce the error
strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred.blend

  • Open the blend file, and drag colour strip along x-axis
  • Only the right end will snap, despite both ends clearly lining up with the metastrips
    NOTE: There is a reason I used a metastrip as the snap-to strips here, as there is another snapping bug I will be filing soon (and I didn't want that bug to mess up the behaviour in this one).
**System Information** Operating system: Linux-5.4.0-81-generic-x86_64-with-glibc2.31 64 Bits Graphics card: GeForce 9800 GT/PCIe/SSE2 NVIDIA Corporation 3.3.0 NVIDIA 340.108 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-18 20:22, hash: `a217e043be` Worked: Unsure **Short description of error** {[F10300365](https://archive.blender.org/developer/F10300365/no-dual-strip-snapping.png),size=full} A strip in VSE cannot snap at left and right ends simultaneously. Annoying when the end that does not snap is the end that you're wanting to know the orientation of (especially when you're zoomed out and can't tell by eye). Further to this, the right side snap will always prefer over the left. It seems it just searches the right side first, and if it snaps it just doesn't check the left side at all. I would find it very odd if dual snapping isn't intended, but if somehow there is no plan to add it in the near future, at least the behaviour should not prefer one side - like maybe prefer the side based on the direction the strip is dragged or something (snap first to the side of the direction the strip is heading?). **Exact steps for others to reproduce the error** [strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred.blend](https://archive.blender.org/developer/F10300368/strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred.blend) - Open the blend file, and drag colour strip along x-axis - Only the right end will snap, despite both ends clearly lining up with the metastrips NOTE: There is a reason I used a metastrip as the snap-to strips here, as there is another snapping bug I will be filing soon (and I didn't want that bug to mess up the behaviour in this one).
Author

Added subscriber: @slinkeepie

Added subscriber: @slinkeepie
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Not sure I understand correctly.

In your example the strips are positioned so that snapping the right end to the end of the strip below will have exactly the same outcome as snapping the left end to the start of the strip above.
It is true, in this case you dont get the "dual-snapping-lines".
If I move the meta above slightly by one frame on do it again, I can see it snap to both ends.

strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend

So I dont see the advantage of displaying both snapping borders if they are exactly lined up? The result of the snapping is correct, no?
Could you elaborate?

Not sure I understand correctly. In your example the strips are positioned so that snapping the right end to the end of the strip below will have exactly the same outcome as snapping the left end to the start of the strip above. It is true, in this case you dont get the "dual-snapping-lines". If I move the meta above slightly by one frame on do it again, I can see it snap to both ends. [strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend](https://archive.blender.org/developer/F10311304/strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend) So I dont see the advantage of displaying both snapping borders if they are exactly lined up? The result of the snapping is correct, no? Could you elaborate?
Author

In #90826#1210280, @lichtwerk wrote:
Not sure I understand correctly.

In your example the strips are positioned so that snapping the right end to the end of the strip below will have exactly the same outcome as snapping the left end to the start of the strip above.
It is true, in this case you dont get the "dual-snapping-lines".
If I move the meta above slightly by one frame on do it again, I can see it snap to both ends.

strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend

So I dont see the advantage of displaying both snapping borders if they are exactly lined up? The result of the snapping is correct, no?
Could you elaborate?

Hey Philipp, thanks for taking a look...
Quite simply, at distant zoom rates on a large project it can be very hard to tell. Granted, usually there won't be snap points lining up with both edges of a strip, but it does happen - and if the side you're expecting to/trying to snap does not snap, you're unsure if the other one is in line or a frame off.

At the very least, it shouldn't just always prefer the right side (which it does) - there should be some priority given based on a rule of some sort: either based on front or back handle (relative to direction), or honestly if it is going to always prefer one side, shouldn't it be the left side? (since strips start from the left, and it is the side most people aim to line up).

> In #90826#1210280, @lichtwerk wrote: > Not sure I understand correctly. > > In your example the strips are positioned so that snapping the right end to the end of the strip below will have exactly the same outcome as snapping the left end to the start of the strip above. > It is true, in this case you dont get the "dual-snapping-lines". > If I move the meta above slightly by one frame on do it again, I can see it snap to both ends. > > [strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend](https://archive.blender.org/developer/F10311304/strips-do-not-snap-at-both-ends-simultaneously-and-right-side-is-preferred-repro.blend) > > So I dont see the advantage of displaying both snapping borders if they are exactly lined up? The result of the snapping is correct, no? > Could you elaborate? Hey Philipp, thanks for taking a look... Quite simply, at distant zoom rates on a large project it can be very hard to tell. Granted, usually there won't be snap points lining up with both edges of a strip, but it does happen - and if the side you're expecting to/trying to snap does not snap, you're unsure if the other one is in line or a frame off. At the very least, it shouldn't just always prefer the right side (which it does) - there should be some priority given based on a rule of some sort: either based on front or back handle (relative to direction), or honestly if it is going to always prefer one side, shouldn't it be the left side? (since strips start from the left, and it is the side most people aim to line up).
Member

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Member

Added subscribers: @iss, @mano-wii

Added subscribers: @iss, @mano-wii
Member

OK, thx getting back.
Pretty sure this will not be considered a bug, but I understand your point now (also agree to your suggested improvements: right vs. left and prio based on direction).

Will leave this up to module-devs to classify.

CC @iss
CC @mano-wii

OK, thx getting back. Pretty sure this will not be considered a bug, but I understand your point now (also agree to your suggested improvements: right vs. left and prio based on direction). Will leave this up to module-devs to classify. CC @iss CC @mano-wii

It's more of a design issue.
I see two solutions:

  • Complex: Draw all snap points.
  • Simple: Prioritize snap drawing where the strip is approaching.

This would be the simple solution change:

diff --git a/source/blender/editors/transform/transform_snap_sequencer.c b/source/blender/editors/transform/transform_snap_sequencer.c
index 6e926f36fba..079b4d32719 100644
--- a/source/blender/editors/transform/transform_snap_sequencer.c
+++ b/source/blender/editors/transform/transform_snap_sequencer.c
@@ -299,9 +299,9 @@ bool transform_snap_sequencer_calc(TransInfo *t)
   }
 
   int best_dist = MAXFRAME, best_target_frame = 0, best_source_frame = 0;
-
+  const float delta = t->values[0];
   for (int i = 0; i < snap_data->source_snap_point_count; i++) {
-    int snap_source_frame = snap_data->source_snap_points[i] + round_fl_to_int(t->values[0]);
+    int snap_source_frame = snap_data->source_snap_points[i] + round_fl_to_int(delta);
     for (int j = 0; j < snap_data->target_snap_point_count; j++) {
       int snap_target_frame = snap_data->target_snap_points[j];
 
@@ -309,6 +309,13 @@ bool transform_snap_sequencer_calc(TransInfo *t)
       if (dist > best_dist) {
         continue;
       }
+      else if (dist == best_dist) {
+        bool is_start_point = i % 2;
+        if (is_start_point != (delta > 0.0f)) {
+          /* Prioritize snap where elements are approaching. */
+          continue;
+        }
+      }
 
       best_dist = dist;
       best_target_frame = snap_target_frame;

But perhaps it is preferable to invest in the complex solution.

It's more of a design issue. I see two solutions: - Complex: Draw all snap points. - Simple: Prioritize snap drawing where the strip is approaching. This would be the simple solution change: ``` diff --git a/source/blender/editors/transform/transform_snap_sequencer.c b/source/blender/editors/transform/transform_snap_sequencer.c index 6e926f36fba..079b4d32719 100644 --- a/source/blender/editors/transform/transform_snap_sequencer.c +++ b/source/blender/editors/transform/transform_snap_sequencer.c @@ -299,9 +299,9 @@ bool transform_snap_sequencer_calc(TransInfo *t) } int best_dist = MAXFRAME, best_target_frame = 0, best_source_frame = 0; - + const float delta = t->values[0]; for (int i = 0; i < snap_data->source_snap_point_count; i++) { - int snap_source_frame = snap_data->source_snap_points[i] + round_fl_to_int(t->values[0]); + int snap_source_frame = snap_data->source_snap_points[i] + round_fl_to_int(delta); for (int j = 0; j < snap_data->target_snap_point_count; j++) { int snap_target_frame = snap_data->target_snap_points[j]; @@ -309,6 +309,13 @@ bool transform_snap_sequencer_calc(TransInfo *t) if (dist > best_dist) { continue; } + else if (dist == best_dist) { + bool is_start_point = i % 2; + if (is_start_point != (delta > 0.0f)) { + /* Prioritize snap where elements are approaching. */ + continue; + } + } best_dist = dist; best_target_frame = snap_target_frame; ``` But perhaps it is preferable to invest in the complex solution.

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

In #90826#1210388, @mano-wii wrote:
This would be the simple solution change:

I don't quite like this solution, because it would look like the strip is smaller if it snaps to strip with same length. Probably drawing all snap points is better here. I will confirm though since there may be more issues with snapping that are not neccesarily bugs, and I want to track these.

> In #90826#1210388, @mano-wii wrote: > This would be the simple solution change: I don't quite like this solution, because it would look like the strip is smaller if it snaps to strip with same length. Probably drawing all snap points is better here. I will confirm though since there may be more issues with snapping that are not neccesarily bugs, and I want to track these.

Will classify this as known issue for now. This has to be discussed or evaluated first.

Will classify this as known issue for now. This has to be discussed or evaluated first.
Philipp Oeser removed the
Interest
VFX & Video
label 2023-02-10 09:31:44 +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
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#90826
No description provided.