Commit graph

108 commits

Author SHA1 Message Date
Casey Bianco-Davis
44c411cd5d Grease Pencil: Use Unified Paint Settings in Draw Mode
This makes it so that all the draw mode tools can use
the `Unified Paint Settings`.
Similar to other modes, the toggle for using unified settings is exposed
in the side panel and in the context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/160195
2026-09-22 16:54:02 +02:00
Sean Kim
d52e9484b5 Grease Pencil: Remove support for Paint Curve stroke type
Follow up to 4e3c40527f

This and other `Stroke` options primarily used in the Mesh, Image and
Sculpt painting modes were seemingly accidentially introduced with in
the transition to GPv3.

Additionally, with the plan to merge modes into the existing Draw Mode
(#161521), this makes Grease Pencil Sculpt Mode more consistent with
both Draw Mode and Vertex Paint. Future integration with these other
stroke types can be evaluated further in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/163834
2026-09-15 23:42:16 +02:00
Sean Kim
a7a53fd5a5 Fix: UI: Incorrect experimental texture paint brush options show
We need to check against the current brush instead of only the
experimental flag.
2026-09-05 03:22:40 +02:00
Sean Kim
1feb1674bc Texture Paint: Migrate 3D draw brush out of Sculpt Mode
This commit moves the experimental 3D Texture Paint brush implementation
out of Sculpt Mode and into Texture Paint mode.

Instead of overriding the "Paint" brush in Sculpt Mode, it now
corresponds to the "Draw" brush in Texture Paint.

This is achieved by extending the existing `PAINT_OT_image_paint`
operator to use a different `PaintStroke` implementation if a supported
brush is being used with the experimental flag toggled.

Part of #162290

Pull Request: https://projects.blender.org/blender/blender/pulls/163220
2026-09-04 22:07:08 +02:00
Jerry Wei
cee72a07b2 Fix: UI: Sidebar shows both Shape and Falloff panel
This PR removes the unwanted Shape/Falloff (depending on mode) panel in
the side bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/163311
2026-09-03 01:44:30 +02:00
Jerry Wei
6ecfe4e810 Paint: Migrate unified paint flag from scene / mode level to brush level
This PR moves the controls of "Use Unified xxx" (such as Use Unified
Size) from the scene / mode level to the brush level, meaning each brush
can have this option toggled on and off separately. It used to be that
every brush shares the same toggle state.

I moved the `UNIFIED_xxx` flags from `UnifiedPaintSettings` to `Brush`.
Ialso added relevant RNA properties and hooked them up to Python
scripts.

Resolves #138469

Pull Request: https://projects.blender.org/blender/blender/pulls/159382
2026-08-18 00:21:23 +02:00
Jerry Wei
74143fb470 UI: Add "Shape" panel to brush settings
This PR merges Hardness, Tip Roundness, Tip Scale X into the Falloff
panel and renames it to the Shape panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/160135
2026-08-14 23:57:57 +02:00
Sean Kim
ec438d7429 Paint: Remove Front-Face Falloff option
With the View & Area Normal automasking settings being available for
Vertex and Weight Paint mode, the "Front-Facing Falloff" settings are
now duplicated and can be removed in favor of the automasking settings.

To match the existing behavior, if the brush used *Spherical* falloff,
*Area Normal* automasking is enabled on the brush with the same angle
and a falloff of 0.5, whereas if *Projected* falloff is used, *View
Normal* automasking is used instead.

Additionally, the `BRUSH_FRONTFACE_FALLOFF` flag has not been cleared,
though the relevant RNA properties have been marked as deprecated and
slated for removal in 6.0

Pull Request: https://projects.blender.org/blender/blender/pulls/161241
2026-08-12 21:02:30 +02:00
Sean Kim
0ebf8cbf13 Fix: Radial symmetry appears greyed out in Vertex Paint
Vertex Paint and Weight paint share many options, but the popover for
symmetry options incorrectly toggled some elements based on a
non-applicable option for Vertex Paint.

Pull Request: https://projects.blender.org/blender/blender/pulls/162206
2026-08-02 00:33:28 +02:00
ethan
3b2ab96ff1 Sculpt: Add option to transform only pivot
Transforming the pivot currently requires either using operators or
setting the position via Shift-RMB. This can lack precision compared to
using the existing transform gizmo. To address this, this PR allows the
transform operators to only affect the pivot.

This setting is exposed in the "Options" panel as "Transform Only Pivot"

When toggled, the overlay matches the Object Mode "Affect Only Origin"
overlay to indicate that the geometry of the model is not affected.

This PR does not handle undoing.

Based on this [0] RCS request.

[0]: https://blender.community/c/rightclickselect/NpgL/

Pull Request: https://projects.blender.org/blender/blender/pulls/158395
2026-07-17 23:49:43 +02:00
Pablo Vazquez
0e5263ff5b UI: Replace use of Info, Warning, and Error icons
Instead of reusing `ERROR` for both warnings and errors, and the Info
Editor icon for "info" label comments, use the new icons from !161002.

* Use `STATUS_WARNING` when the code refers to simple warnings, the
  feature might still work.
* Use `STATUS_ERROR` when the code refers to incompatibility, broken
  functionality, general errors.
* Use `STATUS_INFO` for every info label. Keep `INFO` for the editor.
* Sometimes `WARNING_LARGE` was used, that should only be used for
  dialogs. Use the regular warning instead, it looks almost the same.
* When extra contrast is needed, the filled version is used.

Mostly no big visual changes, other than warnings that were meant as
actual errors using the proper icon now.

See !161038 for details and screenshots.

Pull Request: https://projects.blender.org/blender/blender/pulls/161038
2026-07-05 14:27:56 +02:00
Sean Kim
7c1262287c Fix: Python errors after recent commit
Missed in 8eaee263f6

Pull Request: https://projects.blender.org/blender/blender/pulls/159883
2026-06-09 22:25:08 +02:00
Sean Kim
8eaee263f6 Refactor: Make UnifiedPaintPanel paint_settings more explicit
The existing `UnifiedPaintPanel.paint_settings` helper function is
commonly used, but has some nuance to the usage that is non-obvious from
the naming. Because it does filtering both on the space type and the
tool system information, there may be cases where it returns `None`
where we otherwise know the correct `Paint` struct to be used.

This commit renames the primary usage to
`paint_settings_from_active_tool` and adds a new overload,
`paint_settings_from_mode`, which can be primarily used in the context
of methods drawing information about specific modes, rather than general
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/159826
2026-06-09 21:01:55 +02:00
Casey Bianco-Davis
e5a91bf45e Fix #147195: Grease Pencil: Draw tool implement subdivisions
This implements brush subdivisions as a post processing step.

This was simply never implemented.

Pull Request: https://projects.blender.org/blender/blender/pulls/159380
2026-06-02 19:31:33 +02:00
Casey Bianco-Davis
3702f7e714 Grease Pencil: New Fill Tool Algorithm
Adds a new fill algorithm for the bucket fill tool to create
exact geometry. The new solver is called `Delaunay` in the `Advanced`
options panel. It is set as the new default.
The old pixel-based flood fill method is unchanged and accessible from
the `Advanced` menu.

The solver is an implementation of "Delaunay Painting" [1] with some
additions.
* Adds a new automatic segmentation using the maximum weight that an
  edge can have.
* Adds two new settings to the fill tool.
  * `Internal Gaps`: Enables checking for gaps in internal shapes. This
    enables the following option:
  * `Gap Factor` which is a scale invariant value from 0.0 to 1.0
    (defaulting to 0.4). It's the "sensitivity" of the gap detection.
    Higher values results in more gaps detected and as such can create
    smaller fills

Also, in practice this solver is often faster than the pixel fill.

[1] https://perso.telecom-paristech.fr/parakkat/PDF/CGF22.pdf

Co-authored-by: Falk David <falk@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/156545
2026-05-28 18:11:41 +02:00
Jonas Holzman
8b69e79018 Cleanup: UI: Remove color argument from template_palette calls in Python UI scripts
This fixes a few warnings on startup due linked to template_palette
being called with too many argument. This trailing named argument was
removed in commit 79a60b4816 due to it not being used in logic (also
added to 5.2 release notes PyAPI changes).
2026-05-26 18:01:57 +02:00
Casey Bianco-Davis
ddbf8ac437 Grease Pencil: Draw tool option for creating all curve types
This adds a option for converting the drawn stroke to `Bézier`,
`Catmull Rom` or `NURBS` type, under the `Post-Processing` section
in the draw tool settings.

Note that corners are not detected.
Part of #149237.

Pull Request: https://projects.blender.org/blender/blender/pulls/152398
2026-03-31 12:54:21 +02:00
Falk David
8c22be8d89 Grease Pencil: Replace Default Eraser with last used eraser brush and fallback to Hard
After gathering more feedback by Grease Pencil artists, it seemed like
the `Default Eraser` was causing too many confusions. There were also
unresolved issues like not being able to change the default eraser or
changing the settings of the default eraser.

This replaces the `Default Eraser` setting entirely by instead using the
last used eraser brush asset when invoked from the Draw Tool.
When there is no previous eraser brush available, it falls back to the
`Hard` eraser (which was agreed upon in a module meeting).

The size is also updated to use that of the last eraser.

The `eraser_brush` python API is removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/155967
2026-03-26 10:48:31 +01:00
Pratik Borhade
9f8a8d1e92 Fix: Redundant collapsible panel in view3d tool options
Some commit between 5.0-5.1 changed the behavior. Remove back this
collapsible from tools panel in view3d

Pull Request: https://projects.blender.org/blender/blender/pulls/154299
2026-02-13 11:43:06 +01:00
Casey Bianco-Davis
ae6f0be3a5 Fix #153837: Grease Pencil: Remove vertex_mode from Draw tool menu
This removes the `vertex_mode` from the Draw tool and replaces
it with the `stroke_type`.

This also adds the `stroke_type` to the `right-click` menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/153988
2026-02-10 17:35:24 +01:00
T0MIS0N
02164f0435 Fix #150394: Using image mode in canvas selector causes Python error
The `have_image` boolean was checking the wrong object to find if there
was a `canvas_image`. The `settings` variable is an ImagePaint object,
which has no `canvas_image` variable. The `mode_settings` variable is a
PaintMode object, which does have the `canvas_image` variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/150437
2025-11-23 02:04:19 +01:00
YimingWu
f70c7283c4 Fix #148389: Interface: Remove HIDE_HEADER option for particle tool
There was a `HIDE_HEADER` option in `VIEW3D_PT_tools_particlemode` that
hides the header of that panel, it also removes the panel background.
This PR fixes the panel background by removing the option and this also
makes this panel look consistent in style with other panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/148417
2025-10-22 05:40:19 +02:00
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
Sean Kim
c415febbbb Fix #147568: Editable image in texture paint slot grayed out
Introdued with a926f5b67d

Pull Request: https://projects.blender.org/blender/blender/pulls/147578
2025-10-09 21:06:31 +02:00
Pablo Vazquez
65d5b94740 UI: Slightly widen some popovers
Increase width in some popovers where labels would get trimmed.

This was even worst for other languages, but at least now labels don't
get ellipsis by default (English at 1.0 UI scale).
2025-10-05 23:36:04 +02:00
Sean Kim
05a3072e7b Cleanup: UI: Remove duplicate Grease Pencil vertex paint code
Pull Request: https://projects.blender.org/blender/blender/pulls/147096
2025-10-02 10:54:55 +02:00
Campbell Barton
4199e4b9c0 Cleanup: remove outdated TODO's in space_view3d_toolbar.py
Since adding this TODO, the panels can be shown from the tool-header,
properties editor & active tools tab, so there isn't a good reason to
move them to space_view3d.py. Remove the TODO comments instead.
2025-10-01 16:03:18 +10:00
Sean Kim
a40d484b1a UI: Show preset controls for brush strength, size, and jitter curves
Toggles the new `show_presets` option on for the recently added brush
size, strength, and jitter curves across paint modes to allow users
to set these custom curves to any of the defined internal presets.

Pull Request: https://projects.blender.org/blender/blender/pulls/147000
2025-09-30 00:34:20 +02:00
Sean Kim
0f3c6da272 UI: Add preset curve buttons for curve mapping template
To support setting the custom `CurveMapping` to a well defined preset,
there exist a number of operators that are hardcoded to apply a
particular preset to a particular curve.

This commit begins to replace this functionality and make it part of the
template itself, allowing the preset to be applied to any curve. For
now, it only supports either positive or negative slopes, primarily for
the brush usecases.

The `brush.curve_preset` and `brush.sculpt_curves_falloff_preset`
operators are unneeded after this change and have been removed.

Notably, these preset controls have not been added elsewhere, they can
be added on a case by case basis in future commits by interested
modules.

Pull Request: https://projects.blender.org/blender/blender/pulls/146847
2025-09-29 20:11:29 +02:00
Sean Kim
5ec5572a21 UI: Add dropdown toggle for grease pencil pressure curves
Follow up to 5b02341a11

Pull Request: https://projects.blender.org/blender/blender/pulls/146776
2025-09-29 18:22:29 +02:00
Sean Kim
31dfbc4bef Fix: Reset Curve applies incorrect slope
Missed in 635f42c023

Pull Request: https://projects.blender.org/blender/blender/pulls/146846
2025-09-26 16:58:33 +02:00
Sean Kim
c94e1bf73d Fix: Python errors in brush falloff panel
Caused by 327a1925cf

Pull Request: https://projects.blender.org/blender/blender/pulls/146830
2025-09-26 14:08:17 +02:00
Sean Kim
327a1925cf Paint: Rename curve and curve_preset
This commit renames the following DNA fields and corresponding RNA
properties to better represnt usage:

* `Brush.curve` to `Brush.curve_distance_falloff`
* `Brush.curve_preset` to `Brush.curve_distance_falloff_preset`

Pull Request: https://projects.blender.org/blender/blender/pulls/146254
2025-09-25 11:54:53 +02:00
Pratik Borhade
080d996501 Fix #146122: Grease Pencil: Duplicate cursor panel in draw mode
Caused by cc5d111078
Same parent panel being used for brush panel in sculpt, draw modes.
Add poll function that checks the current mode to avoid duplicate generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/145916
2025-09-12 03:06:14 +02:00
Sean Kim
635f42c023 Fix: 'Reset Curve' on brush falloff curve applies incorrect default
Introduced in f4e670af2c

The `use_negative_slope` parameter was effectively ignored when `brush`
was also passed in as a parameter, always defaulting to a positive
slope (ascending from left to right).

Additionally, the `use_negative_slope` property was incorrectly
specified for many properties: In general, most brush properties have
positive slope as they correspond to a pressure value being modulated.

This commit fixes the behavior and updates the corresponding
properties so they continue to work.

Pull Request: https://projects.blender.org/blender/blender/pulls/145823
2025-09-09 04:00:03 +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
Sean Kim
cc5d111078 Cleanup: Remove legacy Grease Pencil python code
A number of panels referred to the `.greasepencil_paint` and
`.greasepencil_sculpt` context members, each of which only correspond to
the legacy tooling. This commit removes such panels and their helper
classes.

Pull Request: https://projects.blender.org/blender/blender/pulls/145708
2025-09-04 11:22:40 +02:00
Campbell Barton
e442c16fef Cleanup: resolve Python linter warnings 2025-07-03 21:05:21 +10:00
Sean Kim
d73b8dd4f3 Paint: Migrate radial_symmetry from Scene to Mesh
This commit introduces the `radial_symmetry` property on the `Mesh`
datablock and simultaneously removes the `radial_symm` property in
Sculpt, Vertex Paint, and Weight Paint.

This allows users to have these symmetry values defined on a per-object
basis instead of needing to reconfigure it for each mesh.

Current values stored on the `ToolSettings` on a per-scene basis are not
copied to each mesh in a scene. This is done to avoid introducing
potentially inaccurate data to a large number of meshes at the cost of
some minor backwards incompatibility.

Part of #108107

Pull Request: https://projects.blender.org/blender/blender/pulls/141108
2025-06-30 23:58:05 +02:00
Sean Kim
f14feeb853 Merge branch 'blender-v4.5-release' 2025-06-27 13:36:19 -07:00
Sean Kim
b472570875 Fix #140998: Grease Pencil stroke-level color jitter doesn't work
Introduced with 96e549c092

While the above commit applied versionings to the related flags, it did
not convert either the UI elements or the underlying grease pencil code
to use the now generic `Brush` properties.

Pull Request: https://projects.blender.org/blender/blender/pulls/141001
2025-06-27 22:21:53 +02: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
Nika Kutsniashvili
efa8d942b8 Refactor: Remove grid and compact UI list layout in Python scripts
The grid layout type for UI list is planned for removal in 5.0, see
blender/blender#110461.

In previous UI meetings, we talked about deprecating the Grid mode of
the UI list, which is not actually accessible in UI and was never used.
Nowadays, there is a new grid view that can be exposed in the API in
the future.

Initially, I wanted to remove references to layout_type in UI templates
in the text editor, because a lot of add-on developers on the
extensions platform base their lists on that code, and a lot of them
are therefore including soon to be deprecated code in their add-ons,
which I want to avoid in the future. But I thought we might as well
remove it from our python scripts as well, since it's just basically
redundant code that doesn't do anything. And also because many add-on
developers use bundled python scripts for references as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/138395
2025-06-18 13:45:06 +02:00
Sean Kim
ab3c129dd9 Refactor: Paint: Rename brush _tool properties to _brush_type
This commit renames the python Brush properties that end with `_tool` to
`_brush_type` (e.g. `sculpt_tool` -> `sculpt_brush_type`) to better
distinguish the property from the concept of tools in a workspace
context.

Resolves #124201

Pull Request: https://projects.blender.org/blender/blender/pulls/139909
2025-06-06 23:40:13 +02:00
Campbell Barton
24eaff6889 Cleanup: remove unused functions in UI scripts 2025-06-04 16:54:12 +10:00
Falk David
d332411b21 Grease Pencil: Fill Tool: Draw fill guides
This implements the "boundary strokes" features (from 4.2 LTS).
To make it a bit more clear, the feature is now called "fill guides".
It uses the same `Alt`+`LMB` shortcut.

Fill guides are denoted by a `".is_fill_guide"` attribute set to `true`.
Otherwise they behave as normal strokes.

There is the `Clean Up` > `Remove Fill Guides` operator to remove
the strokes.

This also adds an option to the Fill tool to automatically remove fill
guides once a fill has been created.

Pull Request: https://projects.blender.org/blender/blender/pulls/139293
2025-05-31 12:23:39 +02:00
Sean Kim
2e3debc4ca Assets: Enable asset metadata operators for brush shelf context menu
Currently, depending on whether or not a brush asset is part of a
library, the context menu shown for it changes significantly.

To better support local brush asset modifications, and make the UI more
consistent, this commit exposes the following operators:

* `brush.asset_edit_metadata`
* `brush.asset_load_preview`
* `brush.asset_save`
* `brush.asset_revert`

Of these four operators, the first two are allowed to execute, whereas
the latter two are always disabled on local assets via the corresponding
`poll` methods, as neither is applicable for this usecase.

Related to #138105

Pull Request: https://projects.blender.org/blender/blender/pulls/138376
2025-05-14 23:01:31 +02:00
Sean Kim
8fdaa555e8 Sculpt: Use capability check for dyntopo panel options
Prior to this commit, the Dyntopo panel was hardcoded to display as
faded if the current brush was the mask brush. This conflicts with the
common set of brushes which we do not support dyntopo for, which
includes many other brushes.

This commit changes the check to better indicate that certain brushes do
not support dyntopo. The scene-level settings can still be changed & the
detail flood fill operator remains functional even if the a different
brush is selected.

Additionally, the panel is no longer greyed out if the "Manual" option is
active.

Pull Request: https://projects.blender.org/blender/blender/pulls/138634
2025-05-12 23:19:01 +02:00
Pratik Borhade
ed59418d2d Cleanup: Grease Pencil: Remove v3 references
Remove v3 from tooltip, code comments

Pull Request: https://projects.blender.org/blender/blender/pulls/137078
2025-04-07 11:39:16 +02:00
Campbell Barton
d9edc0c057 Cleanup: replace multiple checks with static sets 2025-03-21 22:08:31 +11:00