VSE: improved handle tweaking #109522

Merged
Richard Antalik merged 30 commits from iss/blender:tweak-experiment into main 2024-06-03 23:17:51 +02:00

This commit changes how users can interact with handles:

Unselected handles are not drawn anymore by default. 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 on unselected handle, handle selection is lost
ater tweaking.

This behavior can be disabled in preferences:
Editing > Video Sequencer > Tweak Handles.

Moving strips with G key works same way as before.

This commit changes how users can interact with handles: Unselected handles are not drawn anymore by default. 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 on unselected handle, handle selection is lost ater tweaking. This behavior can be disabled in preferences: Editing > Video Sequencer > Tweak Handles. Moving strips with G key works same way as before.
Richard Antalik added 2 commits 2023-06-29 17:53:25 +02:00
Add handle cursors, tweak select fallback condition.
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
3ad1686fdf
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 1 commit 2023-06-30 15:32:33 +02:00
implement double handle selection
Some checks reported errors
buildbot/vexp-code-patch-coordinator Build done.
258b624711
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 2 commits 2023-07-13 04:54:40 +02:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
First-time contributor

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:
image

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
image

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.

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: ![image](/attachments/b80eb3f9-6054-4c1c-b60f-96af62c0e353) 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 ![image](/attachments/5dfee019-8579-4125-823f-37087ae1652f) 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.
Richard Antalik added 2 commits 2023-09-21 23:43:01 +02:00
Richard Antalik requested review from Francesco Siddi 2023-09-21 23:43:33 +02:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

Thanks for the update on this. A couple of suggestions:

  • Please make sure that the feature works when using right-click-select
  • Do not switch cursor to the 4 arrows when transforming the edges of a clip
Thanks for the update on this. A couple of suggestions: * Please make sure that the feature works when using right-click-select * Do not switch cursor to the 4 arrows when transforming the edges of a clip
Richard Antalik added 1 commit 2023-09-22 00:07:43 +02:00
Richard Antalik added 1 commit 2023-09-22 00:10:00 +02:00
Richard Antalik added 3 commits 2023-11-18 01:35:50 +01:00
Richard Antalik added 2 commits 2023-11-20 05:54:17 +01:00
Fix Box selec not working
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
4c71bd35ec
Author
Member

@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

@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
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
First-time contributor

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:
trim_cursor_adjoined.gif

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: [ ]

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: ![trim_cursor_adjoined.gif](/attachments/3b573775-a6d3-433a-8b7c-af2d953bfb21) 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: [ ]
Richard Antalik added 2 commits 2023-12-01 17:38:33 +01:00
Richard Antalik added 1 commit 2023-12-01 18:37:09 +01:00
Richard Antalik changed title from WIP: VSE handle drawing/tweaking experiment to VSE handle drawing/tweaking experiment 2023-12-01 18:41:12 +01:00
Author
Member

Seems, 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.

Seems, 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.
Richard Antalik added 1 commit 2023-12-01 19:28:46 +01:00
Increase handle size by 1px due to imprecision in drawing
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.
a74c28d31d
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
First-time contributor

Seems, 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.

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?

> Seems, 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. 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?
Author
Member

Seems, 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.

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.

Makes sense, will try that.

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).

I think, that having black outline visible when handle is selected may be necessary, since both strips share that pixel as start/end.

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?

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.

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?

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.

> > Seems, 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. > > 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. Makes sense, will try that. > 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). I think, that having black outline visible when handle is selected may be necessary, since both strips share that pixel as start/end. > 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? 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. > 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? 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.

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.
Author
Member

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 is is_launch_event_drag field, so will check that out. Would definitely simplify things...

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 is `is_launch_event_drag` field, so will check that out. Would definitely simplify things...
Richard Antalik added 2 commits 2023-12-10 19:52:05 +01:00
Deselect handles after tweaking
Some checks failed
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
6a12c8b1fe
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 1 commit 2024-01-11 18:27:58 +01:00
Fix unused variables, only change cursor when dragging with mouse.
Some checks failed
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
012726217b
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 1 commit 2024-01-11 18:43:31 +01:00
Merge branch 'main' into tweak-experiment
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
a707721135
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
First-time contributor

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):
mouse_cursor.gif

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?):
image
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?
cross_transform.gif

Was there a limit before so you could not drag like this, but only to the allowed point? Looks wonky.
limit_transform.gif

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): ![mouse_cursor.gif](/attachments/dfd98e08-1d11-46ac-bdba-a4dff471c2cf) 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?): ![image](/attachments/2d82ceaa-3358-479f-bd18-93a3771b126f) 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? ![cross_transform.gif](/attachments/7c5d303a-bbe7-4dd3-abd5-52f181bc7fd3) Was there a limit before so you could not drag like this, but only to the allowed point? Looks wonky. ![limit_transform.gif](/attachments/17bd0e8a-489d-4cfb-9013-d3a0b5bb33d3)
Author
Member

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.

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.

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):
mouse_cursor.gif

That seems to be correct, will fix

In the center area, the n/s/e/w cursor could be used? (Also then pressing "S" for slide)?

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.

When transforming adjoined handles, they look asymmetrical(outline when drag is imprecise?):
image
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.

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.

Previously you could not transform effect strips with fixed length like cross, you can do that now. I guess that til is a bug?
cross_transform.gif

Yep, tat's a bug

Was there a limit before so you could not drag like this, but only to the allowed point? Looks wonky.
limit_transform.gif

Nope, there wasn't such limit. Not impossible to implement, there already is limit for strip length.

> 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. 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. > 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): > ![mouse_cursor.gif](/attachments/dfd98e08-1d11-46ac-bdba-a4dff471c2cf) That seems to be correct, will fix > In the center area, the n/s/e/w cursor could be used? (Also then pressing "S" for slide)? 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. > When transforming adjoined handles, they look asymmetrical(outline when drag is imprecise?): > ![image](/attachments/2d82ceaa-3358-479f-bd18-93a3771b126f) > 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. 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. > Previously you could not transform effect strips with fixed length like cross, you can do that now. I guess that til is a bug? > ![cross_transform.gif](/attachments/7c5d303a-bbe7-4dd3-abd5-52f181bc7fd3) Yep, tat's a bug > Was there a limit before so you could not drag like this, but only to the allowed point? Looks wonky. > ![limit_transform.gif](/attachments/17bd0e8a-489d-4cfb-9013-d3a0b5bb33d3) Nope, there wasn't such limit. Not impossible to implement, there already is limit for strip length.
First-time contributor

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.

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.

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.

In the center area, the n/s/e/w cursor could be used? (Also then pressing "S" for slide)?

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.

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.

When transforming adjoined handles, they look asymmetrical(outline when drag is imprecise?):
image
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.

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.

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.

> > 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. > > 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. 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. > > In the center area, the n/s/e/w cursor could be used? (Also then pressing "S" for slide)? > > 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. 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. > > > When transforming adjoined handles, they look asymmetrical(outline when drag is imprecise?): > > ![image](/attachments/2d82ceaa-3358-479f-bd18-93a3771b126f) > > 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. > > 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. 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.
Richard Antalik added 5 commits 2024-02-27 20:51:19 +01:00
Ultimately this was due to missing nullptr check before trying to
process the image, but this should have been caught when loading
ImBufAnims. If any is missing, cancel multiview loading and load
movie as if it was single view only.
Refine selection a bit
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
ed369943f8
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 2 commits 2024-02-28 15:34:28 +01:00
make format
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
4c43aece4c
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

