Commit Graph

162 Commits

Author SHA1 Message Date
Hans Goudey
c02784bd4f Cleanup: Make format 2023-12-11 15:47:11 -05:00
Hans Goudey
dcf9d74cba Cleanup: Remove unused curves keymap items 2023-12-11 15:47:11 -05:00
Hans Goudey
9af176bfe6 Curves: Add edit mode duplicate operator
Reuse the grease pencil implementation added in:
- fb275bc040c1d6e8e23d57e6f818b854a067276d
- 5799a26568819ce27e8c12df96b7ffba84cc00f9
2023-12-11 15:47:11 -05:00
laurynas
feae0b4173 Curves: Support for edit mode draw tool
Adds new curves support to "Draw Curve" operator. This is a direct copy
and replace of the old code to the new editors directly, with a change to
create the new data structure instead of the old one. There is no attempt
at code deduplication, since that would complicate removing the old
curve type when it comes time.

To replace the "2D curve" option a new operator property is added
for projecting to the Z=0 plane.

Pull Request: https://projects.blender.org/blender/blender/pulls/115864
2023-12-11 19:44:19 +01:00
Campbell Barton
9ddd5126fe Fix #115887: Fallback tool only tweaks single elements
Use the same pass-through option when the select tool is used as a
fallback.
2023-12-08 18:09:51 +11:00
Falk David
35b9e37295 Fix #115716: Empty Grease Pencil Keymap Warning
This fixes the keymap warning by removing (commentting) the empty
keymap. Once we have something to assign, we can uncomment it.

Pull Request: https://projects.blender.org/blender/blender/pulls/115796
2023-12-05 14:45:52 +01:00
Campbell Barton
32c5ea6262 Cleanup: format 2023-12-02 14:56:12 +11:00
Hans Goudey
0978f9486e Sculpt: Remove redundant "reveal all" operator
This operator (`SCULPT_OT_reveal_all`) is redundant with
the "Hide Show" operator (`PAINT_OT_hide_show`). Since
the latter was recently changed to be much faster, remove the
former and update keymaps and menus. The industry compatible
keymap actually already contains the hide/show operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/115629
2023-12-01 17:32:09 +01:00
Christoph Lendenfeld
24ae0e3666 Fix: script_validate_keymap test failed
The issue was that `("value", True)` was passed in
when this is not supported. It didn't break while running
but it did break the test.
2023-12-01 15:32:32 +01:00
Daiki Hashimoto
edcac1f48b Fix #44834: Add bone selection icon next to face and vertex selection in weight paint mode
Currently, in weight paint mode, there is an icon for
face and vertex selection mode, but there isn't one
for the default mode where the user can select a bone
in any tool by alt clicking.
This lack of indication might lead to confusion for the users
when they are not able to select a bone by
alt clicking during weight painting.

By adding a bone selection icon when there is a pose
mode armature, we can communicate to the user that:
1. they can select a bone while the bone selection icon is active.
(when they are not in face or vertex selection mode)
2. they have forgot to select an armature when entering
weight paint mode by not showing the bone selection
icon at all when there is no pose mode armature.

