123 Commits

Author SHA1 Message Date
Campbell Barton
7a249222be Cleanup: tweak multi-line parenthesis for Python scripts
Reduce right shift, moving closing parenthesis onto own line
for clarity & reducing diff noise in some cases.

Ref !147857
2025-10-12 03:31:31 +00:00
Campbell Barton
9ee1076fd4 Cleanup: warning from ruff 2025-09-23 09:41:14 +10:00
Damien Picard
ddbc6ed858 I18n: Allow translation of some messages using string formatting
- Add `iface_` translation functions and `translate=False` to a few UI
  elements.
- Add `rpt_` translation functions to a few reports.
2025-09-12 18:30:56 +02:00
Leon Schittek
c954d6cdfd Nodes: Add tools for "Mute Links" and "Add Reroute" operator
Expose the "Mute Links" add "Add Reroute" operator as active tools
in the node editor similar to the "Links Cut" tool.

This also works around #134153 by adding additional tools in the same
button group to the toolbar.

Pull Request: https://projects.blender.org/blender/blender/pulls/140429
2025-09-10 15:12:37 +02:00
Pratik Borhade
08cf64315d Cleanup: Grease Pencil: Remove legacy UI code
Remove stale legacy python UI code, not used anymore by new grease
pencil structure.

Pull Request: https://projects.blender.org/blender/blender/pulls/135507
2025-09-08 11:52:00 +02:00
Casey Bianco-Davis
cbdf12d2a9 Curves: Pen Tool
This PR adds the `Pen Tool` to `Curves` objects.
The logic and keybinds are shared with the Grease Pencil `Pen Tool`

Unlike the legacy pen tool, this version can works with multiple objects.

Note: Some changes have been made from the legacy curve object's pen tool.
A list of changes can be found at #142646

Pull Request: https://projects.blender.org/blender/blender/pulls/144833
2025-09-07 16:29:07 +02:00
Ramon Klauck
b910e04a2a VSE: Implement Lasso Select
This feature works like the select lasso in other editors. In preview
the user can draw a region they want to select and when a strips origin
is in this lasso region the strip gets selected.

In timeline the user can do the same and the strip gets selected when
the strip is in the lasso or some part of the lasso is in the strip.

The tool can be accessed through in the toolbar or via shortcut.

Pull Request: https://projects.blender.org/blender/blender/pulls/143391
2025-09-05 17:53:13 +02:00
Ramon Klauck
098be390ca VSE: Implement Select Circle
This feature works like the select circle in any other modes. The user
can press "C" in preview or timeline and then select or deselect strips
by pressing the left or middle mouse button.

It’s an enhancement for the VSE preview because:
1. It makes it more similar to other editors in Blender
2. This behavior makes it easier to select specific overlapping strips
in preview, that is because the select circle only checks for the
origin of the strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/141422
2025-09-03 17:57:00 +02:00
John Kiril Swenson
96f5bb9f05 VSE: Slip toolbar tool
This PR adds a slip tool in the toolbar with its own custom icon for
applying slips using the mouse. This is useful for e.g. tablets where a
keyboard is not handy and a button would be best to activate the
operator.

There is also a custom cursor that appears when hovering over valid,
slippable strips (and a "stop" icon when the strip cannot be slipped).

Alt may be used in order to ignore slipping connected strips when using
the tool, similar to selection logic. The slip tool only performs its
sole function of slipping and as such does not change the selection
state.

In the future, we can also add "slide" functionality to the same tool,
giving it multiple functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/143513
2025-08-25 20:36:01 +02:00
Casey Bianco-Davis
a767671c56 Grease Pencil: Edit Mode Pen Tool
This adds the `Pen` tool to Grease Pencil Edit Mode.

With the pen tool you can:
- Extrude points by `Left Click`.
- Move the handles by dragging the mouse.
- Snap handles to 45 degree increments with `Shift`.
- Cycle through the handle types by `Double Clicking`.
- Add new point on segments by `Ctrl Clicking`.
- Remove existing point by `Ctrl Clicking`.
- Close a curve by clicking on one end while having the other selected.
- Move existing segment by clicking and dragging on the edge.
- Move points by clicking and dragging the mouse.