Good progress. A couple of notes:

  • when two clips are adjacent, make sure their handles can be selected individually as well. This this means having three zones, left center and right of the cut, showing three different icons.
  • make sure handles can be drawn as an overlay
  • rename the Preferences>Editing>Video Sequencer>Simplified Handle Tweaking to "Tweak Handles", and make sure that when disabled it actually works
Good progress. A couple of notes: - when two clips are adjacent, make sure their handles can be selected individually as well. This this means having three zones, left center and right of the cut, showing three different icons. - make sure handles can be drawn as an overlay - rename the Preferences>Editing>Video Sequencer>Simplified Handle Tweaking to "Tweak Handles", and make sure that when disabled it actually works
Richard Antalik added 4 commits 2024-03-06 17:17:10 +01:00
Richard Antalik added 1 commit 2024-03-06 19:13:24 +01:00
Add handle overlay option
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
620fb4e836
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 1 commit 2024-03-06 20:44:27 +01:00
Fix incorrect selection of both handles
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
9e95bc585a
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Author
Member

@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.

@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.
First-time contributor

It's better, but there is still an issue, when strips get narrow:
mouse_c.gif

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):

It's better, but there is still an issue, when strips get narrow: ![mouse_c.gif](/attachments/29f0cb34-5200-492d-8da5-c2e55c8fed5f) 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):
Author
Member

@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.

@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.
Richard Antalik added 1 commit 2024-03-07 20:58:17 +01:00
Richard Antalik added 1 commit 2024-03-07 21:13:24 +01:00
Fix handle transform text
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
dd7c5df122
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

Looks good to me. Get some code review and merge!

Looks good to me. Get some code review and merge!
First-time contributor

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?

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.

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.
Author
Member

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:

  • Interferes with blade tool (should be fixed)
  • Interferes with scrubbing area (should be fixed)
  • Previously handles of shorter strips could be selected due to width of cursor
    • This seems to affect also when tweaking option is off (should be fixed)

Some better

  • No longer translating only handle when I forget to deselect it
  • Visual feedback for selection

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.

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: - Interferes with blade tool (should be fixed) - Interferes with scrubbing area (should be fixed) - Previously handles of shorter strips could be selected due to width of cursor - This seems to affect also when tweaking option is off (should be fixed) Some better - No longer translating only handle when I forget to deselect it - Visual feedback for selection 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.
Richard Antalik force-pushed tweak-experiment from 08b3db9e95 to 3ffc3e7f2f 2024-03-18 20:44:07 +01:00 Compare
Richard Antalik added 1 commit 2024-03-18 22:18:26 +01:00
Richard Antalik added 1 commit 2024-03-19 22:39:43 +01:00
Richard Antalik changed title from VSE handle drawing/tweaking experiment to VSE: improved handle tweaking 2024-03-19 22:56:37 +01:00
Richard Antalik added 1 commit 2024-03-20 18:03:03 +01:00
Fix incorrect validation of existing selection
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
7eac65ad69
Richard Antalik requested review from Sergey Sharybin 2024-03-20 18:05:08 +01:00
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 3 commits 2024-03-22 19:55:25 +01:00
Draw larger handles when this feature is disabled.
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
2af5f36b43
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) 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:

  • Hovering over the handles does not change cursor shape on macOS
  • Handles are not deselected after tweak
  • I could not get the selection of two adjacent handles to work
  • Frame scrubbing is forced to only happen when dragging on the timecode (previously when RMB selection scrubbing was possible in any empty place of the editor)
  • Selection hot zones seems strange as well: quite often clicking on a handle of adjacent strips selects handle of an adjacent strip, not the strip on which click happened
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: - Hovering over the handles does not change cursor shape on macOS - Handles are not deselected after tweak - I could not get the selection of two adjacent handles to work - Frame scrubbing is forced to only happen when dragging on the timecode (previously when RMB selection scrubbing was possible in any empty place of the editor) - Selection hot zones seems strange as well: quite often clicking on a handle of adjacent strips selects handle of an adjacent strip, not the strip on which click happened
Author
Member

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.

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.

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.
Author
Member

Indeed, checking now on mac, and this still needs some work.

Indeed, checking now on mac, and this still needs some work.
Author
Member

@Sergey The issues you have mentioned should be fixed.

@Sergey The issues you have mentioned should be fixed.

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Sergey Sharybin reviewed 2024-04-24 15:29:25 +02:00
@ -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 the sequencer_editor_flag flag set as well. Otherwise blender --factory-startup does not have the new intended behavior.

`userdef_default.cc` needs to have the `sequencer_editor_flag ` flag set as well. Otherwise `blender --factory-startup` does not have the new intended behavior.
iss marked this conversation as resolved
@ -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.

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.
Author
Member

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.

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?

Why can't the handle tweak event always return `PASS_THROUGH` when it is invoked outside of any handle's hot area?
Author
Member

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.

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?

Why is the `sequencer_retiming_mode_is_active` changing with this PR?
Author
Member

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.

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.
iss marked this conversation as resolved

Some feedback to finalize this patch from the UX standpoint:

  • Enable Tweak Handles preference by default
  • Remove handles overlay option from VSE
  • Draw handles overlay only when Tweak Handles is off
  • With RCS: when multiple strips are selected, tweaking the handles should transform all selected strips, not only one (works with LCS)
  • With RCS: shift click drag to tweak handles currently does not work
Some feedback to finalize this patch from the UX standpoint: - Enable Tweak Handles preference by default - Remove handles overlay option from VSE - Draw handles overlay only when Tweak Handles is off - With RCS: when multiple strips are selected, tweaking the handles should transform all selected strips, not only one (works with LCS) - With RCS: shift click drag to tweak handles currently does not work
Author
Member

@fsiddi

Enable Tweak Handles preference by default

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.

With RCS: when multiple strips are selected, tweaking the handles should transform all selected strips, not only one (works with LCS)

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.

With RCS: shift click drag to tweak handles currently does not work

shift click drag is not a thing? What is that supposed to do?

@fsiddi > Enable Tweak Handles preference by default 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. > With RCS: when multiple strips are selected, tweaking the handles should transform all selected strips, not only one (works with LCS) 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. > With RCS: shift click drag to tweak handles currently does not work shift click drag is not a thing? What is that supposed to do?
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

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.

Yes, please.

With RCS: shift click drag to tweak handles currently does not work

shift click drag is not a thing? What is that supposed to do?

Nothing, you are right. Was expecting precision tweak, but that happens only after you click.

> 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. > Yes, please. > > With RCS: shift click drag to tweak handles currently does not work > > shift click drag is not a thing? What is that supposed to do? Nothing, you are right. Was expecting precision tweak, but that happens only after you click.
Author
Member

@fsiddi Right so I did that. You can test the new build.

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.

Yes, please.