When the bone selection icon is inactive,
the user can't select a bone.
(alt clicking selects face and vertex mode's respective element)

When no armature is selected when entering weight paint mode,
the bone selection icon doesn't show up indicating that the user
has forgot to select an armature.
(The user is also unable to select a bone by alt clicking.)

## Selection tool for bone selection mode
Currently, while selection tools exist for face and vertex
selection mode, one doesn't exist for the default mode
(bone selection mode). As the default mode will be getting
a clear indicator that it will function as a bone selection mode,
I added a selection tool entry for the bone selection mode.

Face and vertex selection modes has the shortcut 1 and 2,
so it seemed natural to give bone selection mode the shortcut of 3.

Pull Request: https://projects.blender.org/blender/blender/pulls/115409
2023-12-01 13:38:58 +01:00
Antonio Vazquez
11f606f88f GPv3: Menu to Select Material using U key
This PR includes the popup menu used to select a material pressing `U` key.

The menu is used in Draw, Sculpt and Vertex paint mode in GPv2 but this patch only includes Draw mode because other modes are not avaliable in GPv3 yet.

Related to #114203

Pull Request: https://projects.blender.org/blender/blender/pulls/114694
2023-12-01 13:12:10 +01:00
Matias Mendiola
b8a785b65b GPv3: Show and hide layers operators
- New Operator: GREASE_PENCIL_OT_layer_hide
- New Operator: GREASE_PENCIL_OT_layer_reveal
- Added menus to Edit and Draw Modes
- Added Keymap via _template_items_hide_reveal_actions()

Note: Operator names were changed for consistency with other layers operators that use _layer_ on their names

Pull Request: https://projects.blender.org/blender/blender/pulls/114348
2023-12-01 12:55:30 +01:00
casey bianco-davis
fb275bc040 GPv3: Duplicate Points operator
Adds the duplicate points operator fallowing the legacy system.

Resolves #113640
Pull Request: https://projects.blender.org/blender/blender/pulls/115389
2023-12-01 10:14:14 +01:00
Clément Busschaert
671f428ead GPv3: "Set Active Layer" operator and menu
Resolves #113915 .

Ports the `layer_active` operator to set the active layer from an index.
Adds the menu to set the active layer from a list.

Pull Request: https://projects.blender.org/blender/blender/pulls/115606
2023-11-30 16:10:06 +01:00
Christoph Lendenfeld
a99e419b6e Anim: Insert keyframes without keying sets
When animators want to key something in the viewport,
the code needs to know *which properties* should be keyed of that selected thing.
So far that was done with keying sets, and a pop-up that let's
you choose the keying set to use. You can get rid of the popup by
choosing a keying set ahead of time. But that is also not always desirable.

That pop-up is quite confusing and gives way too many options.
To simplify this process this PR adds a User Preference option to choose one or more of:
* Location
* Rotation
* Scale
* Rotation Mode
* Custom Properties

Now whenever the `I` key is pressed in the viewport,
and no keying set is enabled, it reads the preferences for which channels to insert.

# User Facing changes
* The popup will not be shown when pressing the hotkey,
 but you can still explicitly use keying sets by going to the menu
* Which channels are keyed is defined by a User Preference setting under animation
* when a keying set is used explicitly, the User Preference settings are ignored

Part of #113278

Pull Request: https://projects.blender.org/blender/blender/pulls/113504
2023-11-21 15:38:01 +01:00
Germano Cavalcante
0f2988fd2c Revert preset changes in c6db3f98bb
This partialy reverts commit c6db3f98bbc152a9c839010f25fffbbdff576660.

The presets are case-sensitive, as explained in issue #110642.
2023-11-20 19:41:25 -03:00
Pratik Borhade
bf7d4ef054 Fix #115025: Transform operations not working in particle edit mode
Earlier 3d-view keymap was used by particle edit mode for transform
operation. After d7558a243c, this global transform keymap is removed.
So add `_template_items_transform_actions` in particle-edit mode to
allow transforming from shortcuts.

Pull Request: https://projects.blender.org/blender/blender/pulls/115031
2023-11-18 07:37:03 +01:00
Nate Rupsis
661e7e451a Anim: Rename NLA "Channels" to "Tracks"
Updating "NLA Channel"  to "NLA Tracks" across board, since the terminology "Tracks" is the most prevalent in operators, code, etc.
2023-11-16 17:59:18 +01:00
Germano Cavalcante
c6db3f98bb Fix modal key assignment for "Rotate Normals" in keymap versioning
Error in 78943edc5d

The key was not included in the appropriate condition block, leading to
an error.
2023-11-13 09:47:10 -03:00
Germano Cavalcante
78943edc5d Transform: Custom modifier to navigate while transforming
Discussed in #114646.

This commit transforms the "alt_navigation" option of the transform
operators into a new modal key item. "PASSTHROUGH_NAVIGATE"

In addition to cleaning up a lot of the code, it allows you to
customize the key chosen to navigate while transforming.
2023-11-09 21:33:34 -03:00
Aaron Franke
c62009a6ac 3D View: add local up/down movement to walk navigation
Minor usability enhancement for the walk navigation mode. Previously
walk navigation had local movement for forward/back/left/right,
but only global movement for up/down.
This PR adds local up/down movement, bound to the R and F keys.

Ref: !111682
2023-11-05 17:23:59 +11:00
Gilberto Rodrigues
dfd1b63cc7 UI: improve mesh edge highlighting
Changes to edit mode mesh overlays, use hue shift instead of color
fading/darkening for selection mode visual differentiation, and some
theme changes to improve the display of mesh edges and faces with good
selection visibility.

- Removed "edge" toggle from edit mode overlays panel.
- No longer halves the edge and face alpha depending on selection mode.
  Half the face alpha in wire-frame mode. For better visibility on most
  themes.

Ref !111431
2023-11-02 22:09:17 +11:00
casey bianco-davis
c57fe9a6e0 Curves: Add radius transform mode to edit mode
This adds the radius control operator and active tool
to curves edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/114017
2023-10-31 11:33:32 +01:00
Campbell Barton
6cc0d10d5f Merge branch 'blender-v4.0-release' 2023-10-31 16:26:53 +11:00
Julien Kaspar
ef0b7337a6 Fix #113920: Missing IC shortcuts
Add various shortcuts that were missing from the industry compatible
key-map. Various grease pencil shortcuts that were intended to be there
are now present.

These issues are now fixed:
- `Alt A` = Missing from GP sculpt mode.
- `Shift S` = Missing.
- `Shift Alt S` = Insert Blank Keyframe - Not added to Edit mode.
- `Y` = Active Layer Menu - Not added to Edit mode.
- `Shift Y` = Merge Down - Does not exist.
- `Shift Backspace/Delete` = Delete All Active Frames is missing from
  every mode except Draw.
- `Backspace/Delete` = Delete Menu is missing from all modes except
  Edit.
2023-10-31 16:01:04 +11:00
Lukas Stockner
d15013b583 Merge branch 'blender-v4.0-release' 2023-10-31 05:48:58 +01:00
Campbell Barton
4bec9d0d71 Fix #114282: Extrude to Cursor tool no longer tweaks on drag
Regression in [0] which only ran drag events if the press event passed
through.

Resolve using the same logic as select picking
(see: WM_operator_flag_only_pass_through_on_press).

[0]: 4d0f846b936c9101ecb76a6db962aac2d74a460a
2023-10-31 14:55:12 +11:00
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb0db3b06838a57f7217bc945638d8df.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00
Campbell Barton
e8279ff4ee Cleanup: format 2023-10-27 12:13:46 +11:00
Matias Mendiola
fbb3726f68 GPv3: Menus updates
Adds context menus and updates existing menus with newly added operators

- Updates menu texts and separators
- Add Point Menu
- Add Stroke and Point Context Menu

Pull Request: https://projects.blender.org/blender/blender/pulls/114172
2023-10-26 16:52:31 +02:00
Campbell Barton
9762af060d Cleanup: format 2023-10-23 10:13:33 +11:00
casey bianco-davis
e266b142f6 GPv3: Transform operators
This adds the keybindings, menu, and functionally for the edit mode transform operators to grease pencil v3.

The transform operation include:
 * translate, rotate, scale, change opacity, change radius

Pull Request: https://projects.blender.org/blender/blender/pulls/111836
2023-10-21 15:12:47 +02:00
Dalai Felinto
45fd780dff Cleanup: make format 2023-10-20 19:12:58 +02:00
casey bianco-davis
5a79023409 GPv3: Cyclical set operator
Simply sets the cyclical property selected strokes. Note this does not add extra geometry like the legacy operator.

Note: also adds a key bind 'alt c' to toggle, same as for curves.

Resolves #113671

Pull Request: https://projects.blender.org/blender/blender/pulls/111904
2023-10-20 10:12:24 +02:00
Pratik Borhade
d836aa7931 GPv3: Expose insert keyframe in menu
Create menu similar to legacy GP to expose insert keyframe operation in
user interface. Pressing `I` key will invoke this menu.
(We can further add "key duplicate" and other relevant operation in this menu)

Pull Request: https://projects.blender.org/blender/blender/pulls/113663
2023-10-13 14:07:21 +02:00
Philipp Oeser
ec5287bb39 Merge branch 'blender-v4.0-release' 2023-10-11 09:20:28 +02:00
Philipp Oeser
9783611518 Fix #113287: Industry Compatible Keymap: Node Editor Search missing
Caused by 974edc588547 / 7f9d51853c978ff

You can now type to search directly in the `Add` menu.
Bit unfortunate though that this is not mapped to any shortcut in the
`Industry Compatible` keymap anymore

I think we could just add TAB back (but this time, mapped to
`NODE_MT_add`).

Pull Request: https://projects.blender.org/blender/blender/pulls/113446
2023-10-11 09:19:19 +02:00
Falk David
7e87435cf4 GPv3: Initial drawing tool
This PR implements an initial drawing tool that can already be used for testing.
While this is not fully feature complete (compared to the current grease pencil draw tool) the following is already implemented:

* Pressure support for radius and opacity.
* Material color and vertex color support.
* New active smoothing algorithm based on curve fitting.
* Simplify algorithm as a post-process step.

Some deliberate limitations include:
* The drawing plane is always the front plane. Drawing on surfaces is also not supported.
*

The current approach has not been optimized for performance yet. The goal was to have a straightforward implementation
first and then focus on performance later.

There are numerous parameters in the code that are hard-coded for now. These should be exposed at some point, potentially as user settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/110093
2023-10-06 10:49:54 +02:00
d6b86f278b Anim: keymap, replace 'show all layers' with 'show all collections'
Make the Ctrl+ACCENT_GRAVE hotkey call the 'show all bone collections'
operator (`armature.collection_show_all`), instead of 'show all armature
layers' (`armature.layers_show_all`).

This was the last reference to `armature.layers_show_all`, and the operator
has been removed.
2023-09-29 11:52:44 +02:00
Campbell Barton
790fea431f Cleanup: use since quotes for enum values, wrap multi-line brackets 2023-09-29 14:41:48 +10:00
6d0e6f0f3e Anim: remove pose.bone_layers operator
Remove the obsolete `pose.bone_layers` operator, it's been replaced by
bone collections.
2023-09-28 14:20:24 +02:00
Campbell Barton
afeb3e7784 Fix #112761: Sequencer tweak tool does not box-select
Clicking and dragging over and empty space wasn't box selecting.
2023-09-28 16:42:50 +10:00
Julien Kaspar
fa27e6561e Keymap: restore most used brush shortcuts
Based on feedback from users this PR brings back the most commonly used
brush shortcuts in sculpt mode. Essentially reverting some of the
changes from #108712

There are multiple reasons behind this decision:

- Anyone coming from a previous version will instinctively reassign the
  brush shortcuts to the same keys as before, introducing shortcut
  conflicts as a result. Having the shortcuts there by default makes this
  case less likely as it makes available brush shortcuts more obvious.
- The default `paint.brush_select` operator is hard to set up manually
  and is offering behavior that isn't available with the
  `wm.tool_set_by_id` which is far easier to create from the UI
- There are too many brushes available to know which ones are the most
  common ones.

There are some additional changes:
- `S` is now used for the Smooth brush.
- Draw brush is now assigned to `V` to avoid conflicts on `X`.
- `Shift T` is using the Scrape instead of Flatten brush.
- `C` is using the Clay Strip instead of Clay brush.

Removing the brush shortcuts can be revisited later once the brush
management is overhauled.

Ref !112898.
2023-09-28 12:52:49 +10:00
Julien Kaspar
a3d0006ac1 Keymap: IC, minor adjustments based on user requests
Some small adjustments based on user requests from the community.

- The shortcut on 4 for Object Mode was much preferred.
  As a compromise the mode pie menu moved to 5.
- The region selection shortcut from the default keymap was not added.
  It's now available on Ctrl Shift Alt LMB.

Ref !112628.
2023-09-28 12:52:47 +10:00
Julien Kaspar
a0e5b03126 Keymap: IC, regions shortcuts and fixed inconsistencies
This is a followup fixes related to #105298

This PR adds shortcuts to toggle the sidebar, toolbar, channels and
other regions across various editors with the Ctrl-LeftBracket &
Ctrl-RightBracket shortcuts.

An additional shortcut to toggle the Asset Shelf in the 3D Viewport via
Shift Spacebar was also added. This shortcut will be important for
various workflows in the future.

To avoid shortcut conflicts and improve consistency, Ctrl-L is now
consistently being used for select_linked operations.

Ref !112042.
2023-09-28 12:52:46 +10:00
Damien Picard
1dfbc1ef83 UI: fix and improve a few messages
- "Tapping Alt...": remove newline in tooltip.
- Add descriptions for the From Left and From Right of the Shear
  Keyframes operator's direction items, instead of just "foo":
  - "Shear the keys using the left key as reference", and
  - "Shear the keys using the right key as reference".
- "Affects the value" -> "Affect", use the imperative.
- "Increase or decrease the value of selected keys \n
  in relationship to their average"
  -> "Scale selected key values by their combined average":
  remove the newline and rephrase the unclear description. New
  description by Harley Acheson.
- "Redefine equalizer graphs": this is an operator name, it should be
  title case.
- "USD Skeleton Import" warning: inconsistent whitespace.
- "%s: Joint weights and joint indices size mismatch size mismatch for
  prim %s": remove duplicated "size mismatch".
- "USD export:  couldn't copy texture tile from %s to %s": remove
  duplicate whitespace, change "couldn't" to "could not" to respect
  the style guide.
- "Temp. Diff." -> expand the abbreviation to "Temperature Difference"
- "Registering node tree class:" do not use formatting just to reduce
  redundancy in a few messages, but write it explicitly each time.
  This is more legible, and much better for translations.
- "Absolute time alignment while translating" -> "Absolute time
  alignment when transforming keyframes" because this applies to all
  transforms, not translation only.
- "# characters defines the [...] length of frame numbers" ->
  "define" (typo), "padding" is more specific than length.

Pull Request: https://projects.blender.org/blender/blender/pulls/112975
2023-09-27 21:29:02 +02:00
Richard Antalik
86a0d0015a VSE: Improve retiming UI
Currently retiming is quite awkward, when you need to retime multiple
strips strips in sync. It is possible to use meta strips, but this is
still not great. This is resolved by implementing selection.

General changes:
Gizmos are removed, since they are designed to operate only on active
strip and don't support selection.
Transform operator code is implemented for retiming data, which allows
more sophisticated manipulation.
Instead of drawing marker-like symbols, keyframes are drawn to
represent retiming data. Retiming handles are now called keys. To have
consistent names, DNA structures have been renamed.
Retiming data is drawn on strip as overlay.

UI changes:
Retiming tool is removed. To edit retiming data, press Ctrl + R, select
a key and move it. When retiming is edited, retiming menu and
context menu shows more relevant features, like making transitions.
Strip and retiming key selection can not be combined. It is possible to
use box select operator to select keys, if any key is selected.
Otherwise strips are selected.
Adding retiming keys is possible with I shortcut or from menu.
Retiming keys are always drawn at strip left and right boundary. These
keys do not really exist until they are selected. This is to simplify
retiming of strips that are resized. These keys are called "fake keys"
in code.

API changes:
Functions, properties and types related to retiming handles are renamed
to retiming keys:
retiming_handle_add() -> retiming_key_add()
retiming_handle_move() -> retiming_key_move()
retiming_handle_remove() -> retiming_key_remove()
retiming_handles -> retiming_keys
RetimingHandle -> RetimingKey

Retiming editing "mode" is activated by setting `Sequence.show_retiming_keys`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109044
2023-09-27 01:45:59 +02:00
Jeroen Bakker
7b379eb657 Cleanup: Make format 2023-09-22 08:32:03 +02:00
Harley Acheson
18e07098ef UI: Support additional console text operations
Adds the ability to set text cursor position in the Console editor
by clicking with the mouse and many other expected operations such as
cut, select all & deselect on text entry.

Ref !108626
2023-09-22 13:36:29 +10:00
Campbell Barton
fb624720eb Cleanup: remove 'apple' variable for key-map parameters
The OSKEY-Comma key-map item will be kept on macOS by the
bl_keymap_utils.platform_helpers utility function.
2023-09-22 10:37:23 +10:00