Some changes have been made compared to the legacy
curve object's pen tool:
- `Angle locking` with `Alt` was replaced with `Angle Snapping`
   using `Shift`. This was done to match the behavior of Grease Pencil
   primitive tools.
- `Move Entire Point` was changed from the `Space` key to `Alt`. This
   was done because some laptops can't move the mouse while
  `Space` is held.
- `Link Handles` and `Free Align Toggle` were not implemented.
- `Toggle Vector` and `Close Spline Method` were removed.
- `Close Spline` was removed and set to always be true.
- `Extrude Handle` type was removed as a option and was replaced
   by the `shift` modifier key when clicking.
- Newly created points are placed on the drawing plane, instead of
  the view plane.

When a new curve is created, the material will be the active material
and the radius will be set from the `radius` property.

Note: This tool is added to edit mode because it uses handle selection
and bézier overlays which currently don't exist in draw mode.
A future PR will implement a draw mode version.

Pull Request: https://projects.blender.org/blender/blender/pulls/142646
2025-08-15 18:17:09 +02:00
Sean Kim
63cee26814 Fix #144135: Weight Paint gradient toolbar missing
Introduced in 4434a30d40

Pull Request: https://projects.blender.org/blender/blender/pulls/144165
2025-08-07 21:00:32 +02:00
Nig3l
4bede1b555 Image Mask Editor: Expose tools in the Toolbar
Expose existing mask operators as tools in the toolbar.

The primitive tools are commented out since interactively placement
isn't currently supported by the operators.

Ref !136086
2025-08-06 09:44:24 +00:00
Sean Kim
4434a30d40 Paint: Make UnifiedPaintSettings a per-mode instead of scene-wide value
Historically, the `UnifiedPaintSettings` struct has been used to
provide users the ability to set brush values at a scene level. Examples
of such attributes are the brush size, strength, and color, to name a
few.

Instead of these values being shared across all of the grease pencil,
mesh painting, and curves sculpting modes. This commit migrates the
data to the `Paint` struct, meaning that each individual mode (e.g.
Sculpt, Vertex Paint, Grease Pencil Draw) now has the ability to change
these values without affecting other modes.

While this change is large, the majority of the work is simply
refactoring access to the `UnifiedPaintSetting` struct. to ensure the
correct property is being retrieved.

Resolves #134077

Pull Request: https://projects.blender.org/blender/blender/pulls/139766
2025-06-21 02:35:14 +02: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
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
cd04584412 Point Cloud: Implement transform operator
This ends up being very simple because point cloud has
no connectivity information and each element is just one
position.

Also implement the 3D transform gizmo.

The geometry deformation system isn't implemented in this
commit. That can be tacked later.
2025-02-16 23:36:04 -05:00
Hans Goudey
62b568d393 Point Cloud: Implement box, circle, lasso select tools
Signficantly simplified versions of the similar curves code.
These require #134623 to function.
2025-02-16 22:48:35 -05:00
Dalai Felinto
96d84d1832 Point Cloud: Expose 3D Cursor, annotation and ruler tools
<img width="298" alt="image.png" src="attachments/9336d17d-7dd5-445b-892c-ad7e91bb98d6">

---

The Selection tools are not working, so I did not add them to the toolbar.

Pull Request: https://projects.blender.org/blender/blender/pulls/134453
2025-02-12 22:05:07 +01:00
Campbell Barton
84c9e6e655 Cleanup: use single quotes for enums 2025-01-21 23:50:17 +11:00
Campbell Barton
be0c9174aa Cleanup: argument wrapping for Python scripts
- Wrap the closing parenthesis onto it's own line
  which makes assignments to the return value
  read better.
- Reduce right-shift with multi-line function calls.
2025-01-14 12:53:32 +11:00
dupoxy
dc0032cc2a Fix #124937: Grease Pencil: Change Shear tool icon to match Blender 4.2
Update the icon of the shear tool in edit mode to match the
Grease Pencil shear icon in Blender 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/131993
2024-12-18 19:15:30 +01:00
Sean Kim
a820e2d393 Fix: Clone brush missing from image texture paint
Missed in 3798852071

