Commit Graph

326 Commits

Author SHA1 Message Date
John Kiril Swenson
6bd750bc01 Fix (unreported): VSE: Strips not deselected on press
With #128051, the default timeline tool changed to
a `sequencer.select` on press with no associated
properties (before, it had `deselect_all`).

This meant that retiming key selection broke (as
reported in #129892) and strips would only deselect
on release if clicking into empty space (due to a separate
keymap item in the global sequencer keymap).

This patch reverts 97e44901b4 while keeping its fix,
in favor of a more robust solution (just add `deselect_all`
to the keymap item properties in the box select tool).
2025-05-25 16:22:16 -05:00
Jacques Lucke
66e96bf134 Spreadsheet: support reordering columns interactively
This adds a new modal operator that allows reordering columns interactively.

It's triggered by dragging the column header. Edge panning while dragging the
column to the left or right of the region is supported. Scrolling with a
horizontal scroll wheel works too.

There are three new UI elements to help the user understand what is happening.
These three elements seem to be fairly standard in other spreadsheet software.
* The column that is dragged is highlighted in its original place.
* A "shadow" of that column stays attached to the cursor.
* A line indicates where the column will be inserted.

Note: The column order is not yet persistent when columns disappear temporarily.
That will be worked on separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/139136
2025-05-20 18:19:24 +02:00
Sean Kim
9e1e9b0859 Paint: Add toggle support for brush.asset_activate
This commit adds a toggle functionality to the `brush.asset_activate`
operator that makes it behave similarly to the `paint.brush_select`
parameter of the same name.

When the operator has this option enabled, using the operator or
pressing the relevant key will either:
* Activate the specified brush and store it if the current brush does
  not match the specified brush
* Activate the previously stored brush if it exists.

This option is exposed in the keymaps and enabled by default for the
Sculpt Mask brush.

This allows, for example, users to press 'M' to switch to the mask brush
and then press 'M' again to switch back to their previously active
brush.

Partially addresses this RCS submission: [1]
[1] https://blender.community/c/rightclickselect/1VwZ/

---

### Notes
This commit does not currently clear the `AssetWeakReference` when switching paint modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138845
2025-05-16 23:25:45 +02:00
Pablo Vazquez
fcc6e022b1 Keymap: Use horizontal scroll wheel to pan in 3D Viewport
Use the horizontal scroll wheel for panning left/right in the
3D Viewport. Similar to how it is used in 2D Views.

Also add it to the industry compatible keymap, since it is
a pretty standard/basic navigation gesture.

Pull Request: https://projects.blender.org/blender/blender/pulls/138880
2025-05-16 14:57:47 +02:00
Jacques Lucke
734e3c5589 Spreadsheet: support double click to fit column width
This implements a new operator that automatically fits the width of a column to
its content. It's triggered by double-clicking on the column edge in the header
row. This is common functionality in other spreadsheet software.

Pull Request: https://projects.blender.org/blender/blender/pulls/138924
2025-05-15 20:57:37 +02:00
Jacques Lucke
578f935170 Nodes: support changing attached frame while transforming nodes
Currently, removing a node frame a frame is rather annoying. The `alt+P`
shortcut is hard to reach and probably not very intuitive. Furthermore, often
one only notices that one wants to remove a node from a frame after starting to
move the node. So one would have to put the node back down, detach it from the
frame and then start moving again.

This patch simplifies this entire process by adding a new shortcut that can be
used while dragging nodes. When `F` is pressed, the selected nodes are detached
from their parents. Alternatively, if the nodes are detached already, they may
be attached to the frame under the cursor.

Pull Request: https://projects.blender.org/blender/blender/pulls/138650
2025-05-15 20:54:29 +02:00
Jacques Lucke
8ec093a2d8 Nodes: new operator to simplify adding named frames
Currently, the steps required to add a named frame in the node editor are quite
cumbersome:
* Press ctrl+J, which is hard to reach.
* Press F2, to rename.

This is bad, because frames are a key part of making node trees understandable.
Therefore, we should lower the barrier to adding them as much as possible.
Additionally, named frames help significantly more with readability. Therefore,
it's good to lower the barrier to adding those even more. Of course it's still
possible to click in empty space to avoid having to give a frame a name.

This patch adds a new operator to join nodes in a named frame. When triggered,
it adds the frame and automatically opens the rename menu to set the name.

Keymap changes:
* Remove `ctrl+J` which was creating a frame without label.
* Move existing functionality of `F` key to `J` key
  (including `shift+F -> shift+J`).
* Use `F` for this new operator to create a named frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/138390
2025-05-15 20:51:54 +02:00
Jacques Lucke
afd760f2b7 UI: Ghost: support horizontal scrolling for 2D editors
Some mice have an additional horizontal scroll wheel. This patch adds support
for receiving such events. By default it is used to scroll 2D editors left and right.

I originally developed this because I was missing it in the spreadsheet, but it
seems to be useful in many other editors too.

It's supported on Linux (Wayland), Windows and macos.

Pull Request: https://projects.blender.org/blender/blender/pulls/138758
2025-05-14 13:33:10 +02:00
Jacques Lucke
db7b5a480b Spreadsheet: make column widths editable
Currently, there are two main annoying problems with columns widths in the
spreadsheet:
* The initial column width is often too small. This is especially noticeable
  with the ID integer attribute.
* There is no way to change the column width.

This patch improves both of these aspects. The initial column width will now be
derived from the content of the spreadsheet. This initial width is then stored
in DNA to make it editable and to avoid having to recompute it on each redraw.
Furthermore, there is a new modal operator to change the width of a column.

Pull Request: https://projects.blender.org/blender/blender/pulls/138657
2025-05-13 17:47:02 +02:00
Richard Antalik
4a11be2656 VSE: Add option to translate pivot point
This feature allows you to change postion of origin/pivot for images
without changing their position.

It is implemented as property of transform operator. It is activated
by pressing `Ctrl + .` shortcut.
Move Origin item was also added to transform menu.

Origin can be snapped to 3x3 grid on strip image. This represents
most usual anchor points.

Ref: #134251
Pull Request: https://projects.blender.org/blender/blender/pulls/134206
2025-05-06 05:16:56 +02:00
Pratik Borhade
127fbaa0e6 Fix: Grease Pencil: Change split stroke shortcut
Change shortcut to `shift + v`. Currently it conflicts with set handle
type key-item.

Pull Request: https://projects.blender.org/blender/blender/pulls/138078
2025-04-29 11:35:18 +02:00
Urko Mauduit
2dc0a243d3 Fix #118806: Grease Pencil: Add "isolate layer" shortcut to Dope Sheet editor
Numpad * is being used for grease pencil object to isolate active layer
while inside edit/paint mode and mouse is over viewport. This PR
includes same keyitem into dopesheet keymap, so that shortcut
can be used in dopesheet editor context.

Pull Request: https://projects.blender.org/blender/blender/pulls/132054
2025-04-28 12:19:34 +02:00
Christoph Lendenfeld
9663d287fc Anim: merge keyframe jump operators
This merges the `GRAPH_OT_keyframe_jump` operator into the more generic
`SCREEN_OT_keyframe_jump` operator. (the former introduced with #108549)

The functionality of both operators is retained by running
a `switch/case` based on the editor type.
Doing so, we can filter out the Dope Sheet as well which fixes #93944
The `GRAPH_OT_keyframe_jump` is preserved, but when it is called,
it generates a warning stating it should not be used anymore.
It then calls directly into the `SCREEN_OT_keyframe_jump` to
ensure functionality doesn't drift apart.

Fixes #136176
Fixes #93944

Pull Request: https://projects.blender.org/blender/blender/pulls/137542
2025-04-24 18:01:05 +02:00
Mukhesh
541e2b3cdd VSE: Hide-Reveal strips operator in sequencer preview
This pull request adds options to hide and show strips in the Sequencer
Preview, using the same shortcuts. Included "Show/Hide" operators in the Strips
menu of preview mode. It only works on strips that are visible in the preview
at the current frame. The Unmute operator now shows all hidden strips in
the preview at the current  frame, since it's not possible to select hidden strips
in sequencer preview.

See video in PR description.

Pull Request: https://projects.blender.org/blender/blender/pulls/137781
2025-04-22 08:18:21 +02:00
John Kiril Swenson
fe1e866fb9 VSE: Slip Operator 2.0
This patch completely reworks the slip operator from the ground up,
reorganizing code to be simpler and adding more clarifying documentation.

Major Changes:
- Add modal keymap to the operator along with an interactive status bar.
- Show offset overlays to the left and right of strips whenever slipping.
- Add option to "clamp" slipped strips.
- Rework input to be accumulative, avoiding "jumps" when transitioning in/out
  of precision mode.

Fixes:
- Properly draw header when initializing operator before any events have been
  sent, and reorganize event flow so that all events have an immediate effect.
- Properly clamp subframe slips.

More information in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/137072
2025-04-13 22:40:46 +02:00
Campbell Barton
5e2b421996 WM: support the "Hyper" modifier key on Linux
Add support for a 5th modifier key called "hyper",
this is a modifier supported on Wayland & X11 although
other platforms could support an additional modifier too.

Both GNOME and KDE can map CapsLock to Hyper.
Other compositors can use the XKB_DEFAULT_OPTIONS environment variable.

This allows users to have an additional modifier for their own use
that doesn't conflict with other keys.

Ref !136340
2025-03-26 10:39:55 +11:00
John Kiril Swenson
b729928897 Cleanup: VSE: Rename Keymaps
Rename to be more consistent with other Blender keymaps, as well as the
naming convention used in "View Type."

- "SequencerCommon" -> "Video Sequence Editor"
- "SequencerPreview" -> "Preview"
- "Sequencer Timeline Tool" -> "Sequencer Tool"
- "Sequencer Preview Tool" -> "Preview Tool"

There is versioning in place to make sure custom keyconfigs keep working.

Once #131102 goes through, if we would like to rename the "Sequencer"
view type to "Timeline" or "Sequencer Timeline," then we can make the
necessary changes here too.

Pull Request: https://projects.blender.org/blender/blender/pulls/136217
2025-03-25 23:46:15 +01:00
Campbell Barton
d037fcd5fb Cleanup: don't redefine built-ins in the key-map
Also remove redundant dictionary unpacking for a single item.
2025-03-21 22:08:31 +11:00
Campbell Barton
5b04f13219 Cleanup: wrap long lines 2025-03-21 22:08:31 +11:00
Pratik Borhade
f5ceb3822a Grease Pencil: Stroke split operator
An operator to split selected points into a separate stroke.
Use `split_points()` function implemented in 2c42294557

Resolves #113643

Pull Request: https://projects.blender.org/blender/blender/pulls/135845
2025-03-14 12:37:25 +01:00
Harley Acheson
ac549dcfde UI: Show ANIM_OT_change_frame as "Set Frame (Solo Preview)" in VSE
Operator ANIM_OT_change_frame currently has a hidden feature when used
within the Sequencer, called "Solo Preview". But this feature is not
advertised anywhere in the interface. This PR adds a new property to
the operator called "seq_preview" that enables this feature and then
shows the name as "Set Frame (Solo Preview)".
2025-02-26 01:54:26 +01:00
Laurynas Duburas
2c42294557 Curves: add Split operator
Adds Split operator to curves. It should have the same behavior as the
corresponding operator for legacy curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/131788
2025-02-24 11:32:59 +01:00
Dalai Felinto
1584cd9aa5 Cleanup: Rename point cloud to pointcloud / POINT_CLOUD to POINTCLOUD
Though "Point Cloud" written as two words is technically correct and should be used in the UI, as one word it's typically easier to write and parse when reading. We had a mix of both before this patch, so better to unify this as well.

This commit also renames the editor/intern/ files to remove pointcloud_ prefix.
point_cloud was only preserved on the user facing strings:

* is_type_point_cloud
* use_new_point_cloud_type

Pull Request: https://projects.blender.org/blender/blender/pulls/134803
2025-02-19 17:11:08 +01:00
Hans Goudey
a99f9496a0 Curves: Separate to object operator
Use the existing "remove_points_and_split" utility added
for grease pencil to implement the operator for the curves
object type. The whole structure is similar to the recently
added point cloud separate operator (4cd3540579).

Pull Request: https://projects.blender.org/blender/blender/pulls/134763
2025-02-18 19:31:30 +01:00
Hans Goudey
4cd3540579 Point Cloud: Implement separate operator
Similar to existing operators, moves the selected
geometry to a new object.
2025-02-17 21:21:14 -05:00
Dalai Felinto
ec6383de96 Point Cloud: Delete operator
Note: The point cloud bounding box is not being updated once the points are deleted.

This is a known issue with BKE_pointcloud_nomain_to_pointcloud and Hans is looking into it.

Code inspired/built based on the Delete Geometry node.

Pull Request: https://projects.blender.org/blender/blender/pulls/134622
2025-02-18 00:28:14 +01:00
Hans Goudey
45094542ff Point Cloud: Implement duplicate operator 2025-02-17 12:11:07 -05:00
Hans Goudey
9714946fca Point Cloud: Add transform operations to keymap 2025-02-17 12:11:06 -05:00
Dalai Felinto
1e87818808 Point Cloud: Select All/None/Invert
Select All operator and boiler plate for future point cloud operators.

The selection code is basically copied/inspired by the curves selection
code. A lot of it could probably be moved to shared attribute selection
functions.

Note, while this patch is working well, there are some caveats
to test it:

* Shortcuts are being defined (you can see them in the Preferences). Yet
  they are not working for whatever reason.

* There is no way to visualize the selection. I've been testing it by
  using a Nodes tool that changes the material based on selection.

Pull Request: https://projects.blender.org/blender/blender/pulls/134450
2025-02-15 12:36:39 +01:00
Pratik Borhade
6d749db0c2 Fix #134468: Grease Pencil: Primtive tools considering mouse drag threshold
This is due to the click_drag event assigned for primitives. Event types
that are not "PRESS" are forwarded to drag_queue then waits until
`WM_event_drag_test_with_delta/WM_event_drag_test` is true i.e. mouse
threshold value.

Pull Request: https://projects.blender.org/blender/blender/pulls/134480
2025-02-13 11:53:03 +01:00
Campbell Barton
dab47b83a8 Cleanup: de-duplicate numbered key definition with loop 2025-02-11 12:09:19 +11:00
John Kiril Swenson
f79df39171 VSE: Move snap toggle to global SequencerCommon
This allows the keybind to be invoked from either the Sequencer or
Preview view types, now that snapping is also possible in the Preview.
2025-02-03 15:02:41 -06:00
John Kiril Swenson
16c6b227da VSE: Add keymap item for seq_slide with ctrl
Allows the user to select strips at the same time (`linked_time`) while
dragging so that they don't have to re-click to drag the handles.
2025-02-02 23:03:07 -06:00
Campbell Barton
448e3c2009 Cleanup: remove redundant setting & add NUMPAD_1 for direct lookups
Add NUMPAD_1 to match NUMBERS_1 to avoid inline formatting,
also de-duplicate logic that uses both NUMBERS_1 & NUMPAD_1.
2025-01-31 13:08:05 +11:00
Lukas Tönne
3be9f3d599 Fix #133516: Add basic support for radial control in the primitive operator
This adds another operator mode for changing brush radius and opacity while the
modal primitive operator is running. It's based on the `wm.radial_control`
operator but only implements simple mouse control for these two properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/133675
2025-01-30 14:09:42 +01:00
Habib Gahbiche
d19fe522e4 Fix box select ignoring selection mode in node editors
Box select is broken for all node editors. It ignores selection modes and always uses the mode `Set a new selection`.

The operator `NODE_OT_select_box` works fine, but clicking anywhere in the node editor calls `NODE_OT_select` first, so we need to make sure it has no undesired side effects when it is not run.

Pull Request: https://projects.blender.org/blender/blender/pulls/133736
2025-01-30 12:45:50 +01:00
Habib Gahbiche
b51c560f6e Compositor: Implement shortcuts for Viewer nodes
Artists often want to quickly switch back and forth between two or more nodes while compositing.

This patch implements two operators `NODE_OT_viewer_shortcut_set` and `NODE_OT_viewer_shortcut_get` that allow users to map a viewer node to a shortcut. For example, pressing `cltr+1` while a node is selected, assigns that node to the shortcut `1`, creates a viewer node if it has none attached and sets that viewer node to active. Pressing `1` will set the active node with shortcut `1` to active.

Shortcuts are saved in DNA to preserve them after saving/loading blend files.

Limitations:
- Only compositor node tree is supported, because shading editor has no viewer node and geometry nodes viewer works differently.

Pull Request: https://projects.blender.org/blender/blender/pulls/123641
2025-01-29 18:35:26 +01:00
Dangry98
e95687796d UV Editor: Add shortcut to Copy/Paste UVs
Assign Ctrl+C, Ctrl V to Copy/Paste UVs in UV Editor to the
default keymap and industry compatible keymap.

Similar to Copy/Paste splines in Mask editor.
Ref: https://projects.blender.org/blender/blender/issues/133558

Pull Request: https://projects.blender.org/blender/blender/pulls/133587
2025-01-27 19:57:28 +01:00
Falk David
1eb39a8689 Grease Pencil: Sculpt Mode Auto-Masking option
This implements all the auto masking options in sculpt mode.

* Stroke: Only affects strokes that are initially under the cursor.
* Layer: Only affect strokes in the same layer as the initial strokes under the cursor.
* Material: Only affect strokes with the same material as the initial strokes under the cursor.
* Active Layer: Only affect strokes in the active layer.
* Active Material: Only affect strokes that use the active material.

The `Active Layer` toggle in the toolbar has been moved to this panel.

Resolves #130022.

Pull Request: https://projects.blender.org/blender/blender/pulls/132986
2025-01-24 10:20:03 +01:00
Lukas Tönne
bca8fc76f9 Fix #130323: Make Grease Pencil interpolate tool retain point distribution
The interpolate tool was using a linear re-sampling of the curves, which changes
non-uniform point distributions can causes unexpected shifts in points along the
curve, even very close to an input stroke (mix factor ~0 or ~1).

This patch adds an alternative interpolation function with explicit segment
indices and fractions, which can then be computed by the interpolation tool.
The point segment factors are chosen such that each point of the input strokes
has an exact matching point in the interpolation. When the factor is close to
0 or 1 the shape of the curve thus matches the respective input exactly.

This approach is more similar to what GPv2 did, except instead of sub-dividing
each segment it simply generates a _local_ uniform sample to fit more points
into the same segment. These extra points are colinear at the extremes of the
mix factor range, so the curve matches the input curves visually.

Pull Request: https://projects.blender.org/blender/blender/pulls/130594
2025-01-21 13:36:37 +01:00
Pratik Borhade
c479e0c2de Fix #132545: Grease Pencil: Change primitive tool radius/strength with hotkey
Move keymap for brush radius/strength out of `km_grease_pencil_brush_stroke`.
Poll function of it skips primitive tools (see:`keymap_grease_pencil_brush_stroke_poll`)

Pull Request: https://projects.blender.org/blender/blender/pulls/132589
2025-01-19 10:00:18 +01:00
Casey Bianco-Davis
3f8b95f8c2 Grease Pencil: Option to subdivide last segment when closing stroke
Adds a option to add new points on the last segment to match point density.
This matches the legacy grease pencil operator.

Resolves: #125262

Pull Request: https://projects.blender.org/blender/blender/pulls/133026
2025-01-16 11:06:41 +01:00
Campbell Barton
d18fb4010c Keymap: resolve nurbs edit-mode conflict between "Repeat" & "Select Row"
Use "Ctrl-Shift-R" for select row so the "Repeat" shortcut is available.

Resolves #83123.
2025-01-14 17:56:10 +11:00
Damien Picard
100d7094f1 I18n: Disambiguate "Drag"
- In the context of physics, a force.
- In the context of UI, a mouse action.

Issue reported by Hoang Duy Tran.
2025-01-13 12:40:45 +01:00
Habib Gahbiche
9b484b5251 UI: Add hint for snapping inversion in status bar
Followup to https://projects.blender.org/blender/blender/pulls/130379

Status bar now shows correctly that pressing `ctrl` while snapping will invert snapping.

Pull Request: https://projects.blender.org/blender/blender/pulls/131009
2025-01-10 10:12:27 +01:00
Richard Antalik
8ce5356522 VSE: Text editing in preview
This commit implements most features needed for simple text editing.

Active text strip can be edited in preview by pressing tab key, which
enabled text editing mode. With this mode active, outline matches text
boundary box and cursor is drawn.

Cursor can be moved with usual keys. Pressing shift starts selection.
Selection and navigation works when text is scaled or rotated. Mirrored
text is not supported in this PR. it can be done, but the text is
unreadable that way, so I kept it simple.

Multi line text is supported. Pressing return key starts new line.

Copy/paste operator uses OS copy paste buffer, so text from other apps
can be pasted.

Text is still limited to 512 characters. Text string property still
exists in side panel and is limited to single line. Individual
characters can not be styled in different way like in 3D viewport, but
the code is mostly ready for such feature.

Ref: #126547

Pull Request: https://projects.blender.org/blender/blender/pulls/127239
2024-12-19 15:56:54 +01:00
Sean Kim
0c1ee9eba2 Texture Paint: Add keybind for "merged" option when sampling colors
The removal of the UNDO flag to prevent adding undo steps when using the
`paint.sample_color` operator results in the "Sample Merged" option
being inaccessible to users without them adding a keymap of their own.

This commit makes the following changes:
* For Texture Paint using the default blender keymap, the Shift-Ctrl-X
  keybind is assigned to this operator with the merged option set to True
* For Texture Paint, using the industry compatible keymap, the Shift-I
  keybind is assigned to this operator with the merged option set to
  True

This parameter is only relevant for 3D Texture Painting so it is not
added to the other modes.

For all other `paint.sample_color` entries in both the keymap and in
some menus, the `merge` option is explicitly set to False.

Ref: #101144

Pull Request: https://projects.blender.org/blender/blender/pulls/132047
2024-12-18 20:30:10 +01:00
ernst-ellert
c4b8210c55 VSE: Add Duplicate operator for preview region
This is implemented as macro `sequencer.preview_duplicate_move`. New
macro is needed, because different transform operator is called than in
`sequencer.duplicate_move`

Duplicate operator was modified to handle overlap and to delete sound
strips after duplication.

When strip is duplicated in preview, it will be moved to nearest free
channel above original strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/131529
2024-12-17 17:42:54 +01:00
Pratik Borhade
1debbcae1e Fix #130853: Asset shelf popup when Spacebar mapped to different actions
Similar to toolbar, when spacebar is mapped to `play`, use `shift +
spacebar` for asset-shelf popup. When spacebar mapped `toolbar`, invoke
asset shelf in paint modes. When `spacebar=search`, do not map any key
for asset-shelf popup

Co-authored-by: Julian Eisel

Pull Request: https://projects.blender.org/blender/blender/pulls/131351
2024-12-17 11:15:26 +01:00
Falk David
612be514c6 Grease Pencil: Add lasso/box erase operators in draw mode
In Blender 4.2 in Grease Pencil draw mode it was possible to
erase strokes using box and lasso gestures.

Under the hood, these were just using the selection operators
that had special deletion handling if the object was in draw mode.

Rather than hacking this into the selection operations, this adds
two new operators:
* `grease_pencil.erase_lasso`
* `grease_pencil.erase_box`

When using one of the erase operations with auto-key, the previous
keyframe will be duplicated to the current frame (for the drawings
that are affected by the eraser).

They are mapped to the same shortcuts than the selection
operators in Blender 4.2.
* Lasso erase: `Ctrl`+`Alt`+`RMB`.
* Box erase: `B`.

This is part of #130518.

Pull Request: https://projects.blender.org/blender/blender/pulls/131504
2024-12-10 11:50:05 +01:00