VSE: improved handle tweaking #109522
No reviewers
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109522
Loading…
Reference in New Issue
No description provided.
Delete Branch "iss/blender:tweak-experiment"
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?
This commit changes how users can interact with handles:
Unselected handles are not drawn anymore by default, but this can be
changed in overlays. Handles are bit thinner. If handle can't be
selected, because strip is too small, it is not drawn.
When hovering over strip handle a cursor is changed to represent a
handle shape. It is possible to select 2 handles at once if strips are
adjoined. When tweak event happens, previous handle selection is lost,
so only handles/strips that are clicked on are moved. After tweaking,
handles are deselected. This behavior can be disabled in preferences:
Editing > Video Sequencer > Tweak Handles.
Moving strips with G key works same way as before.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Tried this build. As mentioned in Harley's patch, indicating with the mouse cursor what will happen is a great way to inform users what will happen when they click at that spot.
As this patch currently is, can't the selected handle to the left be seen at all:
Since a 3D object, do not have both an outline on the object and a selected vertex in the 3D View(it is either or), consider removing the strip outline, when the handle of a strip is selected. That'll make it much easier to see what is selected.
Now you're using a bracket shape mouse cursor, have I previously made a patch which adds bracket shaped handles: https://archive.blender.org/developer/differential/0010/0010297/index.html
The trouble with the handles is that the handle will cover the waveform, so it becomes difficult to make an exact edit based on the waveform: https://archive.blender.org/developer/maniphest/0090/0090824/index.html
When Billray was working for BF, we talked about rounded strips, so it would become more clear where the in and out points are - and having thin rounded handles following the outline.
Another design could be to have handles which are not in the full height of the strip and have rounded corners inwards(indicating direction).
Consider a hot zone in the center of a strip and a new mouse cursor in order to execute the Slip operator.
Consider making an e/w icon variation of then e/w/n/s icon for when handles are transformed, since they can't be moved up or down.
@blender-bot package
Package build started. Download here when ready.
Thanks for the update on this. A couple of suggestions:
@fsiddi Chat is down so will respond here - will kick the bot, just wanted to do some fixes. There is still minor discrepancy on how transform works when you use right and left mouse button. LMB in RCS works as expected, all other modes won't deselect neighboring handle when moving only one of them. Will fix that.
With modified keymap, this feature can be optional as we wanted, but there will be some weird items that are basically blocked by select and frame change operator. It is bit more readable now, but still worth documenting
@blender-bot package
Package build started. Download here when ready.
As noted above, when selecting/transforming two adjoined handles, the selected handle on one of the sides is not visible(looks like the outline).
https://projects.blender.org/blender/blender/attachments/b80eb3f9-6054-4c1c-b60f-96af62c0e353 Both selected handles should be visible.
As the mouse cursor should illustrate what happens when the user is clicking, when two adjoined handles are selected, the mouse cursor should not be changed to single side transform, since this in not what will happen:
During a transform operation, the mouse cursor is changed from the handle cursor to n/s/e/w cursor. Imo, it should stay as handle cursor.
The little arrow on the single sided handle cursor seems redundant, and even misleading, as if you only can move the handle one direction?
There could also be a hot zone in the middle of a strip for the Slip operation and the mouse cursor could look like this: [ ]
WIP: VSE handle drawing/tweaking experimentto VSE handle drawing/tweaking experimentSeems, that handle size is sometimes drawn as 5px, sometimes as 4px. Will rebase this patch and check how this can be resolved. In meanwhile, will just increase handle width so I don't mix fixes in this patch.
@blender-bot package
Package build started. Download here when ready.
The multiple challenges of thin handles were already addressed here:
https://archive.blender.org/developer/differential/0010/0010297/index.html
This imprecise drawing of the line width, make thin handles disappear and blend in with the outline. A solution to this in the above link was to either select outlines or handles, and never both. When you think about it, there is no reason for having both selected. And not having the outline selected when a handle is selected makes the handle stand out.
Another problem is the two adjoined handles may look like one, to solve this problem, a separating line was introduced, and with bracket shapes added, made it very clear in what direction the handle went (and what strip the handle belonged to).
In addition to these challenges, when zoomed out in the timeline, the handles become very small and potentially invisible(especially when they're thin to begin with) - has this been dealt with in this patch?
Since there are no replies to any of my comments above, I wonder if the addressed problems are not considered problems, or what is going on here?
Makes sense, will try that.
I think, that having black outline visible when handle is selected may be necessary, since both strips share that pixel as start/end.
Don't think, that this is an issue really. Currently it is not possible to select handles when they are too small and I did not change it here.
This started with simple goal - to draw cursor when hovering over handle + to make them slimmer. More changes I would rather separate unless they are necessary for functionality.
When releasing (only after dragging), deselect the handle and leave the strip selected. This allows us to still select individual and multiple handles, but allows us to quickly transform a whole strip once is has been resized.
I can do that, but with current setup, handles would be deselected even if you press G key, which I don't think is desirable. The only way transform operator can discriminate between 2 behaviors is whether this tweaking method is enabled in preferences.
Maybe I can hack in some form of signalling in
SpaceSeq::runtime
, but that would be based on mouse cursor position and unreliable.Though looking at
TransInfo
, there isis_launch_event_drag
field, so will check that out. Would definitely simplify things...@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
The mouse cursor, when moving the cursor over a narrow strip, it feels like the click point in the cursor is jumping back/forth(left/right) because the click point is actually changing position, and this feels wrong. The click point in left/center/right handle cursor should be in the same place. So, I would say in the left/right mouse cursor, the vertical bar and the click point should be in the center and the tiny arrow should be removed. This way will the horizontal line in the left/right handle cursor change side and the vertical line will stay in the same place.
Also, it feels like the hot zones are too big in a strip with a considerable size you will not get the grab strip(not handle option):
In the center area, the n/s/e/w cursor could be used? (Also then pressing "S" for slide)?
When handles are selected and pressing "G" only e/w cursor should be used, bc they can't be moved up/down.
When transforming adjoined handles, they look asymmetrical(outline when drag is imprecise?):
Have you tried removing outlines when handles are selected? As suggested above?
IMO, there is no need to both have an outline and a handle selected.
In the 3D View, you do not have both have a vertex and the object selected.
Previously you could not transform effect strips with fixed length like cross, you can do that now. I guess that til is a bug?
Was there a limit before so you could not drag like this, but only to the allowed point? Looks wonky.
I don't know. Personally I feel lost when using cursors without arrows. I would like to gather more feedback on this point, but I wouldn't mind either variant.
That seems to be correct, will fix
I mean it could be used, but it is for different purpose. The handle cursor only indicates what you are clicking on, NSEW cursor indicates what you can do or what will happen after clicking. This patch is pretty much pre-selection indicator, but with cursor instead element highlighting.
I have played with this briefly, but wasn't able to fix it. Maybe this is some pixel alignment issue with view coords, not sure.
Yep, tat's a bug
Nope, there wasn't such limit. Not impossible to implement, there already is limit for strip length.
If you want to keep the arrows, then maybe try to keep the selection point the same place in the mouse cursor icon. In other words, keep the point the arrows are pointing at the very same place in all VSE selection/trimming icons.
IMO, have the elements highlighting still a place, especially if the unselected handle indicators are removed(they should be visible, when hover). On the nsew, another wording would be, that it is simply wrong to use it after a handle has been selected, because in that case is it impossible to move ns. And the EW icon will be an indication of what will happen if you click and drag at that point.
In my attempt, mentioned above, I kept a black line between the strips in all states, so the strips will not be "fighting" over the center pixel, and make things asymmetrical.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Good progress. A couple of notes:
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
@fsiddi Updated the patch with suggestions. Not sure if you want handles as standalone overlay, or whether this should be updated when you enable/disable Tweak Handles option. Right now it is standalone overlay option.
It's better, but there is still an issue, when strips get narrow:
It doesn't feel very clear and solid what will happen if you click at a specific point this way. Imo, some hover highlighting of the handle area is needed to make it more predictable and easy to read what is being clicked. The click area of the handles could light up like these buttons(I mean, it is not a new concept in Blender that things you can click lights up when hovering over them):
@tintwotin Thanks for noticing that, will fix. I think the idea behind cursor is to emulate gizmo. Some gizmos use highlighting as well so this could be done with handles.
@blender-bot package
Package build started. Download here when ready.
Looks good to me. Get some code review and merge!
I would recommend doing a test-build and get community feedback on it, since this is a major change in how it feels to work in the VSE. As mentioned, without handle hover highlighting, it feels very random in what area you need to click to select a handle, especially when the strips are narrow. Did Hjalti test it?
Should definitely make a test build and make a feedback thread on devtalk. The hover effect is something done in properties editor, but not in other parts of Blender, I rather stay aligned with that for the time being. Hjalti is not a fan of this feature, so I don't think he will use it. As a matter of fact, it's possible to configure Blender to its original behavior and completely ignore this.
Will have to go over this patch again myself, as the code is not great. Will make feedback thread.
I had to edit some footage today, so I used this patch.
Some workflows are worse off:
Some better
Also noticed, that handles are drawn on too small strips, will have to fix that too, since now it is guesswork to know at which zoom level the handle can be selected.
I rarely use adjoined selection (in this edit 0 times eh :), so I would say it's downside for me, since it interferes with handle selection when strips are next to each other, but can imagine some users loving it.
Overall I would like to have option to just disable adjoined selection behavior and perhaps make the cursor somehow slimmer.
08b3db9e95
to3ffc3e7f2f
VSE handle drawing/tweaking experimentto VSE: improved handle tweaking@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Had some issues applying the patch, so was testing builds from https://builder.blender.org/download/patch/PR109522/
There is something very wrong with the keymap and overall behavior:
Will update the patch. Not sure if I tested this on Mac last time I updated patch, but there isn't anything too OS specific, maybe DPI scale...
I can reproduce issue with RMB scrubbing, it works here for about 50% of time, will fix this.
Other issues I was not able to reproduce. Will also doublecheck on Mac.
Thanks for the update, it seems to have helped with some of the points from my previous comment, but not all of them.
For example, frame scrubbing is still not possible outside of the timecode header with RMB selection.
Also, the hot-zones feels smaller to what they are for area edge sliding, or node edge resizing.
Indeed, checking now on mac, and this still needs some work.
@Sergey The issues you have mentioned should be fixed.
@blender-bot package
Package build started. Download here when ready.
@ -946,2 +946,4 @@
}
if (!USER_VERSION_ATLEAST(402, 19)) {
userdef->sequencer_editor_flag |= USER_SEQ_ED_SIMPLE_TWEAKING;
userdef_default.cc
needs to have thesequencer_editor_flag
flag set as well. Otherwiseblender --factory-startup
does not have the new intended behavior.@ -230,6 +246,9 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event
if (CTX_wm_space_seq(C) != nullptr && region->regiontype == RGN_TYPE_PREVIEW) {
return OPERATOR_CANCELLED;
}
if (sequencer_skip_for_handle_tweak(C, event)) {
Generic animation system operator should not worry about sequencer.
The way such dependencies were commonly used is via order of operators in the keymap. If sequencer tweaking needs to take priority, it should be in the list first, and the rest of operators should not be adjusting to the behavior of other operators.
The issue here is, that we want left click to tweak and also scrub. Only other way to achieve this would be to passthrough from sequencer select operator. But to achieve that, it would need to check if it was invoked by left or right click. I guess I could add hidden operator property which would distinguish how it was invoked. Either way it is hacky.
Why can't the handle tweak event always return
PASS_THROUGH
when it is invoked outside of any handle's hot area?Because it is select operator and if I am not mistaken in RCS it is not modal. At least it isn't when invoked with left click.
@ -46,3 +49,3 @@
void ED_sequencer_special_preview_set(bContext *C, const int mval[2]);
void ED_sequencer_special_preview_clear();
bool sequencer_retiming_mode_is_active(const bContext *C);
bool sequencer_retiming_mode_is_active(const Scene *scene);
Why is the
sequencer_retiming_mode_is_active
changing with this PR?I would guess that at some point I tried to use it from place with no access to
bContext
, but then changed this again.Will revert this change.
Some feedback to finalize this patch from the UX standpoint:
@fsiddi
Tweak handles is enabled by default. It could be, that you have your own startup file, AFAIK these are not changed by versioning. Eeh not sure, perhaps adding this to
userdef_default.c
would solve the issue for you.In RCS, when dragging with left click, only 1 element moves, when dragging with right click, whole selection moves. I have a feeling, that we have discussed this, but could be mistaken. Will change this to work same way with both buttons.
shift click drag is not a thing? What is that supposed to do?
@blender-bot package
Package build started. Download here when ready.
Yes, please.
Nothing, you are right. Was expecting precision tweak, but that happens only after you click.
@fsiddi Right so I did that. You can test the new build.
Ok I did that, so you can test the new build.
Some final visual adjustments to the cursor. Notice the updated position. This might still not be perfect as I could not test the changes directly in the code.
Also, a suggestion on the design itself.
I assume this means, that you want cursor to be centered? I had build like that for feedback, but was likely broken when I checked devtalk thread now... Anyway, it's simple change so will do that, even though I don't like it that way - The triangle is supposed to be mini cursor, which is aligned with mouse position. Perhaps it could be removed, or those triangles could be drawn on both sides.
Currently only 16x16 pure black/white/transparent are supported by these cursor definitions. I could look at other type of cursors that are used for transformation, those seem to support at least grayscale, but not sure if these can be used in this case.
@blender-bot package
Package build started. Download here when ready.
@iss Could this be updated to the latest
main
please? It'd make it easier to review as I'm having issues which I'm not sure are part of this PR or already fixed in main.(for example, I can't select time-locked strips)
@pablovazquez Updated PR. Can reproduce no selection with locked strips. Will fix.
7322bbf4b2
to88dccb8a19
It would help to move all the non-functional changes refactors to main, to help understanding what's going on here, and whether the added complexity is really inevitable.
For example, changes like
Sequence *SEQ_select_active_get(Scene *scene);
->Sequence *SEQ_select_active_get(const Scene *scene);
,selected_strips_from_context
->ED_sequencer_selected_strips_from_context
,bool retiming_keys_are_visible(const bContext *C)
->bool retiming_keys_are_visible(const SpaceSeq *sseq)
.I can do that, the commit would make little sense out of context of this PR. So I will reference this PR in commit message.
@iss Sounds good!
Also, if there are some other non-functional-changes/cleanup possible to extract from this PR which wasn't so obvious on an initial read, feel free to to the same :)
Just compiled it and it works great! Thanks for fixing the selection of time locked strips.
(Can remember that at some point, testing a build of this patch, it wasn't possible to drag the play head, and as I do not have a built environment anymore, could it be checked if this is working again, before committing?)
@blender-bot package
Package build started. Download here when ready.
487a4cbfaf
to9517179fb2
@Sergey Most of refactoring was pushed to main now.
Thanks for the cleanup. Now it is easier to see what exactly is going on.
There are few inlined comments. On top of that i am not sure why do we need the complexity around the keymap changes. Unless it is absolutely needed by this change, it is better to avoid such changes. And from my quick test wed don't need to make those changes as part of this PR. I've attached a take on simplifying this patch even further. From quick tests it seems to behave exactly as this PR does.
Generally, do not make change more deep/complex/involved than it needs to be. And if it is inevitable, make it clear from the description why is it so.
@ -1 +1 @@
Subproject commit 0b910c0a718a1d54d07ecf95c63617576ee9a847
Subproject commit 7181d6dccb9fe4184340f9f5b1c381f8089fe4ec
Seems like an unintended change?
@ -51,0 +54,4 @@
*
* r_seq1 first strip to be selected. Never nullptr if function returns true
* r_seq2 second strip to be selected.
* r_side which handle is selected. This further clarifies result if seq2 is nullptr.
What is the possible values for the
r_side
? From being an integer it is not clear at all.This is anonymous enum defined in
SEQ_sequencer.hh
It is not great, since it is used for splitting and handle selection. Probably would be best to "duplicate" this enum and give it purposeful name...@ -51,0 +56,4 @@
* r_seq2 second strip to be selected.
* r_side which handle is selected. This further clarifies result if seq2 is nullptr.
*/
bool ED_sequencer_handle_selection_refine(const struct Scene *scene,
This is quite confusing name.
handle
is ambiguous since it is not clear if it is a verb or a noun. Andrefine
is also not used properly here, as it is not semantically a refinement of input parameters.Perhaps
ED_sequencer_pick_strip_and_side
?The return value is also never checked, so it will be better to wrap
r_seq{1,2}
andr_side
into a struct and return it. Will avoid need to initialize individual fields. Similarly toPointTrackPick
.@ -894,0 +982,4 @@
return false;
});
/* It may be better to sort strips, as there can be very small strip in set, that may not be
What is the problem with a small strip? Why is the sorting only done for the first 2 elements? And what is the issue with using
std::sort
?This should have been marked as TODO, will need to solve this.
The problem with small strips is, that Francesco requested to be able to select handle from outside of the strip. This means, that strip with < ~2px screenspace size could be between 2 larger strips. And this is not filtered out. But seems, that this would be easy to solve by actually checking its size.
@ -894,0 +1026,4 @@
return SEQ_SIDE_NONE;
}
static bool both_handles_are_selected(const Scene *scene,
What exactly this function does?
It checks if 2 handles next to each other are selected at conce.
@ -645,6 +647,93 @@ static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscri
}
}
static bool mouseover_retiming_key(const Scene *scene,
is_mouse_over_retiming_key
?@ -648,0 +701,4 @@
int side;
Sequence *seq1, *seq2;
ED_sequencer_handle_selection_refine(scene, ®ion->v2d, mouse_co_view, &seq1, &seq2, &side);
The way how currently this function works, it will create a temporary array of all visible strips (which could be 100s) on every mouse move. It is not something we should be accepting easily.
There are easy ways of solving this, having minimal code duplication:
Can even optimize it further by pre-calcualting channel from the mouse, doing an early output for strips outside of that channel.
@ -383,6 +446,11 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
t->flag |= T_MODAL_CURSOR_SET;
WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL);
}
/* On ly use special cursor, when tweaking strips with mouse. */
On ly
->Only
The change around
SEQ_SIDE_LEFT
->SEQ_HANDLE_RIGHT
needs to be moved to a separate PR. Having a stringer type enum for such things sounds good, but:Also, maybe I am missing something, but there is an outstanding question about why it is required to split keymap on timeline and preview. It might be good for some other reasons, but it does not seem essential for getting functionality of this PR to work, unless there is something non-obvious going on (which then should be clearly and explicitly described).
@ -17,0 +19,4 @@
enum eSeqHandle {
SEQ_HANDLE_NONE = 0,
SEQ_HANDLE_LEFT = SEQ_LEFTSEL,
You should not be mixing semantic of some of elements of enum. Doing so might seem that it saves some code, but in practice it leads to confusions situations when some flag might be directly used for something completely unrelated, but not the other flags (potentially even causing actual bugs later on, after some of the area got expanded).
@ -17,0 +24,4 @@
SEQ_HANDLE_BOTH,
};
struct StripSelection {
Since this is C++, you can benefit from the implicit default constructor:
This will allow making some code more reslitient and clear towards possible refactors in the future.
@ -101,3 +101,3 @@
#define RETIME_KEY_MOUSEOVER_THRESHOLD (16.0f * UI_SCALE_FAC)
static rctf retiming_keys_box_get(const Scene *scene, const View2D *v2d, const Sequence *seq)
rctf retiming_keys_box_get(const Scene *scene, const View2D *v2d, const Sequence *seq)
Public functions should either be in the corresponding namespace. such as
blender::ed::seq
(which is more preferred way nowadays), or have an old-style prefix in the name. such asED_seq_retiming_keys_box_get
orsequencer_retiming_keys_box_get
.Even though the function is "intern" to the
space_sequencer
, it is public from the linkage perspective.@ -897,0 +992,4 @@
if (seq->machine != int(mouse_co[1])) {
continue;
}
if (min_ii(SEQ_time_left_handle_frame_get(scene, seq), SEQ_time_start_frame_get(seq)) >
Do we need to worry about the
SEQ_time_start_frame_get(seq)
/SEQ_time_content_end_frame_get(scene, seq)
or can we limit this to justSEQ_time_left_handle_frame_get(scene, seq)
/SEQ_time_right_handle_frame_get(scene, seq)
?@ -897,0 +1018,4 @@
if (strips.size() == 2 && strip_to_frame_distance(scene, v2d, strips[0], mouse_co[0]) <
strip_to_frame_distance(scene, v2d, strips[1], mouse_co[0]))
{
SWAP(Sequence *, strips[0], strips[1]);
std::swap
.@ -897,0 +1034,4 @@
return s1_right == s2_left || s1_left == s2_right;
}
static eSeqHandle handle_selection_refine(const Scene *scene,
get_strip_handle_under_cursor()
?@ -897,0 +1051,4 @@
return SEQ_HANDLE_NONE;
}
static bool both_handles_are_selected(const Scene *scene,
is_mouse_over_both_handles_of_adjacent_strips
. While it might seen lengthy, it actually shows clear intent of what is going on: makes it unambiguous what are the handles which are checked, and also clarifies that check is based on coordinates, and not on selection flags.@ -897,0 +1054,4 @@
static bool both_handles_are_selected(const Scene *scene,
const Sequence *seq1,
const Sequence *seq2,
eSeqHandle seq1_side,
seq1_handle
. But is also wierd to require passing one of the handles. Might as well just re-compute it here and simplify the function signature without introducing much penalty to hot code paths?@ -897,0 +1058,4 @@
const View2D *v2d,
float mouse_co[2])
{
if ((U.sequencer_editor_flag & USER_SEQ_ED_SIMPLE_TWEAKING) == 0) {
This seems to be quite low-level function to perform such a check. Such branching in behavior should be done on a higher level.
You can easily see it from trying to summarize what function does: check whether adjacent handles are selected, but only if the user preference is not the simple tweaking.
@ -897,0 +1067,4 @@
if (!strips_are_adjacent(scene, seq1, seq2)) {
return false;
}
const int seq2_side = handle_selection_refine(scene, seq2, v2d, mouse_co);
eSeqHandle seq2_handle
.@ -940,2 +1148,3 @@
StripSelection selection;
if (region->regiontype == RGN_TYPE_PREVIEW) {
seq = seq_select_seq_from_preview(C, mval, toggle, extend, center);
selection.seq1 = seq_select_seq_from_preview(C, mval, toggle, extend, center);
With the current code you're leaving
seq2
andhandle
uninitialized. The proposal aroundStripSelection
solves this.Checkout
From your project repository, check out a new branch and test the changes.