Ok I did that, so you can test the new build.

@fsiddi Right so I did that. You can test the new build. > > > 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. > > > > Yes, please. 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.

Regular Current Expected
c_01.png c_02.png c_03.png

Also, a suggestion on the design itself.

Current Proposed
c_04.png c_05.png)
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. | Regular | Current | Expected | | -------- | ------- | --- | | ![c_01.png](/attachments/76968a53-3b7c-44aa-90f6-df0d4d4c6249) | ![c_02.png](/attachments/ffb2ecbb-375f-481e-b9ac-631c5ba38ab9) | ![c_03.png](/attachments/dee2c1e9-bec7-4664-bb64-9b66fdd55d1c) | Also, a suggestion on the design itself. | Current | Proposed | | -- | -- | | ![c_04.png](/attachments/31d0ea18-3033-44fd-a6d1-584f30218cbc) | ![c_05.png](/attachments/8d093654-14e3-45c0-bd96-dc46f25bca59)) |
10 KiB
9.5 KiB
6.5 KiB
10 KiB
4.2 KiB
Author
Member

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.

Regular Current Expected
c_01.png c_02.png c_03.png

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.

Also, a suggestion on the design itself.

Current Proposed
c_04.png c_05.png)

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.

> 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. > > | Regular | Current | Expected | > | -------- | ------- | --- | > | ![c_01.png](/attachments/76968a53-3b7c-44aa-90f6-df0d4d4c6249) | ![c_02.png](/attachments/ffb2ecbb-375f-481e-b9ac-631c5ba38ab9) | ![c_03.png](/attachments/dee2c1e9-bec7-4664-bb64-9b66fdd55d1c) | 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. > Also, a suggestion on the design itself. > > | Current | Proposed | > | -- | -- | > | ![c_04.png](/attachments/31d0ea18-3033-44fd-a6d1-584f30218cbc) | ![c_05.png](/attachments/8d093654-14e3-45c0-bd96-dc46f25bca59)) | > 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.
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Member

@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)

@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)
Author
Member

@pablovazquez Updated PR. Can reproduce no selection with locked strips. Will fix.

@pablovazquez Updated PR. Can reproduce no selection with locked strips. Will fix.
Richard Antalik force-pushed tweak-experiment from 7322bbf4b2 to 88dccb8a19 2024-05-01 06:41:56 +02:00 Compare

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).

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)`.
Author
Member

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.

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.

> 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. 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 :)

@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 :)
Member

Just compiled it and it works great! Thanks for fixing the selection of time locked strips.

Just compiled it and it works great! Thanks for fixing the selection of time locked strips.
First-time contributor

(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?)

(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?)
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik force-pushed tweak-experiment from 487a4cbfaf to 9517179fb2 2024-05-07 13:44:06 +02:00 Compare
Richard Antalik added 1 commit 2024-05-07 13:48:58 +02:00
Author
Member

@Sergey Most of refactoring was pushed to main now.

@Sergey Most of refactoring was pushed to main now.
Sergey Sharybin requested changes 2024-05-07 16:15:24 +02:00
Dismissed
Sergey Sharybin left a comment
Owner

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.

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?

Seems like an unintended change?
iss marked this conversation as resolved
@ -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.

What is the possible values for the `r_side` ? From being an integer it is not clear at all.
Author
Member

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...

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...
iss marked this conversation as resolved
@ -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. And refine 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} and r_side into a struct and return it. Will avoid need to initialize individual fields. Similarly to PointTrackPick.

This is quite confusing name. `handle` is ambiguous since it is not clear if it is a verb or a noun. And `refine` 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}` and `r_side` into a struct and return it. Will avoid need to initialize individual fields. Similarly to `PointTrackPick`.
iss marked this conversation as resolved
@ -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 ?

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` ?
Author
Member

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.

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.
iss marked this conversation as resolved
@ -894,0 +1026,4 @@
return SEQ_SIDE_NONE;
}
static bool both_handles_are_selected(const Scene *scene,

What exactly this function does?

What exactly this function does?
Author
Member

It checks if 2 handles next to each other are selected at conce.

It checks if 2 handles next to each other are selected at conce.
iss marked this conversation as resolved
@ -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 ?

`is_mouse_over_retiming_key ` ?
iss marked this conversation as resolved
@ -648,0 +701,4 @@
int side;
Sequence *seq1, *seq2;
ED_sequencer_handle_selection_refine(scene, &region->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:

static blender::Vector<Sequence *> mouseover_strips_sorted_get(const Scene *scene,
                                                               const View2D *v2d,
                                                               float mouse_co[2])
{
  blender::Vector<Sequence *> strips;
  LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) {
    if (!is_strip_visible(v2d, seq)) {
      continue;
    }
    const rctf body = strip_clickable_area_get(scene, v2d, seq);
    if (!BLI_rctf_isect_pt_v(&body, mouse_co)) {
      continue;
    }
    strips.append(seq);
  }
  // sort. or even do sorting while a
  return strips;
}

Can even optimize it further by pre-calcualting channel from the mouse, doing an early output for strips outside of that channel.

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: ```Cpp static blender::Vector<Sequence *> mouseover_strips_sorted_get(const Scene *scene, const View2D *v2d, float mouse_co[2]) { blender::Vector<Sequence *> strips; LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) { if (!is_strip_visible(v2d, seq)) { continue; } const rctf body = strip_clickable_area_get(scene, v2d, seq); if (!BLI_rctf_isect_pt_v(&body, mouse_co)) { continue; } strips.append(seq); } // sort. or even do sorting while a return strips; } ``` Can even optimize it further by pre-calcualting channel from the mouse, doing an early output for strips outside of that channel.
iss marked this conversation as resolved
@ -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

`On ly` -> `Only`

Don't use hardcoded values for the even types.

