Page MenuHome

Fix T84850: "Lock to Selection" causes unwanted jumps
ClosedPublic

Authored by Sergey Sharybin (sergey) on Jan 19 2021, 2:30 PM.

Details

Summary

Adding new tracks, mask points, mask primitives, changing selection was
causing an unwanted jumps in the view.

This change makes it so those operations are preserving view offset.

Diff Detail

Repository
rB Blender

Event Timeline

Sergey Sharybin (sergey) requested review of this revision.Jan 19 2021, 2:30 PM
Sergey Sharybin (sergey) created this revision.

Wow, that was fast! :)
It is already much better, but there are still a couple of problems:

  1. When nothing is selected, panning an zooming doesn't work at all, not even in Track mode.
  2. Zoom is limited. I can only zoom in so far, after a while it feels like hitting an invisible wall, and instead of zooming it starts to pan. The more points there are, the less I can zoom in.
  3. Even though slide_marker works fine, also on the little vector handles, translate or tweak with right mouse does not. When selecting a handle point of a vector handle and hitting "G", the view follows that. That behavior seems quite logic programmatically I guess, but from a users point of view it doesn't make sense, since we want to focus on the curvature of the mask, and not on the thing that controls it.
  4. When a handle point was selected and you switch the handle type e.g. from Aligned to Vector, the view jumps to the lower left corner of the clip, probably because there is no handle point to focus on anymore.

I guess problems 3 and 4 (and maybe even 2?) can be avoided when only curve point can be locked onto, not the handle points.

Make it so L shortcut does not cause jump.

ideally, property in the header will behave the same, but currently it
is a bit unclear how the new logic can fit there.

Sergey Sharybin (sergey) edited the summary of this revision. (Show Details)

Fix jump when selected handle type is changed to vector

Eh, the nice checkbox list is not surviving patch update :(

@Sebastian Koenig (sebastian_k), the limited zoom is caused by the following logic: when selection is locked to multiple tracks and tracks are "spreading away" the locking code will reduce zoom level to keep all tracks visible. Currently it is a bit tricky to distinguish frame change/playback form manual zoom change. So how about we will disallow locking code to change zoom (which will allow you to have any zoom level manually)?

So how about we will disallow locking code to change zoom (which will allow you to have any zoom level manually)?

Let's try! :)

Locking will no longer lock zoom.

Should resolve limited zoom behavior.

Locking will no longer lock zoom.

Wait, but now it also won't follow the selection anymore during playback. Now it only pans the clip during transform, but not during playback.

Wait, but now it also won't follow the selection anymore during playback. Now it only pans the clip during transform, but not during playback.

@Sebastian Koenig (sebastian_k), do you have a file which demonstrates this issue?

Press play in this file. Behaves the same for me as if Locked was off. Only difference is noticable when I transform the curve points, but not during playback.

It doesn't really seems to be caused by the recent zoom fix I did here. And the patch is not even supposed to have functional changes during playback, only when tools are used.

Will need to verify those refactoring parts I did tomorrow.

@Sebastian Koenig (sebastian_k), actually, can you test something? Because seems that your setup is broken ever since 2.80. Can you verify this (lock-to-view for mask editor in MCE does not work in 2.80-2.91)?

@Sebastian Koenig (sebastian_k), actually, can you test something? Because seems that your setup is broken ever since 2.80. Can you verify this (lock-to-view for mask editor in MCE does not work in 2.80-2.91)?

Adding markers with Lock to Selection enabled never worked without viewport jumping like crazy, not even in 2.79.
But you are right, in 2.79 it wasn't affecting the playback.
In 2.83LTS behaves exactly like 2.93 without your patch.

If mask points parented to a track are not supposed to affect the offset of the Clip during playback then the current patch works as intended.
I think it's kind of weird though to bind this behavior to the Lock to Selection view, because it is doing something completely different than in Track mode, where it will lock the clip during playback.

Also, in T84850 you say "Think the lock-to-selection for mask points was explicitly implemented, so that you can more easily see what's going on when zoomed in and scrubbing", so apparently it should actually "center" the current selection to the view, which I think would be quite useful indeed.
I think it could work nicely if it would just use whatever zoom level the user wants and would only pan the mask point. Well, it should just work like Lock to Selection in Track mode, there it works perfectly. And then plus the transform/slide_marker of course.
Is my jibberish even understandable? :D

Adding markers with Lock to Selection enabled never worked without viewport jumping like crazy, not even in 2.79.

Not talking about markers. Talking about mask playback. Opening clip_mask_locked.blend in 2.79 and starting playback keeps mask locked in view, but not in any newer version. At least here, but maybe I'm missing something. This is what would be nice if you could confirm from your side, and confirm that its not like I'm missing something obvious.

Well, it should just work like Lock to Selection in Track mode, there it works perfectly.

That's the goal!

Is my jibberish even understandable? :D

At least 80% of it ;)
Nah, it totally makes sense.

Is just something which looks like a bug and regression since 2.8 series which gets in a way of this patch. So kinda would be nice to take a step back and re-confirm regression I've mentioned above.

Not talking about markers. Talking about mask playback. Opening clip_mask_locked.blend in 2.79 and starting playback keeps mask locked in view, but not in any newer version. At least here, but maybe I'm missing something. This is what would be nice if you could confirm from your side, and confirm that its not like I'm missing something obvious.

Right, sorry, I actually meant masks points, not markers. Confusing... :)
Apart from that, yes, playback works fine in 2.79, but not in 2.91 nor 2.83.

Update against latest master.

Brings fix for playback.

Update against latest master.

Brings fix for playback.

Awesome! will test later !

Fixed curvature slide operator.

  • Made it so sliding CV moves the view
  • Handles are ignored from lock-to-selection

The code contains couple of ugly hacks. They will be re-implemented in
a proper manner after behavior is verified.

Hm, there are still a couple of problems.

  1. When tweaking the curve directly the view jumps, probably because that triggers the selection of the CVs of that curve segment. And that jumping leads to bad deformations of the curve then.
  2. slide_marker (also sliding the whole mask with center point) now always moves the view. Only when Lock to Selection is enabled view should move.
  3. When Lock to Selection is disabled, view jumps to center when starting slide_marker. When LtS is on it works fine though.

Handle tips are fine now, that's great.

On a separate note, it is kind of hard to actually tweak the curve with that center point. It doesn't work reliably, sometimes it doesn't work at all. But that is maybe a different bug, and I am not quite sure how to reproduce.

Fix issues reported by Sebastian.

The center point not working reliably needs more reliable repro so i can have look into it ;)

Yay! Will replace some hacks with a real clean solution then ASAP!

Thanks for tests!

Cleanup, resolve all the hacky solutions and do things properly.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 26 2021, 4:23 PM
This revision was automatically updated to reflect the committed changes.