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
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
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
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
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
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
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
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
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
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
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).
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
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
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
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
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).
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.
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
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
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
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
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
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
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
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
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
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
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
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
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