Don't use hardcoded values for the even types.
iss marked this conversation as resolved
Richard Antalik added 4 commits 2024-05-08 21:14:38 +02:00
Richard Antalik added 1 commit 2024-05-08 21:32:43 +02:00
Richard Antalik added 1 commit 2024-05-09 15:32:20 +02:00
Richard Antalik requested review from Sergey Sharybin 2024-05-09 15:33:12 +02:00
Sergey Sharybin requested changes 2024-05-10 10:20:39 +02:00
Dismissed
Sergey Sharybin left a comment
Owner

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:

  • Mixing such refactor to this PR makes it harder to focus on the funcitonal changes here
  • It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed.

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).

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: - Mixing such refactor to this PR makes it harder to focus on the funcitonal changes here - It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed. 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).

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).
iss marked this conversation as resolved
@ -17,0 +24,4 @@
SEQ_HANDLE_BOTH,
};
struct StripSelection {

Since this is C++, you can benefit from the implicit default constructor:

struct StripSelection {
  Sequence *seq1 = nullptr;
  Sequence *seq2 = nullptr;
  eSeqHandle handle = SEQ_HANDLE_NONE;
};

This will allow making some code more reslitient and clear towards possible refactors in the future.

Since this is C++, you can benefit from the implicit default constructor: ``` struct StripSelection { Sequence *seq1 = nullptr; Sequence *seq2 = nullptr; eSeqHandle handle = SEQ_HANDLE_NONE; }; ``` This will allow making some code more reslitient and clear towards possible refactors in the future.
iss marked this conversation as resolved
@ -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 as ED_seq_retiming_keys_box_get or sequencer_retiming_keys_box_get.

Even though the function is "intern" to the space_sequencer, it is public from the linkage perspective.

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 as `ED_seq_retiming_keys_box_get` or `sequencer_retiming_keys_box_get`. Even though the function is "intern" to the `space_sequencer`, it is public from the linkage perspective.
Author
Member

I guess I could use seq_ prefix I use in core intern functions. Will have to look up more details on namespaces. I have used them, but not sure how to declare these such that they won't end up creating mess.

To me it seems, that it would be better to add these functions to namespace all at once if this is preferred, so better to do that in separate patch.

I guess I could use `seq_` prefix I use in core intern functions. Will have to look up more details on namespaces. I have used them, but not sure how to declare these such that they won't end up creating mess. To me it seems, that it would be better to add these functions to namespace all at once if this is preferred, so better to do that in separate patch.
iss marked this conversation as resolved
@ -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 just SEQ_time_left_handle_frame_get(scene, seq) / SEQ_time_right_handle_frame_get(scene, 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 just `SEQ_time_left_handle_frame_get(scene, seq)` / `SEQ_time_right_handle_frame_get(scene, seq)` ?
Author
Member

Right, I copy-pasted this from timeline drawing. Strip start is used there for offset drawing... Don't need to do that here.

Right, I copy-pasted this from timeline drawing. Strip start is used there for offset drawing... Don't need to do that here.
iss marked this conversation as resolved
@ -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.

`std::swap`.
iss marked this conversation as resolved
@ -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() ?

`get_strip_handle_under_cursor()` ?
iss marked this conversation as resolved
@ -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.

`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.
iss marked this conversation as resolved
@ -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?

`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?
iss marked this conversation as resolved
@ -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.

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.
Author
Member

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.

This would mean, that flags could never be used as preconditions, which can result in unreadable code. As example you can look at draw_seq_strip() before and after in 4d668e6825
Originally this function was meant to return whether both handles should be selected, so to me it did make sense to make the check here.

> 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. This would mean, that flags could never be used as preconditions, which can result in unreadable code. As example you can look at `draw_seq_strip()` before and after in 4d668e6825ac35b189b1bc4699aa1a43b42fcc03 Originally this function was meant to return whether both handles should be selected, so to me it did make sense to make the check here.

I am not sure what you mean by preconditions. Having check deep inside a code path is exactly opposite of precondition.

It is also quite confusing when all inlined comments are immediately marked as resolved, without stating a resolution in them. From the comment it is unclear whether something got changed in the code inspired by the comment, or is it still open discussion.

I am not sure what you mean by preconditions. Having check deep inside a code path is exactly opposite of precondition. It is also quite confusing when all inlined comments are immediately marked as resolved, without stating a resolution in them. From the comment it is unclear whether something got changed in the code inspired by the comment, or is it still open discussion.
Author
Member

I am not sure what you mean by preconditions. Having check deep inside a code path is exactly opposite of precondition.

Perhaps early return would be better term here, but I have moved the check where it is necessary to be.

It is also quite confusing when all inlined comments are immediately marked as resolved, without stating a resolution in them. From the comment it is unclear whether something got changed in the code inspired by the comment, or is it still open discussion.

What do you suggest? To me marking inline as resolved means agreement with proposed solution. If no solution is proposed I would probably mention what I have done.

When I do review, I do go over resolved inlines, and look at the code anyway. I must say, that this was much easier with phabricator, where you could jump between multiple "revisions".

> I am not sure what you mean by preconditions. Having check deep inside a code path is exactly opposite of precondition. Perhaps early return would be better term here, but I have moved the check where it is necessary to be. > It is also quite confusing when all inlined comments are immediately marked as resolved, without stating a resolution in them. From the comment it is unclear whether something got changed in the code inspired by the comment, or is it still open discussion. What do you suggest? To me marking inline as resolved means agreement with proposed solution. If no solution is proposed I would probably mention what I have done. When I do review, I do go over resolved inlines, and look at the code anyway. I must say, that this was much easier with phabricator, where you could jump between multiple "revisions".

If you simply address feedback without providing further information it is fine to mark conversation as resolved.
If you write new information in the comment, leave the conversation open, so it is easier to go over all open conversations.

If you simply address feedback without providing further information it is fine to mark conversation as resolved. If you write new information in the comment, leave the conversation open, so it is easier to go over all open conversations.
iss marked this conversation as resolved
@ -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.

`eSeqHandle seq2_handle`.
iss marked this conversation as resolved
@ -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 and handle uninitialized. The proposal around StripSelection solves this.

With the current code you're leaving `seq2` and `handle` uninitialized. The proposal around `StripSelection` solves this.
iss marked this conversation as resolved
Author
Member

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:

  • Mixing such refactor to this PR makes it harder to focus on the funcitonal changes here
  • It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed.

Ok, will do changes like these separately. This one makes sense to do in its own.

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).

The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well.

> 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: > - Mixing such refactor to this PR makes it harder to focus on the funcitonal changes here > - It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed. Ok, will do changes like these separately. This one makes sense to do in its own. > 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). The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well.
Richard Antalik added 2 commits 2024-05-15 02:57:00 +02:00
Richard Antalik added 1 commit 2024-05-15 03:54:49 +02:00

It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed.

Ok, will do changes like these separately. This one makes sense to do in its own.

The point of separate PR and review got ignored, and the point of unclarity of difference between HANDLE and SIDE was not addressed.

The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well.

I do not really understand the point about impossibility to modify the keymap for the goal of this PR. See some of my earlier comments, where there is a PoC with avoids extra keymap, and does not seem to have any behavior difference from this PR.

Each PR should be the smallest incremental step towards the goal. While it is is possible that it is beneficial to do the keymap split, it should have its own PR, with motivational part, properly set expectations, and separate commit as well for the purpose of bisecting and presentation (as such changes to keymap will break local custom keymaps).

In short, PR should be "this is the feature this PR implements", and not "this is the feature this PR implements, but also changes FOO, BAR, and BAZ. And possible foobar as well.".

>> It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed. > Ok, will do changes like these separately. This one makes sense to do in its own. The point of separate PR and review got ignored, and the point of unclarity of difference between HANDLE and SIDE was not addressed. > The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well. I do not really understand the point about impossibility to modify the keymap for the goal of this PR. See some of my earlier comments, where there is a PoC with avoids extra keymap, and does not seem to have any behavior difference from this PR. Each PR should be the smallest incremental step towards the goal. While it is is possible that it is beneficial to do the keymap split, it should have its own PR, with motivational part, properly set expectations, and separate commit as well for the purpose of bisecting and presentation (as such changes to keymap will break local custom keymaps). In short, PR should be "this is the feature this PR implements", and not "this is the feature this PR implements, but also changes FOO, BAR, and BAZ. And possible foobar as well.".
Author
Member

It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed.

Ok, will do changes like these separately. This one makes sense to do in its own.