Pull Request: https://projects.blender.org/blender/blender/pulls/131005
2024-11-27 21:25:21 +01:00
Sean Kim
5c880a5291 UI: Revert default brush icon to monochrome version
Earlier in the brush assets project, for mesh sculpting, grease pencil,
and curves sculpting, the toolbar brush icon used was changed to a
version with a green highlight. This commit reverts that change to use
the monochrome grey icon instead in each of these modes.

For Sculpt mode specifically, the Paint tool icon is kept as this green
version to differentiate the usages. In future releases, further changes
are planned for sculpting related brushes to better represent their
functionality.

---

### Sculpt Mode Toolbar

![image](/attachments/f1575814-88f0-44f7-8ab6-7b069ff09763)

Pull Request: https://projects.blender.org/blender/blender/pulls/129934
2024-11-07 22:13:58 +01:00
Sean Kim
c2073095c9 Fix #129116: Texture Paint Line stroke preview does not show up
Custom paint overlays (smooth stroke & line stroke) do not show up if
a specific cursor is set for the tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/129132
2024-10-18 20:20:50 +02:00
John Kiril Swenson
d5d81c5078 VSE: Switch to box select default for timeline
PR #128051 made some improvements to code by cleaning up properties and
simplifying logic.

However, the default tool in most spaces is box select. By switching to
box select default, there should be more front-facing consistency across
spaces while still retaining near-identical behavior.

This patch would fix the small bug listed in #128671 while keeping the
simplified code benefits from #128051.

Also:
- Move selection keymap items up in the Sequencer (Global) keymap so it
  is more visible (similar to Node Editor ordering).
- Split `side_of_frame` property for ctrl press keymap item into a
  separate keymap item on ctrl click for both LCS and RCS to avoid
  clashing with ctrl+drag for box selects in RCS.

Pull Request: https://projects.blender.org/blender/blender/pulls/129028
2024-10-18 05:50:09 +02:00
Lukas Tönne
3d6a142162 GPv3: Remove unused GPv2 operators
Removes many of the operators, panels, and menus used exclusively by Grease Pencil v2 that are no longer needed in v3.
No functional changes are expected.

Some operators are still used by the annotations system and have to be kept around. These may be renamed in future.

Pull Request: https://projects.blender.org/blender/blender/pulls/128521
2024-10-04 13:05:09 +02:00
John Kiril Swenson
d2a802d3c6 VSE: Remove timeline box select
Remove the box select tool from the timeline to simplify selection
logic, avoid confusion for users, and make maintaining the code
easier in the future. It also brings the selection system  closer
to other industry-standard NLEs.

It also fixes an issue caused by d2091b4b1.

More details in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/128051
2024-10-03 00:37:00 +02:00
Pablo Vazquez
177e2ac837 Grease Pencil: Tool settings layout adjustments
Small adjustments to improve consistency in tool settings
between different tools.

Pull Request: https://projects.blender.org/blender/blender/pulls/128491
2024-10-03 00:28:50 +02:00
Harley Acheson
8d0fc95fb6 Cleanup: Make format
Just the result of running Make Format
2024-10-01 12:17:43 -07:00
Julian Eisel
3798852071 Sculpt/Paint: Bring back some brush tools for paint modes
Since brush assets were merged, all sculpt and paint modes have a unified
"Brush" tool that is used for all brushes. Based on feedback, this mixes brush
types a bit too much, so some specific tools that use brushes should be brought
back. These brush types just behave very different from the main brush types,
and users expect them to be easily accessible from the toolbar. This also makes
them more discoverable and having tools that remember their last used brush can
be useful too (e.g. assigning shortcut to eraser tool to switch back to last
used eraser, rather than a specific eraser brush).

Note that further changes are planned, to get a true "best of both worlds"
design, where people can use a global brush library without having to worry
about tools, but brushes can also be accessed via tool categorization.
The new design works well with both mental models without being a compromise
in-between.

a79f9100a6 already brought back some tool for grease pencil draw mode, with this
commit the design is now applied to all sculpt & paint modes.

See PR for a list of tools that were brought back.

