Page MenuHome

VSE: Image transform tools
ClosedPublic

Authored by Richard Antalik (ISS) on Aug 2 2021, 3:09 PM.

Details

Summary

Add tools for image manipulation in sequencer preview region.

This includes:

  • Translate, rotate and resize operators, tools and gizmos
  • Origin for image transformation
  • Median point and individual origins pivot modes
  • Select and Box select operator works in preview
  • Image overlay drawing

ref T90156

Diff Detail

Repository
rB Blender
Branch
arcpatch-D12105_1 (branched from master)
Build Status
Buildable 17165
Build 17165: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@Richard Antalik (ISS) Great, now the outline fits the image. It works much better.

If you have images in a stack covering the same selection area, the current selected image gets deselected, when you grab and drag, because it also selects. In the 3d view there is no grab+select & drag, properly for this reason. You single click to select and when grab and drag there is no additional selection. I know you would like to keep this simple, but I think users will be missing a selection tool(including box select). Also to separate selecting and dragging.

Yes, I forgot about this issue - that is because tool fallback doesn't exist in this case, that should be box select, but that is not implemented. So probably best way to resolve this is to implement box select.

When you select in a stack and click multiple times the selection it would be more intuitive to cycle through from the top channel and downwards, currently it goes the other way.

That is matter of opinion unless there is convention, I wouldn't mind either way.

When the playhead is over a stack but not over the active strip, the strip in the lowest channel of the playhead position is automatically selected first. This is partly because of the grab+select & drag behaviour, but if it should autoselect, it should properly start with the top channel first.

This is same point as above?

When moving elements outside the visible area, they're drawn under the dark area, so they simply disappear if you unselect them. They should be drawn on top of the dark area instead.

This is possible to do, but it is not implemented here. This patch draws only outline.

I've mentioned it before, but transforming an image from it's default size, should automatic change blend mode to alpha over, or else users will start asking why they can't see the other channels underneath.

This is more issue of why alpha over is not default blend mode, that is because it is much slower as cross or replace. Heuristics on user's intentions almost never work in long run, so I don't think this is best way to handle this issue. So not sure here.

Alt+R/S/G should reset transformations. Imo, it would feel natural to move Image Transform menu into the preview area, where these shortcuts can be exposed. Maybe the menu could just be called Image to separate it entirely from the Transform menu.

Sounds reasonable, though question is whether this menu should be moved, or it should be in both preview and timeline. Users may edit while using backdrop.

Is multi-tool and crop saved for next round?

Yes. I think this patch is sufficient as basic implementation of design. I would expect more things could be done in preview as you have selection support.

  • Cleanup unused code
  • Add box select tool
Richard Antalik (ISS) edited the summary of this revision. (Show Details)Sep 13 2021, 1:59 PM
  • Move color sample tool below transform tools
  • Fix missing updates in box select
  • Fix incorrect origin range
  • Use box select as default tool in preview
  • Add clear transform operators to preview, since it is only keymap change

Active Tool & Select Box+icon buttons doesn't seem to work.

Outlines are also drawn in the other Display Modes:

When using S,R and G shortcuts the tool should properly change?
When restricting a transform operation to an axis, maybe that should be visible somehow?

The Transform properties for the individual tools could be exposed in the tool sidebar:

Imo, would the Image transform menu work better in the Preview header as an Image menu with the transform shortcut keys exposed(@Francesco Siddi (fsiddi)):

Sketch-code for Image menu: https://developer.blender.org/P2393
Classic functions like Duplicate, Delete, Copy and Paste could be added in this menu. They're close to be working out of the box, however Paste would need to use the option to paste in the same position(.keep_offset = True), and duplicate would need to just duplicate to the channel above instead of following mouse position(but maybe it can be removed since it is more or less just a copy/paste operation?).

Is an Insert Keyframe menu "I" planned? It could also be exposed in the Image menu, as a sub menu called Animation(like in 3d view)

Should "b" for box select be implemented and exposed? The UV Editor doesn't seem to have it.

Campbell Barton (campbellbarton) requested changes to this revision.Sep 15 2021, 12:54 PM
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/space_sequencer/sequencer_draw.c
2095

Unused.

source/blender/editors/transform/transform_convert_sequencer_image.c
124–126

Using 3x trans-data per sequence strip could cause issues later on (proportional editing for example), long term it's probably better to use something similar to pose bones or objects. Worth adding a code-comment but don't think it's a blocker.

source/blender/editors/transform/transform_draw_cursors.c
98

use ELEM(region->regiontype, ...).

source/blender/editors/transform/transform_gizmo_2d.c
297

scene context access isn't necessary (it's already assigned a variable).

333

Unused context.

664

Unused context.

807

Unused context.

source/blender/makesdna/DNA_sequence_types.h
77

Note what space these values are in.

This revision now requires changes to proceed.Sep 15 2021, 12:54 PM

Isn't the active strip supposed to be having a white outline?

Code for exposing the tool properties, including animation buttons(important, especially if no animation pop up is implemented): https://developer.blender.org/P2394

When using S,R and G shortcuts the tool should properly change?

3DView does not change tools when using transform shortcuts either

The Transform properties for the individual tools could be exposed in the tool sidebar:

I think we should not mix tool settings with strip properties.
Alternatively (to have these close for inspection and keying), we could/should place the Strip panel (including Transform subpanel) from the Sequencer view over to the Preview view as well?
(some discussion about this here https://blender.chat/channel/user-interface?msg=NC7oLNgA4Dd9MTA6E)

Imo, would the Image transform menu work better in the Preview header as an Image menu with the transform shortcut keys exposed(@Francesco Siddi (fsiddi)):

A menu would be good here

Is an Insert Keyframe menu "I" planned? It could also be exposed in the Image menu, as a sub menu called Animation(like in 3d view)

+1

When using S,R and G shortcuts the tool should properly change?

3DView does not change tools when using transform shortcuts either

Either should the tool change so the gizmo fits the tool or the gizmo should be removed during a shortcut initiated transform. Right now doesn't the gizmo match the shortcut initiated transform.

When using S,R and G shortcuts the tool should properly change?

3DView does not change tools when using transform shortcuts either

Either should the tool change so the gizmo fits the tool or the gizmo should be removed during a shortcut initiated transform. Right now doesn't the gizmo match the shortcut initiated transform.

Gizmo should be removed during a shortcut initiated transform I think.

When using S,R and G shortcuts the tool should properly change?

3DView does not change tools when using transform shortcuts either

Either should the tool change so the gizmo fits the tool or the gizmo should be removed during a shortcut initiated transform. Right now doesn't the gizmo match the shortcut initiated transform.

Gizmo should be removed during a shortcut initiated transform I think.

rB5c6cc931b2203d97aa9d570ff3b353c2a3dfebed adds a flag to do this (previously it used a hack that only worked in the 3D view).

@Peter Fog (tintwotin) thanks for the suggestions. In the interest of having this patch to be reviewed and merged, I'd like to limit the amount of additional features to the minimum.

  • Being able to clear transforms (Alt+G-R-S) at this stage is highly desirable. Such functionality could indeed be exposed through an "Image" menu, next to the transform operators.

Some comments about the other suggestions:

  • The individual transform tools (rotate, scale, translate) should be simply replaced by the generic transform gizmo, which allows for all transforms to be performed. This is part of another task.
  • Strip duplication is definitely interesting, but not a priority right now. The focus is on introducing basic media manipulation first.
  • Same goes for keying and animation

Let me know if I missed something.

Richard Antalik (ISS) marked 8 inline comments as done.
  • Address inlines
  • Revert "Use box select as default tool in preview"
  • Don't use pixel unit for origin property
  • Fix spelling
  • Fix incorrect flag for show_image_outline property
  • Fix overlay draw order.
Campbell Barton (campbellbarton) requested changes to this revision.Sep 16 2021, 5:03 AM
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/space_sequencer/sequencer_draw.c
2209–2211

Is this re-ordering an intended part of this patch?

source/blender/editors/space_sequencer/sequencer_select.c
648

Use float[2] here, avoids assigning a separate variable below. Could also call this view_co or mouseco_view (based on names used elsewhere).

1373–1381

Reads better, less repetition.

float rect_quad[4][2] = {
  {rect->xmax, rect->ymax},
  ...
};
source/blender/makesdna/DNA_space_types.h
689

This will likely be one of many options which impact "overlays".

A quick check shows quite a few options that could be used in the sequencer.

  • Outline selected.
  • Origins
  • 3D Cursor.
  • Text Info.
  • Annotations.

Suggest to add SequencerPreviewOverlay struct similar View3DOverlay, so all the preview options aren't mixed in with the existing time-line options.

source/blender/makesrna/intern/rna_space.c
5631–5634

Should use same name as 3D view "Outline Selected".

This revision now requires changes to proceed.Sep 16 2021, 5:03 AM
Richard Antalik (ISS) marked 4 inline comments as done.
  • Address inlines

@Francesco Siddi (fsiddi) Moved the menus here: D12513

@Richard Antalik (ISS)
To sum up my previous comments here which haven't been fixed yet(afaik):

  • Selection of overlaying images should be from the top channel and down.
  • The outline is not fitting the source image, and is drawn on the "outside" so the bottom line disappears when using "Zoom to Fit":
  • When the Active Tool setting is Drag: Active Tool, it shouldn't change selection, when images are overlapping.
  • When moving elements outside the visible area, they're drawn under the dark area, so they simply disappear if you deselect them. They should be drawn on top of the dark area instead.
  • Some way to add auto "alpha over"?
  • Extend and subtract icon buttons in tool preferences doesn't work.
  • The tools are working in view mode: Sequencer&Preview, but the toolbar buttons aren't exposed.
  • Hide gizmo when transforms are initiated by shortcut keys or switch tool so the gizmo etc. matches.
  • White outline is missing from the Active Strip.

To do:

  • Crop.
  • Multi tool.
  • Animation menu.
  • Text tool.

Consideration:

  • It would be helpful for users to have the Transform properties and kye buttons in the preview sidebar(like the object transform values in the 3d view), could this be done somehow?
  • Being able to move images up or down in the channels would be a useful feature.
Sebastian Parborg (zeddb) added inline comments.
source/blender/editors/transform/transform_convert_sequencer_image.c
120

This seems to introduce a memory leak.
Because this data is not freed afterwards.
At least ASAN caught this when I transformed some strips.

Richard Antalik (ISS) marked 2 inline comments as done.
  • Fix memleak
source/blender/makesdna/DNA_space_types.h
689

Started work on this and will make separate patch for this change, I think it is too big and quite unrelated to transform feature.

  • Fix mirror X/Y not being taken into consideration.
  • Remove commented out code
  • Fix incorrect origin for gizmo with multi-selection
  • Cleanup: Unused vars
  • Add transform tools to sequencer & preview mode
  • Fix drawing outline when using scope view.
This revision is now accepted and ready to land.Sep 20 2021, 9:14 AM
  • Fix missing outline overlay checkbox.
  • Fix snapping being used in preview.
  • Fix tweak tool uses scrubbing in preview when using RCS keymap.
This revision was automatically updated to reflect the committed changes.