The point of separate PR and review got ignored, and the point of unclarity of difference between HANDLE and SIDE was not addressed.

Sorry, I thought you meant that this should be applied to main as with previous refactor.
Not sure what do you mean by "unclarity of difference between HANDLE and SIDE".

The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well.

I do not really understand the point about impossibility to modify the keymap for the goal of this PR. See some of my earlier comments, where there is a PoC with avoids extra keymap, and does not seem to have any behavior difference from this PR.

I did not finish updating this PR yesterday - I intended to remove keymap splitting from here. I have missed the POC patch. I usually read the comments in email, so I did not go back to it here. Will have a look at it.

Each PR should be the smallest incremental step towards the goal. While it is is possible that it is beneficial to do the keymap split, it should have its own PR, with motivational part, properly set expectations, and separate commit as well for the purpose of bisecting and presentation (as such changes to keymap will break local custom keymaps).

In short, PR should be "this is the feature this PR implements", and not "this is the feature this PR implements, but also changes FOO, BAR, and BAZ. And possible foobar as well.".

I understand this, but this feature was developed over long time. Each time I got feedback something had to be changed. So this went from ~100 line PR to what it is now. If I have done refactors in main to suit bigger PR's there could be seemingly nonsensical changes back and forth based on what feedback I get and what direction this feature goes.
I guess I could have split this after functionality on user level is considered done, but then the code may still change during review.

> >> It introduces confusing situation when some code operates in the terms of HANDLE and other in the terms of SIDE. This would need to be described much better in the comment around the enums, and more carefully reviewed. > > > Ok, will do changes like these separately. This one makes sense to do in its own. > > The point of separate PR and review got ignored, and the point of unclarity of difference between HANDLE and SIDE was not addressed. Sorry, I thought you meant that this should be applied to main as with previous refactor. Not sure what do you mean by "unclarity of difference between HANDLE and SIDE". > > The reason was, that I found the keymap to be unreadable and impossible to modify. It's probably better to do such change separately as well. > > I do not really understand the point about impossibility to modify the keymap for the goal of this PR. See some of my earlier comments, where there is a PoC with avoids extra keymap, and does not seem to have any behavior difference from this PR. I did not finish updating this PR yesterday - I intended to remove keymap splitting from here. I have missed the POC patch. I usually read the comments in email, so I did not go back to it here. Will have a look at it. > Each PR should be the smallest incremental step towards the goal. While it is is possible that it is beneficial to do the keymap split, it should have its own PR, with motivational part, properly set expectations, and separate commit as well for the purpose of bisecting and presentation (as such changes to keymap will break local custom keymaps). > > In short, PR should be "this is the feature this PR implements", and not "this is the feature this PR implements, but also changes FOO, BAR, and BAZ. And possible foobar as well.". I understand this, but this feature was developed over long time. Each time I got feedback something had to be changed. So this went from ~100 line PR to what it is now. If I have done refactors in main to suit bigger PR's there could be seemingly nonsensical changes back and forth based on what feedback I get and what direction this feature goes. I guess I could have split this after functionality on user level is considered done, but then the code may still change during review.
Author
Member

I have looked at the patch for simpler keymap modification and it breaks move tool somehow.

when I made diff in reference to main it looked like this:

+
 def km_sequencer_editor_tool_generic_select(params, *, fallback):
     return (
         _fallback_id("Sequencer Tool: Tweak", fallback),
         {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
         {"items": [
-            *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select(
-                params, "sequencer.select", "sequencer.cursor_set", cursor_prioritize=True, fallback=fallback)),
-
-            *([] if params.use_fallback_tool_select_handled else
-              _template_sequencer_preview_select(
-                  type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)),
-            # Ignored for preview.
-            *_template_items_change_frame(params),
+            *(km_sequencer_editor_tool_generic_select_timeline_rcs(params, fallback) if (params.select_mouse == 'RIGHTMOUSE')
+              else km_sequencer_editor_tool_generic_select_timeline_lcs(params, fallback)),
         ]},
     )

It removed _template_sequencer_preview_select from the keymap, which does not sound correct. Also it introduced items only intended for timeline region. Even if they did nothing, because in the C code it did early return, why have them there? It's just noise.

So IMO it is clearly more readable when these are split.

I have looked at the patch for simpler keymap modification and it breaks move tool somehow. when I made diff in reference to main it looked like this: ```Py + def km_sequencer_editor_tool_generic_select(params, *, fallback): return ( _fallback_id("Sequencer Tool: Tweak", fallback), {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, {"items": [ - *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( - params, "sequencer.select", "sequencer.cursor_set", cursor_prioritize=True, fallback=fallback)), - - *([] if params.use_fallback_tool_select_handled else - _template_sequencer_preview_select( - type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), - # Ignored for preview. - *_template_items_change_frame(params), + *(km_sequencer_editor_tool_generic_select_timeline_rcs(params, fallback) if (params.select_mouse == 'RIGHTMOUSE') + else km_sequencer_editor_tool_generic_select_timeline_lcs(params, fallback)), ]}, ) ``` It removed `_template_sequencer_preview_select` from the keymap, which does not sound correct. Also it introduced items only intended for timeline region. Even if they did nothing, because in the C code it did early return, why have them there? It's just noise. So IMO it is clearly more readable when these are split.
Richard Antalik added 1 commit 2024-05-16 05:53:27 +02:00

The patch was explicitly marked as PoC. It might have some remaining issues because I do not have much time to polish changes related on removing parts of PR which should not have been in there to begin with.

The current state of main already has keymap items which are intentionally there and are relying on the poll() functions. While it might not be something ideal, trying to change it as part of an unrelated feature, that is the real noise. Please adopt the idea of making it minimal possible steps from a working state to a better working state.

We can put this PR on hold, until the #109522 is reviewed and landed, and then come back to this one.

The patch was explicitly marked as PoC. It might have some remaining issues because I do not have much time to polish changes related on removing parts of PR which should not have been in there to begin with. The current state of main already has keymap items which are intentionally there and are relying on the `poll()` functions. While it might not be something ideal, trying to change it as part of an unrelated feature, that is the real noise. Please adopt the idea of making it minimal possible steps from a working state to a better working state. We can put this PR on hold, until the #109522 is reviewed and landed, and then come back to this one.
Richard Antalik added 1 commit 2024-05-22 19:17:27 +02:00
Sergey Sharybin reviewed 2024-05-23 12:43:56 +02:00
Sergey Sharybin left a comment
Owner

@fsiddi What is the expected behavior in the following scenario:

  • Good-old RMB selection
  • Right-click on a handle to select it
  • Left-mouse-drag to move the handle

Currently once you've stopped dragging the handle it gets deselected which, intuitively, I don't think it should. But maybe that was an explicit design decision?

@fsiddi What is the expected behavior in the following scenario: - Good-old RMB selection - Right-click on a handle to select it - Left-mouse-drag to move the handle Currently once you've stopped dragging the handle it gets deselected which, intuitively, I don't think it should. But maybe that was an explicit design decision?
@ -834,3 +834,3 @@
}
static bool element_already_selected(const Sequence *seq, const eSeqHandle handle_clicked)
static bool element_already_selected(StripSelection selection)