Design Task: https://projects.blender.org/blender/blender/issues/128066
Pull Request: https://projects.blender.org/blender/blender/pulls/128038
2024-10-01 18:03:33 +02:00
Campbell Barton
a9dee36974 Cleanup: remove unused variables, imports 2024-09-27 23:37:18 +10:00
Falk David
c496ad20c8 GPv3: Draw Mode: Reorder tools in toolbar
These changes were discussed in the previous [module meeting](https://devtalk.blender.org/t/2024-09-23-grease-pencil-module-meeting/36748).
* The primitive tools are grouped together, the default is the box primitive.
* The order of draw tools now is 1) Draw 2) Erase 3) Fill 4) Primitives

Pull Request: https://projects.blender.org/blender/blender/pulls/128062
2024-09-24 13:41:05 +02:00
casey bianco-davis
1b6220a4ba GPv3: Fill gradient tool
This adds a gradient tool allowing the user to specify a gradient by dragging from a start to a end point.
This behaves the same as most gradient tool in other softwares.

Pull Request: https://projects.blender.org/blender/blender/pulls/120121
2024-09-24 11:25:28 +02:00
Julian Eisel
a79f9100a6 Grease Pencil: Bring back eraser and fill tools (now using brush assets)
Followup to a38c96b92c, which implemented the necessary sculpt, paint and
tool-system changes. All this commit has to do is bring back the tool
definitions.

The brush assets project merged all brush based tools into a single, "Brush"
tool. After feedback, we want to bring back some of the previous brush based
tools. For example in grease pencil draw mode, not having an eraser or fill tool
available, and having to go through all the brush assets instead made the
workflow more cumbersome, and features less discoverable (an eraser tool in the
toolbar is quite easy to find, a brush deep down in the asset library may not
be).

Pull Request: https://projects.blender.org/blender/blender/pulls/125449/files
2024-09-20 18:13:19 +02:00
Julian Eisel
8c98fcc1f1 Fix: Grease pencil vertex paint brush tool not showing
b64bf66257 changed how brush based tools are defined. It was authored
before the vertex paint tools got added back for grease pencil v3, so
this additional change was missing.
2024-09-16 20:19:59 +02:00
Julian Eisel
d28956ab99 Tools: Add BPY tool definition option for brush type
Adds a new `brush_type` argument to pass when defining a tool.
Previously the `data_block` argument would be used for this, but its
name was unclear and misleading, it never ended up being used for
anything but brushes. `brush_type` is much more clear. Note that this
isn't used yet until !125449 is merged.

Part of https://projects.blender.org/blender/blender/issues/126032.

Reviewed as part of
https://projects.blender.org/blender/blender/pulls/125449.
2024-09-16 20:07:37 +02:00
Julian Eisel
a5d7684539 Fix: Small layout jumps of tool settings header in some paint modes
When switching between tools, layouts starting with the brush asset
selector would jump back and forth for a few pixels. Make sure they use
the same padding to avoid the jumps.
2024-09-16 15:44:31 +02:00
Julian Eisel
65fdb3fa30 Grease Pencil: Properly support brushes with draw mode primitive tools
Part of blender/blender!125449.

Since brush assets were merged, the brush asset selector and some other brush
UIs wouldn't show up for the primitive tools. This is addressed now. The
primitive tools use the same brush as the brush tool, although only the draw
brushes will work properly. !125449 addresses this so the primitive tools
remember their own draw brush, separate from the brush tool.

Turns out that these primitive tools were never tagged as using brushes by
setting the `data_block` member (or setting the `'USE_BRUSHES'` option since
b64bf66257). The UI was just hardcoded to display things like the brush selector
for primitive tools. So as far as the tool system knew, these tools did not use
brushes.

Tagging the tools properly exposed some issues that are addressed here (see PR
for details).

Pull Request: https://projects.blender.org/blender/blender/pulls/127204
2024-09-16 13:04:08 +02:00
Julian Eisel
b64bf66257 Refactor: Tools: Change how tools are marked as using brushes
The previous way of considering tools with the `data_block` member set
as using brushes was rather unclear/confusing, but also a bit outdated
with the brush assets changes. Since then most sculpt/paint modes use a
unified brush tool, there was no tool for every brush type (aka brush
tool) anymore. So now the `data_block` member was just set dynamically to
match the active brush type which is otherwise irrelevant to the tool
system now.

Further, this will become important to bring back some of the tools that
use brushes in grease pencil draw mode, see #116337. For that we want to
keep the unified brush tool, but still allow other tools that only use a
specific brush type. So marking a tool as using brushes should be done
separately from indicating a specific brush type.