const StripSelection& selection

`const StripSelection& selection`
iss marked this conversation as resolved
@ -902,0 +944,4 @@
{
seq_rectf(scene, seq, r_body);
memcpy(r_left_handle, r_body, sizeof(*r_left_handle));
memcpy(r_right_handle, r_body, sizeof(*r_right_handle));
* r_left_handle = *r_body;
* r_right_handle = *r_body;
``` * r_left_handle = *r_body; * r_right_handle = *r_body; ```
iss marked this conversation as resolved
@ -1101,2 +1309,4 @@
"Select all strips on same side of the current frame as the mouse cursor");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* Used for handle tweaking. */

Comments and descriptions needs to be explaining what code or options do. What they are used by might change over time, and there might be other uses outside of the original intent.

It also feels the operator should actually be split, as its behavior is so different depending on this property, and also because it is quite strange to have handles_only=True, and side_of_frame or linked_handle set to something other than their default value.

It is much more clear to have select_handle operator.

Comments and descriptions needs to be explaining what code or options do. What they are used by might change over time, and there might be other uses outside of the original intent. It also feels the operator should actually be split, as its behavior is so different depending on this property, and also because it is quite strange to have `handles_only=True`, and `side_of_frame` or `linked_handle` set to something other than their default value. It is much more clear to have `select_handle` operator.
Author
Member

I agree, that this should have been separate operator, so will create new operator.

I did not do this, because there are many existing properties, that change behavior completely and it felt weird to make new operator, that is used only with RCS keymap.

I agree, that this should have been separate operator, so will create new operator. I did not do this, because there are many existing properties, that change behavior completely and it felt weird to make new operator, that is used only with RCS keymap.
iss marked this conversation as resolved
Richard Antalik added 2 commits 2024-05-23 18:34:32 +02:00
Richard Antalik added 1 commit 2024-05-23 18:39:55 +02:00
Fix inappropriate fallback to retiming selection
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
3813acfaf7
Richard Antalik requested review from Sergey Sharybin 2024-05-23 18:40:01 +02:00
Sergey Sharybin reviewed 2024-05-23 20:43:52 +02:00
@ -54,6 +54,19 @@
/** \name Selection Utilities
* \{ */
class MouseCoords {

For now it is probably fine to have such utility, but in a longer term I don't think we should have something like this. Instead, it should become

const float2 region(RNA_int_get(op->ptr, "mouse_x"), RNA_int_get(op->ptr, "mouse_y"));
const float2 view = UI_view2d_region_to_view(v2d, region);
For now it is probably fine to have such utility, but in a longer term I don't think we should have something like this. Instead, it should become ``` const float2 region(RNA_int_get(op->ptr, "mouse_x"), RNA_int_get(op->ptr, "mouse_y")); const float2 view = UI_view2d_region_to_view(v2d, region); ```
Author
Member

That would be better, I agree. Will use this utility for this patch.

That would be better, I agree. Will use this utility for this patch.
iss marked this conversation as resolved
@ -56,1 +56,4 @@
class MouseCoords {
public:
int region[2];

new code should really be using vectorized types like int2 and float2.

new code should really be using vectorized types like `int2` and `float2`.
iss marked this conversation as resolved
@ -939,3 +1141,1 @@
int mval[2];
mval[0] = RNA_int_get(op->ptr, "mouse_x");
mval[1] = RNA_int_get(op->ptr, "mouse_y");
MouseCoords mouse_co = MouseCoords(

Use constructor directly:

MouseCoords mouse_co(v2d, RNA_int_get(op->ptr, "mouse_x"), RNA_int_get(op->ptr, "mouse_y"));

Should also use const to make things even better.

Use constructor directly: ``` MouseCoords mouse_co(v2d, RNA_int_get(op->ptr, "mouse_x"), RNA_int_get(op->ptr, "mouse_y")); ``` Should also use `const` to make things even better.
iss marked this conversation as resolved
@ -1107,0 +1334,4 @@
return OPERATOR_CANCELLED;
}
MouseCoords mouse_co = MouseCoords(

Same as above.

Same as above.
iss marked this conversation as resolved
@ -1107,0 +1349,4 @@
return OPERATOR_CANCELLED;
}
bool changed = false;

The variable is not used (it is only assigned to, never read back).

The variable is not used (it is only assigned to, never read back).
iss marked this conversation as resolved

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.
Richard Antalik added 1 commit 2024-05-24 11:30:31 +02:00
Sergey Sharybin requested changes 2024-05-24 12:55:31 +02:00
Dismissed
Sergey Sharybin left a comment
Owner

Why does the SEQUENCER_OT_select_handle need to be modal operator?

The way it does the check about element_already_selected(selection) and returning OPERATOR_RUNNING_MODAL is rather confusion: it informs the window manager that it runs modally, but does not add any modal handler. This seems to be against the intended design of working with the modal operators.

In practice it makes it impossible to use handle tweaking when the handle is already selected.

I've also talked to Francesco and the conclusion is that the tweak operation should not change initial selection. It means that if the handle is selected, tweaking it should leave it selected when the tweak is finished.

Why does the `SEQUENCER_OT_select_handle` need to be modal operator? The way it does the check about `element_already_selected(selection)` and returning `OPERATOR_RUNNING_MODAL` is rather confusion: it informs the window manager that it runs modally, but does not add any modal handler. This seems to be against the intended design of working with the modal operators. In practice it makes it impossible to use handle tweaking when the handle is already selected. I've also talked to Francesco and the conclusion is that the tweak operation should not change initial selection. It means that if the handle is selected, tweaking it should leave it selected when the tweak is finished.
Author
Member

Why does the SEQUENCER_OT_select_handle need to be modal operator?

The way it does the check about element_already_selected(selection) and returning OPERATOR_RUNNING_MODAL is rather confusion: it informs the window manager that it runs modally, but does not add any modal handler. This seems to be against the intended design of working with the modal operators.

In practice it makes it impossible to use handle tweaking when the handle is already selected.

It was mistake - I though, that this would allow for translation when mouse moves, but in RCS that is explicit, so it should not have been modal.

I've also talked to Francesco and the conclusion is that the tweak operation should not change initial selection. It means that if the handle is selected, tweaking it should leave it selected when the tweak is finished.

I am ok with either behavior. Deselection after translation was originally requested, but not sure if there was any purpose for this.

> Why does the `SEQUENCER_OT_select_handle` need to be modal operator? > > The way it does the check about `element_already_selected(selection)` and returning `OPERATOR_RUNNING_MODAL` is rather confusion: it informs the window manager that it runs modally, but does not add any modal handler. This seems to be against the intended design of working with the modal operators. > > In practice it makes it impossible to use handle tweaking when the handle is already selected. It was mistake - I though, that this would allow for translation when mouse moves, but in RCS that is explicit, so it should not have been modal. > I've also talked to Francesco and the conclusion is that the tweak operation should not change initial selection. It means that if the handle is selected, tweaking it should leave it selected when the tweak is finished. I am ok with either behavior. Deselection after translation was originally requested, but not sure if there was any purpose for this.
Richard Antalik added 2 commits 2024-05-24 13:24:31 +02:00
Revert deselection after translation
Some checks failed
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
5224ef65f6

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

The state of handle selection should not change after the tweak:

  • When tweaking handle which was not selected, it shall remain un-selected after tweaking
  • When tweaking handle which was selected, it shall remain selected.

Currently in both cases handle stays selected after the tweaking.

The state of handle selection should not change after the tweak: - When tweaking handle which was not selected, it shall remain un-selected after tweaking - When tweaking handle which was selected, it shall remain selected. Currently in both cases handle stays selected after the tweaking.
Author
Member

The state of handle selection should not change after the tweak:

  • When tweaking handle which was not selected, it shall remain un-selected after tweaking
  • When tweaking handle which was selected, it shall remain selected.

Currently in both cases handle stays selected after the tweaking.

Ah I misunderstood this. Question is, how to pass previous state to transform operator. I could add a flag to SpaceSeq, adding RNA property to transform operator would be bit odd. Both solutions are not great though.

> The state of handle selection should not change after the tweak: > - When tweaking handle which was not selected, it shall remain un-selected after tweaking > - When tweaking handle which was selected, it shall remain selected. > > Currently in both cases handle stays selected after the tweaking. Ah I misunderstood this. Question is, how to pass previous state to transform operator. I could add a flag to `SpaceSeq`, adding RNA property to transform operator would be bit odd. Both solutions are not great though.
Richard Antalik added 4 commits 2024-05-27 23:34:46 +02:00
Richard Antalik requested review from Sergey Sharybin 2024-05-27 23:38:25 +02:00
Richard Antalik added 1 commit 2024-05-27 23:46:36 +02:00
Merge branch 'main' into tweak-experiment
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
3c14a013ff

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

Now there is an issue with using G-key transform of handles, which leads to handle being unselected:

  • Start with the --factory-startup
  • Video Editing template
  • Add Color strip
  • Select right handle
  • G-key transform the handle
  • Observe the handle is now deselected

I think what happens is when you click the select_handle operator is run, and it leaves the SPACE_SEQ_DESELECT_STRIP_HANDLE, which is then later taken into account by the G-transform operator, outside of the tweak tool.

I guess there is no way around adding some parameter to the seq_slide so that it "knows" it was called as part of the "tweak" tool.

Now there is an issue with using G-key transform of handles, which leads to handle being unselected: - Start with the `--factory-startup` - `Video Editing` template - Add `Color` strip - Select right handle - G-key transform the handle - Observe the handle is now deselected I think what happens is when you click the `select_handle` operator is run, and it leaves the `SPACE_SEQ_DESELECT_STRIP_HANDLE`, which is then later taken into account by the G-transform operator, outside of the tweak tool. I guess there is no way around adding some parameter to the `seq_slide` so that it "knows" it was called as part of the "tweak" tool.
Author
Member

Now there is an issue with using G-key transform of handles, which leads to handle being unselected:

  • Start with the --factory-startup
  • Video Editing template
  • Add Color strip
  • Select right handle
  • G-key transform the handle
  • Observe the handle is now deselected

I think what happens is when you click the select_handle operator is run, and it leaves the SPACE_SEQ_DESELECT_STRIP_HANDLE, which is then later taken into account by the G-transform operator, outside of the tweak tool.

I guess there is no way around adding some parameter to the seq_slide so that it "knows" it was called as part of the "tweak" tool.

Hmm this can be fixed in logic where cursor for transform operator is selected - it checks if the operator is invoked by mouse.

Other method could be to modify keymap on the fly by select operator, but this is much more error prone and complicated.

> Now there is an issue with using G-key transform of handles, which leads to handle being unselected: > > - Start with the `--factory-startup` > - `Video Editing` template > - Add `Color` strip > - Select right handle > - G-key transform the handle > - Observe the handle is now deselected > > I think what happens is when you click the `select_handle` operator is run, and it leaves the `SPACE_SEQ_DESELECT_STRIP_HANDLE`, which is then later taken into account by the G-transform operator, outside of the tweak tool. > > I guess there is no way around adding some parameter to the `seq_slide` so that it "knows" it was called as part of the "tweak" tool. Hmm this can be fixed in logic where cursor for transform operator is selected - it checks if the operator is invoked by mouse. Other method could be to modify keymap on the fly by select operator, but this is much more error prone and complicated.
Author
Member

Following codde would work, it changes state of SpaceSeq, which already happens in transform_convert_sequencer.cc. This could be implemented as separate flag in transform code, that could be better perhaps, but may be unnecessary.

diff --git a/source/blender/editors/transform/transform_input.cc b/source/blender/editors/transform/transform_input.cc
index 3ef41903bd4..5da0bcf0b4c 100644
--- a/source/blender/editors/transform/transform_input.cc
+++ b/source/blender/editors/transform/transform_input.cc
@@ -445,8 +445,16 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
         WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL);
       }
       /* Only use special cursor, when tweaking strips with mouse. */