Removing/replacing the `data_block` member should happen separately
still, pending further developments (e.g. see #125449).

Pull Request: https://projects.blender.org/blender/blender/pulls/125911
2024-09-16 12:20:25 +02:00
casey bianco-davis
3c67ae7785 GPv3: Rename Cutter tool to Trim
This rename the `Cutter` tool's name, code and icon to `Trim`.
The legacy Grease Pencil code is unchanged.

This was discussed in the 2024-07-30 Grease Pencil Module Meeting.

Reasons for the change:
 - Match the `Trim Stroke Ends` setting on brushes.
 - Match the `stroke_trim` operator.
 - Name is more clear and more commonly used.
 - Frees the name for a future boolean cutting tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/126452
2024-09-13 16:56:51 +02:00
Falk David
942499382d GPv3: Vertex Paint Mode
This adds the vertex paint mode and all of the tools
from GPv2:
 * Average
 * Blur
 * Draw
 * Replace
 * Smear

Pull Request: https://projects.blender.org/blender/blender/pulls/125674
2024-09-10 18:56:31 +02:00
Casey Bianco-Davis
1a07c08718 GPv3: Eyedropper tool
This adds the Eyedropper tool to GPv3.

A few changes have been made:

- Added `Brush` mode.
- Set active color in palette.
- Show the palette in the UI.
- Add UI for setting material mode.
- Drag for color accumulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/126211
2024-08-19 11:27:49 +02:00
Harley Acheson
f2f408bebf UI: Tooltip Final Period and Other Typography
This removes the terminal periods automatically added to the end of
tooltip items. The current desire is to only end in period if there
are multiple sentences - so if there is one in the middle of the
description. This also converts our uses of lists to use space and
bullet, rather than just bullet or asterisks.

Pull Request: https://projects.blender.org/blender/blender/pulls/125460
2024-07-26 18:29:50 +02:00
Sean Kim
972fadf5a4 Fix: Sculpt: Various tools not using crosshair cursor
Follow up to !123570

With !122709, many Sculpt tools were changed to remove the visual brush
radius displayed by the brush cursor to avoid confusing users. This had
the unintended side effect of forcing these tools to use the default
arrow cursor.

This commit adds the PAINT_CROSS cursor back to various Sculpt Mode
tools to remain consistent within the overall mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/124946
2024-07-18 18:14:21 +02:00
Campbell Barton
8fdb190278 Cleanup: typos in comments (duplicate words) 2024-07-14 18:55:43 +10:00
Lukas Tönne
0a70096a5b GPv3: Interpolate Tool
Interpolation tool for strokes ported from GPv2.

Adds a new operator that inserts a new frame with interpolated curves.
The source curves are taken from the previous/next keyframe.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/122155
2024-07-12 15:59:56 +02:00
Julian Eisel
c6885e00d3 Fix: Missing brush tool in grease pencil weight paint mode
Tools for grease pencil v3 weight paint mode weren't updated in
7b0ea0f1b4. Possibly because there was some back and forth in grease
pencil modes while this was being worked on.
2024-07-11 12:16:21 +02:00
Falk David
509cb361bb GPv3: Remove tint tool from tool bar
This is now accessible from the draw tool as a brush asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/124421
2024-07-09 17:17:25 +02:00
Julian Eisel
7b0ea0f1b4 Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.

With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
  handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
  removed here. That means they draw as blank now, and the icon files can be
  removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
  the Essentials asset library. Icons/previews are handled as standard asset
  previews.
- Grease pencil eraser options are replaced by a general default eraser brush
  that can be set by the user.

More changes are planned still, see task list issue below.

Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar

Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/

Tasks:
https://projects.blender.org/blender/blender/issues/116337

Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 17:50:25 +02:00
Falk David
103f3f261a Fix: GPv3: Draw Tool: Use "Dot" cursor for draw tool
When disabling the "Show Cursor" option in the tool settings for the
draw tool, the cursor was set to the OS default.
This was not the case in GPv2, which used the "Dot" cursor.

The fix enables the "Dot" cursor by default for the draw tool.
2024-07-04 11:22:32 +02:00