-      if (t->mode == TFM_SEQ_SLIDE && (t->launch_event == 1 || t->launch_event == 3)) {
-        WM_cursor_modal_set(win, transform_seq_slide_cursor_get(t));
+      if (t->mode == TFM_SEQ_SLIDE) {
+        if ((t->launch_event == 1 || t->launch_event == 3)) {
+          WM_cursor_modal_set(win, transform_seq_slide_cursor_get(t));
+        }
+        else {
+          SpaceSeq *sseq = CTX_wm_space_seq(t->context);
+          if (sseq != nullptr) {
+            sseq->flag &= ~SPACE_SEQ_DESELECT_STRIP_HANDLE;
+          }
+        }
       }
 
       break;
Following codde would work, it changes state of `SpaceSeq`, which already happens in `transform_convert_sequencer.cc`. This could be implemented as separate flag in transform code, that could be better perhaps, but may be unnecessary. ``` diff --git a/source/blender/editors/transform/transform_input.cc b/source/blender/editors/transform/transform_input.cc index 3ef41903bd4..5da0bcf0b4c 100644 --- a/source/blender/editors/transform/transform_input.cc +++ b/source/blender/editors/transform/transform_input.cc @@ -445,8 +445,16 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) WM_cursor_modal_set(win, WM_CURSOR_NSEW_SCROLL); } /* Only use special cursor, when tweaking strips with mouse. */ - if (t->mode == TFM_SEQ_SLIDE && (t->launch_event == 1 || t->launch_event == 3)) { - WM_cursor_modal_set(win, transform_seq_slide_cursor_get(t)); + if (t->mode == TFM_SEQ_SLIDE) { + if ((t->launch_event == 1 || t->launch_event == 3)) { + WM_cursor_modal_set(win, transform_seq_slide_cursor_get(t)); + } + else { + SpaceSeq *sseq = CTX_wm_space_seq(t->context); + if (sseq != nullptr) { + sseq->flag &= ~SPACE_SEQ_DESELECT_STRIP_HANDLE; + } + } } break; ```
Richard Antalik added 1 commit 2024-05-28 13:15:31 +02:00
Fix deselecting handles when invoking translation with G key
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
f6bb53d88e

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

Hi, I tested with RCS and LCS, selection and transform of handles works as expected now.

Hi, I tested with RCS and LCS, selection and transform of handles works as expected now.
Sergey Sharybin requested changes 2024-05-30 10:13:31 +02:00
Dismissed
Sergey Sharybin left a comment
Owner

What works:

  • Typical usecases with with both LMB and RMB selection.

What doesn't:

  • Disabling Tweak Handles disables mouse cursor changes, but does not seem to disable the tweaking behavior
  • Cancelling transform does not restore selection to what it was before
  • Re-binding tweak events to something else than 1/3 mouse button will not lead to the desired result. More about it later.

Non-intuitive/non-documented/debatable aspects:

  • When handle tweak is initiated from the state when one of adjacent handles is selected and the other is not, tweak leaves both handles unselected.

The C/C++ code should be making as few assumptions about the keymap as possible. Surely, it does happen in some places in Blender, but they are more of legacy, and they do have issues which users are running into and which we want to be solved. In this specific case, if someone re-binds mouse clicks to something like a keyboard or a pedal it will not be possible to have the same tweak behavior as with the real mouse events. I am not sure if it was attempted to avoid such coupling of code with the default keymap and whether it had some intrinsic issues. If so, it needs to be mentioned as a known limitation, so people are aware.

What works: * Typical usecases with with both LMB and RMB selection. What doesn't: * Disabling `Tweak Handles` disables mouse cursor changes, but does not seem to disable the tweaking behavior * Cancelling transform does not restore selection to what it was before * Re-binding tweak events to something else than 1/3 mouse button will not lead to the desired result. More about it later. Non-intuitive/non-documented/debatable aspects: * When handle tweak is initiated from the state when one of adjacent handles is selected and the other is not, tweak leaves both handles unselected. The C/C++ code should be making as few assumptions about the keymap as possible. Surely, it does happen in some places in Blender, but they are more of legacy, and they do have issues which users are running into and which we want to be solved. In this specific case, if someone re-binds mouse clicks to something like a keyboard or a pedal it will not be possible to have the same tweak behavior as with the real mouse events. I am not sure if it was attempted to avoid such coupling of code with the default keymap and whether it had some intrinsic issues. If so, it needs to be mentioned as a known limitation, so people are aware.

When handle tweak is initiated from the state when one of adjacent handles is selected and the other is not, tweak leaves both handles unselected.

I've talked to Francesco ab out it. Is not something we consider important to be resolved. So don't focus on this part for the initial feature merge.

> When handle tweak is initiated from the state when one of adjacent handles is selected and the other is not, tweak leaves both handles unselected. I've talked to Francesco ab out it. Is not something we consider important to be resolved. So don't focus on this part for the initial feature merge.
Author
Member

What works:

  • Typical usecases with with both LMB and RMB selection.

What doesn't:

  • Disabling Tweak Handles disables mouse cursor changes, but does not seem to disable the tweaking behavior

Disabling Tweak Handles should keep previous behavior. Currently this does not happen with RCS and LMB action - will fix that , but just wanted to state this explicitly here.

The C/C++ code should be making as few assumptions about the keymap as possible. Surely, it does happen in some places in Blender, but they are more of legacy, and they do have issues which users are running into and which we want to be solved. In this specific case, if someone re-binds mouse clicks to something like a keyboard or a pedal it will not be possible to have the same tweak behavior as with the real mouse events. I am not sure if it was attempted to avoid such coupling of code with the default keymap and whether it had some intrinsic issues. If so, it needs to be mentioned as a known limitation, so people are aware.

This could be facilitated by operator property instead of relying on checking how the operator was invoked, so will do that.

> What works: > * Typical usecases with with both LMB and RMB selection. > > What doesn't: > * Disabling `Tweak Handles` disables mouse cursor changes, but does not seem to disable the tweaking behavior Disabling `Tweak Handles` should keep previous behavior. Currently this does not happen with RCS and LMB action - will fix that , but just wanted to state this explicitly here. > The C/C++ code should be making as few assumptions about the keymap as possible. Surely, it does happen in some places in Blender, but they are more of legacy, and they do have issues which users are running into and which we want to be solved. In this specific case, if someone re-binds mouse clicks to something like a keyboard or a pedal it will not be possible to have the same tweak behavior as with the real mouse events. I am not sure if it was attempted to avoid such coupling of code with the default keymap and whether it had some intrinsic issues. If so, it needs to be mentioned as a known limitation, so people are aware. This could be facilitated by operator property instead of relying on checking how the operator was invoked, so will do that.
Richard Antalik added 2 commits 2024-05-30 21:15:06 +02:00
Author
Member
  • Re-binding tweak events to something else than 1/3 mouse button will not lead to the desired result. More about it later.

@Sergey I have implemented the functionality as operator property. There are 2 caveats:
initSeqSlide() sets WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE); as custom data. From looking at other areas, only place I saw it being used is in transform_mode_shrink_fatten.cc event handling. Therefore I have removed this from seq_slide mode and I have used custom data to store state of this property.

Finally, with current keymap, translation is not explicitly defined for LCS tweak tool or any other tools, so I have to enabled option to deselect handles for seq_slide operator mapped to mouse. Then in the code, this is still controlled by "Tweak Handles" property in preferences. Still better than hardcoding this functionality to mouse buttons I guess.

> * Re-binding tweak events to something else than 1/3 mouse button will not lead to the desired result. More about it later. @Sergey I have implemented the functionality as operator property. There are 2 caveats: `initSeqSlide()` sets `WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE);` as custom data. From looking at other areas, only place I saw it being used is in `transform_mode_shrink_fatten.cc` event handling. Therefore I have removed this from seq_slide mode and I have used custom data to store state of this property. Finally, with current keymap, translation is not explicitly defined for LCS tweak tool or any other tools, so I have to enabled option to deselect handles for `seq_slide` operator mapped to mouse. Then in the code, this is still controlled by "Tweak Handles" property in preferences. Still better than hardcoding this functionality to mouse buttons I guess.
Richard Antalik added 1 commit 2024-05-30 22:56:51 +02:00
Use operator property to facilitate translation part of this feature
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
730d2c3b41
Author
Member

@blender-bot package

@blender-bot package
Member

Package build started. Download here when ready.

Package build started. [Download here](https://builder.blender.org/download/patch/PR109522) when ready.

@iss Thanks for the updates! I am a nit distracted today, so can't give full confidence in testing. The only thing i've noticed is the Tweak Handle option in Editor -> VSE is not enabled by default. It might be due to my settings are saved with a newer subversion than what this build has.

If we can merge the latest main, then we can make the final build, and make Francesco double-check the behavior.
Hopefully it will be all fine, and we'll be able to finally land this feature.

@iss Thanks for the updates! I am a nit distracted today, so can't give full confidence in testing. The only thing i've noticed is the Tweak Handle option in Editor -> VSE is not enabled by default. It might be due to my settings are saved with a newer subversion than what this build has. If we can merge the latest main, then we can make the final build, and make Francesco double-check the behavior. Hopefully it will be all fine, and we'll be able to finally land this feature.
Author
Member

@Sergey So if I get OK from