2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-06-15 13:09:04 +10:00
|
|
|
|
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 13:09:57 +02:00
|
|
|
import bpy
|
2022-09-28 16:22:34 -07:00
|
|
|
from bpy.types import Menu, Panel, UIList, WindowManager
|
2023-09-06 16:21:11 +02:00
|
|
|
from bpy.app.translations import (
|
|
|
|
|
pgettext_iface as iface_,
|
|
|
|
|
contexts as i18n_contexts,
|
|
|
|
|
)
|
|
|
|
|
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_grease_pencil_common import (
|
2022-05-02 16:05:04 +02:00
|
|
|
GreasePencilSculptAdvancedPanel,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
GreasePencilDisplayPanel,
|
2020-03-09 16:27:24 +01:00
|
|
|
GreasePencilBrushFalloff,
|
2018-07-31 21:06:08 +10:00
|
|
|
)
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_paint_common import (
|
2018-07-31 21:06:08 +10:00
|
|
|
UnifiedPaintPanel,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
BrushSelectPanel,
|
|
|
|
|
ClonePanel,
|
|
|
|
|
TextureMaskPanel,
|
|
|
|
|
ColorPalettePanel,
|
|
|
|
|
StrokePanel,
|
|
|
|
|
SmoothStrokePanel,
|
|
|
|
|
FalloffPanel,
|
|
|
|
|
DisplayPanel,
|
2019-01-02 14:36:56 +11:00
|
|
|
brush_texture_settings,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_mask_texture_settings,
|
|
|
|
|
brush_settings,
|
|
|
|
|
brush_settings_advanced,
|
|
|
|
|
draw_color_settings,
|
2018-07-31 21:06:08 +10:00
|
|
|
)
|
2019-03-13 12:41:22 +11:00
|
|
|
from bl_ui.utils import PresetPanel
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2011-06-24 03:30:50 +00:00
|
|
|
|
2019-08-08 22:54:57 +02:00
|
|
|
class VIEW3D_MT_brush_context_menu(Menu):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brush Specials"
|
2019-08-08 22:54:57 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
settings = UnifiedPaintPanel.paint_settings(context)
|
|
|
|
|
brush = getattr(settings, "brush", None)
|
|
|
|
|
|
|
|
|
|
# skip if no active brush
|
|
|
|
|
if not brush:
|
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 13:09:57 +02:00
|
|
|
layout.label(text="No brush selected", icon='INFO')
|
2019-08-08 22:54:57 +02:00
|
|
|
return
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
if brush.library and brush.library.is_editable:
|
|
|
|
|
layout.operator("brush.asset_save_as", text="Duplicate Asset...", icon='DUPLICATE')
|
|
|
|
|
layout.operator("brush.asset_delete", text="Delete Asset")
|
2019-08-08 22:54:57 +02:00
|
|
|
|
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 13:09:57 +02:00
|
|
|
layout.separator()
|
2019-08-08 22:54:57 +02:00
|
|
|
|
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 13:09:57 +02:00
|
|
|
layout.operator("brush.asset_edit_metadata", text="Edit Metadata...")
|
|
|
|
|
layout.operator("brush.asset_load_preview", text="Edit Preview Image...")
|
|
|
|
|
layout.operator("brush.asset_update", text="Update Asset")
|
|
|
|
|
layout.operator("brush.asset_revert", text="Revert to Asset")
|
|
|
|
|
else:
|
|
|
|
|
layout.operator("brush.asset_save_as", text="Save As Asset...", icon='FILE_TICK')
|
|
|
|
|
layout.operator("brush.asset_delete", text="Delete")
|
2019-08-08 22:54:57 +02:00
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_MT_brush_gpencil_context_menu(Menu):
|
|
|
|
|
bl_label = "Brush Specials"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
settings = None
|
|
|
|
|
if context.mode == 'PAINT_GPENCIL':
|
2023-04-13 13:14:01 +10:00
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
if context.mode == 'SCULPT_GPENCIL':
|
2023-04-13 13:14:01 +10:00
|
|
|
settings = tool_settings.gpencil_sculpt_paint
|
GPv3: Weight Paint tools (Draw, Blur, Average, Smear, Sample weight)
This PR implements the Weight Paint tools for GPv3.
Tools:
- Draw, for assigning weight to stroke points
- Blur, smooths out weight using adjacent stroke point weights
- Average, smooths weight using the average weight under the brush
- Smear, like finger painting, drags weights in the direction of the brush
- Sample weight, sets the brush weight to the weight under the cursor
The weights are assigned to the active vertex group. When there is no
active vertex group, a group is automatically created.
When the Auto Normalize option is enabled, it is ensured that all
bone-deforming vertex groups add up to the weight of 1.0.
When a vertex group is locked, it's weights will not be altered by
Auto Normalize.
The PR already supports multi frame editing, including the use of a
falloff (defined by a curve).
The implementation is in accordance with the Weight Paint tools in GPv2.
Pull Request: https://projects.blender.org/blender/blender/pulls/118347
2024-04-25 15:21:14 +02:00
|
|
|
elif context.mode == 'WEIGHT_GPENCIL' or context.mode == 'WEIGHT_GREASE_PENCIL':
|
2023-04-13 13:14:01 +10:00
|
|
|
settings = tool_settings.gpencil_weight_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
elif context.mode == 'VERTEX_GPENCIL':
|
2023-04-13 13:14:01 +10:00
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
brush = getattr(settings, "brush", None)
|
|
|
|
|
# skip if no active brush
|
|
|
|
|
if not brush:
|
|
|
|
|
layout.label(text="No Brushes currently available", icon='INFO')
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class View3DPanel:
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'UI'
|
2009-08-15 19:40:09 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Grease Pencil Todos: "Sketching Sessions"
Due to popular request and usability considerations, this commit
reintroduces functionality similar to 2.4's "Draw Mode" for Grease
Pencil.
In the toolbar under the Draw/Line/Eraser buttons, you can find the
"Use Sketching Sessions" toggle, which enables this feature. This is a
per-scene setting, and defaults to off, so that the current 2.5
behaviour is still the default (i.e. the Grease Pencil operator will
only do a single stroke at a time).
With this option enabled, drawing with Grease Pencil will enter a
semi-modal state where you can draw multiple strokes without needing
to keep holding the DKEY throughout (though you'll still need to do so
to start the strokes, unless you use some toolbar buttons), while
still being able to manipulate the viewport. Header help-text prints
show the appropriate keybindings (i.e. press ESCKEY or ENTER to end
the sketching session).
Notes:
- To aid maintainability of the 3D-View toolbar code, I've taken the
liberty to factor out the groups of widgets which commonly occur in
most of the toolbars into separate functions (namely "Repeat" and
"Grease Pencil"). Perhaps it might make it slightly harder to newbies
to the toolbar code to grasp, though the physics panels are far worse
;)
- I've reshuffled some code in the Grease Pencil code to separate out
the various states of operation again more clearly, though some more
work is still needed there (TODO)
- There can now be only one Grease Pencil operator running at a time
- Redoing Grease Pencil operations where sketching sessions was
enabled still needs work. Namely, a way of delimiting the set of
points recorded into strokes is still needed (TODO)
- Ultimately, it should be possible to switch tools midway through a
session. Currently sessions are limited to only being able to be used
with a single drawing mode (TODO)
- After ending a drawing session, the titlebar contols may not work on
Windows without manually making the main window lose focus and then
regain (i.e. click on some other window in toolbar, then come back).
This may be related to (bug #25480)
2011-01-04 03:14:01 +00:00
|
|
|
# **************** standard tool clusters ******************
|
|
|
|
|
|
2017-09-28 01:38:17 +10:00
|
|
|
# Used by vertex & weight paint
|
2021-04-02 14:44:26 +02:00
|
|
|
def draw_vpaint_symmetry(layout, vpaint, obj):
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
row = col.row(heading="Mirror", align=True)
|
2021-04-02 14:44:26 +02:00
|
|
|
row.prop(obj, "use_mesh_mirror_x", text="X", toggle=True)
|
|
|
|
|
row.prop(obj, "use_mesh_mirror_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(obj, "use_mesh_mirror_z", text="Z", toggle=True)
|
2017-09-28 01:38:17 +10:00
|
|
|
|
2021-04-02 14:44:26 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.active = not obj.data.use_mirror_vertex_groups
|
2017-09-28 01:38:17 +10:00
|
|
|
col.prop(vpaint, "radial_symmetry", text="Radial")
|
|
|
|
|
|
2018-07-31 21:06:08 +10:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# Most of these panels should not be visible in GP edit modes
|
2018-07-31 10:22:19 +02:00
|
|
|
def is_not_gpencil_edit_mode(context):
|
2018-07-31 21:06:08 +10:00
|
|
|
is_gpmode = (
|
|
|
|
|
context.active_object and
|
2018-12-14 16:45:57 +01:00
|
|
|
context.active_object.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}
|
2018-07-31 21:06:08 +10:00
|
|
|
)
|
2018-07-31 10:22:19 +02:00
|
|
|
return not is_gpmode
|
|
|
|
|
|
2013-12-22 17:13:29 -06:00
|
|
|
|
2019-09-12 00:50:37 +10:00
|
|
|
# ********** default tools for object mode ****************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_object_options(View3DPanel, Panel):
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_context = ".objectmode" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Options"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
# layout = self.layout
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_object_options_transform(View3DPanel, Panel):
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_context = ".objectmode" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Transform"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_object_options"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Affect Only", align=True)
|
|
|
|
|
col.prop(tool_settings, "use_transform_data_origin", text="Origins")
|
|
|
|
|
col.prop(tool_settings, "use_transform_pivot_point_align", text="Locations")
|
|
|
|
|
col.prop(tool_settings, "use_transform_skip_children", text="Parents")
|
2019-09-12 00:50:37 +10:00
|
|
|
|
|
|
|
|
|
2013-12-22 17:13:29 -06:00
|
|
|
# ********** default tools for editmode_mesh ****************
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2014-02-13 08:51:33 +11:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
|
2019-03-20 14:09:55 +01:00
|
|
|
bl_label = "Options"
|
2019-05-21 22:50:02 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-07-01 17:45:27 +10:00
|
|
|
bl_ui_units_x = 12
|
2011-11-08 01:32:34 +00:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
def draw(self, _context):
|
|
|
|
|
# layout = self.layout
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_meshedit_options_transform(View3DPanel, Panel):
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Transform"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_meshedit_options"
|
|
|
|
|
|
2011-11-05 10:34:29 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return context.active_object
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2018-08-30 09:05:48 +10:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2020-07-01 17:45:27 +10:00
|
|
|
tool_settings = context.tool_settings
|
2009-11-04 16:26:08 +00:00
|
|
|
ob = context.active_object
|
2011-11-05 10:34:29 +00:00
|
|
|
mesh = ob.data
|
2011-11-05 10:19:36 +00:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
|
col.prop(tool_settings, "use_transform_correct_face_attributes")
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.active = tool_settings.use_transform_correct_face_attributes
|
|
|
|
|
sub.prop(tool_settings, "use_transform_correct_keep_connected")
|
|
|
|
|
col.separator()
|
2020-09-08 11:52:27 -04:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
col = layout.column(heading="Mirror")
|
|
|
|
|
sub = col.row(align=True)
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
sub.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
|
|
|
|
sub.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
|
|
|
|
sub.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
2019-09-11 13:48:42 -03:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
|
col.active = mesh.use_mirror_x or mesh.use_mirror_y or mesh.use_mirror_z
|
|
|
|
|
col.prop(mesh, "use_mirror_topology")
|
|
|
|
|
col.separator()
|
2011-03-10 05:52:16 +00:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
col = layout.column(align=True)
|
|
|
|
|
col.prop(tool_settings, "use_mesh_automerge", text="Auto Merge", toggle=False)
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.active = tool_settings.use_mesh_automerge
|
|
|
|
|
sub.prop(tool_settings, "use_mesh_automerge_and_split", toggle=False)
|
|
|
|
|
sub.prop(tool_settings, "double_threshold", text="Threshold")
|
2018-06-12 21:16:50 +02:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_meshedit_options_uvs(View3DPanel, Panel):
|
2019-05-21 22:50:02 +02:00
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
|
2023-05-19 17:32:46 +02:00
|
|
|
bl_label = "UVs"
|
2019-05-21 22:50:02 +02:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_meshedit_options"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_decorate = False
|
2023-05-19 17:32:46 +02:00
|
|
|
layout.use_property_split = True
|
2019-05-21 22:50:02 +02:00
|
|
|
|
2023-05-19 17:32:46 +02:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
|
|
|
|
layout.prop(tool_settings, "use_edge_path_live_unwrap")
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2016-08-01 11:54:02 +10:00
|
|
|
|
2009-07-02 11:24:27 +00:00
|
|
|
# ********** default tools for editmode_armature ****************
|
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2018-04-25 08:16:21 +02:00
|
|
|
bl_context = ".armature_edit" # dot on purpose (access from topbar)
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_label = "Options"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
arm = context.active_object.data
|
2009-10-27 12:46:20 +00:00
|
|
|
|
2011-04-01 21:37:40 +00:00
|
|
|
self.layout.prop(arm, "use_mirror_x")
|
2009-07-24 21:01:41 +00:00
|
|
|
|
2014-04-17 14:50:06 +02:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for pose-mode ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".posemode" # dot on purpose (access from topbar)
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Pose Options"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
2019-05-09 11:19:38 +02:00
|
|
|
pose = context.active_object.pose
|
2019-05-06 09:47:45 +02:00
|
|
|
layout = self.layout
|
2009-10-19 13:24:18 +00:00
|
|
|
|
2019-09-12 00:50:37 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
2019-05-09 11:19:38 +02:00
|
|
|
layout.prop(pose, "use_auto_ik")
|
|
|
|
|
layout.prop(pose, "use_mirror_x")
|
2019-05-06 09:47:45 +02:00
|
|
|
col = layout.column()
|
2020-01-02 12:48:30 -03:00
|
|
|
col.active = pose.use_mirror_x and not pose.use_auto_ik
|
2019-05-09 11:19:38 +02:00
|
|
|
col.prop(pose, "use_mirror_relative")
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2019-09-12 00:50:37 +10:00
|
|
|
layout.label(text="Affect Only")
|
|
|
|
|
layout.prop(tool_settings, "use_transform_pivot_point_align", text="Locations")
|
|
|
|
|
|
2009-07-24 11:14:59 +00:00
|
|
|
# ********** default tools for paint modes ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class TEXTURE_UL_texpaintslots(UIList):
|
2022-05-18 17:40:19 +10:00
|
|
|
def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# mat = data
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2023-11-28 12:05:07 +01:00
|
|
|
# Hint that painting on linked images is prohibited
|
|
|
|
|
ima = _data.texture_paint_images.get(item.name)
|
2024-05-16 14:53:09 +02:00
|
|
|
if ima is not None and ima.is_editable:
|
2023-11-28 12:05:07 +01:00
|
|
|
layout.enabled = False
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
if self.layout_type in {'DEFAULT', 'COMPACT'}:
|
2022-10-04 12:17:31 +02:00
|
|
|
layout.label(text=item.name, icon_value=item.icon_value)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
elif self.layout_type == 'GRID':
|
|
|
|
|
layout.alignment = 'CENTER'
|
|
|
|
|
layout.label(text="")
|
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class View3DPaintPanel(View3DPanel, UnifiedPaintPanel):
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2009-07-20 16:39:16 +00:00
|
|
|
|
2019-03-20 10:44:13 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class View3DPaintBrushPanel(View3DPaintPanel):
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
mode = cls.get_brush_mode(context)
|
|
|
|
|
return mode is not None
|
|
|
|
|
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".paint_common" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Particle Tool"
|
2019-03-18 21:30:56 +01:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
settings = context.tool_settings.particle_edit
|
2019-03-18 21:30:56 +01:00
|
|
|
return (settings and settings.brush and context.particle_edit_object)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
settings = context.tool_settings.particle_edit
|
2009-10-31 19:31:45 +00:00
|
|
|
brush = settings.brush
|
2019-03-18 21:30:56 +01:00
|
|
|
tool = settings.tool
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2021-02-24 12:27:25 -06:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool_context = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
|
|
|
|
|
if not tool_context:
|
|
|
|
|
# If there is no active tool, then there can't be an active brush.
|
|
|
|
|
tool = None
|
|
|
|
|
|
|
|
|
|
if not tool_context.has_datablock:
|
|
|
|
|
# tool.has_datablock is always true for tools that use brushes.
|
|
|
|
|
tool = None
|
|
|
|
|
|
2019-03-20 10:44:13 +11:00
|
|
|
if tool is not None:
|
2019-03-18 21:30:56 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(brush, "size", slider=True)
|
|
|
|
|
if tool == 'ADD':
|
|
|
|
|
col.prop(brush, "count")
|
2011-10-12 00:47:50 +00:00
|
|
|
|
2018-08-02 22:10:38 +10:00
|
|
|
col = layout.column()
|
2019-03-18 21:30:56 +01:00
|
|
|
col.prop(settings, "use_default_interpolate")
|
|
|
|
|
col.prop(brush, "steps", slider=True)
|
|
|
|
|
col.prop(settings, "default_key_count", slider=True)
|
|
|
|
|
else:
|
|
|
|
|
col.prop(brush, "strength", slider=True)
|
|
|
|
|
|
|
|
|
|
if tool == 'LENGTH':
|
|
|
|
|
layout.row().prop(brush, "length_mode", expand=True)
|
|
|
|
|
elif tool == 'PUFF':
|
|
|
|
|
layout.row().prop(brush, "puff_mode", expand=True)
|
|
|
|
|
layout.prop(brush, "use_puff_volume")
|
|
|
|
|
elif tool == 'COMB':
|
2021-01-21 16:06:23 +11:00
|
|
|
col = layout.column(align=False, heading="Deflect Emitter")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.prop(settings, "use_emitter_deflect", text="")
|
|
|
|
|
sub = sub.row(align=True)
|
|
|
|
|
sub.active = settings.use_emitter_deflect
|
|
|
|
|
sub.prop(settings, "emitter_distance", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
# TODO, move to space_view3d.py
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_select(Panel, View3DPaintBrushPanel, BrushSelectPanel):
|
|
|
|
|
bl_context = ".paint_common"
|
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 13:09:57 +02:00
|
|
|
bl_label = "Brush Asset"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
# TODO, move to space_view3d.py
|
|
|
|
|
class VIEW3D_PT_tools_brush_settings(Panel, View3DPaintBrushPanel):
|
|
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_label = "Brush Settings"
|
2019-03-18 21:30:56 +01:00
|
|
|
|
2019-12-19 18:12:10 +11:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
|
return settings and settings.brush is not None
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
settings = self.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_settings(layout.column(), context, brush, popover=self.is_popover)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel):
|
|
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
|
|
|
|
bl_label = "Advanced"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 14
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2022-05-11 12:10:00 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
mode = cls.get_brush_mode(context)
|
2024-06-24 13:54:54 +02:00
|
|
|
if mode == 'SCULPT_GREASE_PENCIL':
|
|
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
|
tool = settings.brush.gpencil_sculpt_tool
|
|
|
|
|
return tool in {'SMOOTH', 'RANDOMIZE'}
|
|
|
|
|
|
2022-05-11 12:10:00 +02:00
|
|
|
return mode is not None and mode != 'SCULPT_CURVES'
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2012-06-20 09:34:26 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
2019-01-02 14:36:56 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
settings = UnifiedPaintPanel.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
2019-08-12 11:37:24 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_settings_advanced(layout.column(), context, brush, self.is_popover)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-06-20 09:34:26 +00:00
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".paint_common" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_label = "Color Picker"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
2019-04-19 07:36:07 +02:00
|
|
|
def poll(cls, context):
|
|
|
|
|
settings = cls.paint_settings(context)
|
2019-03-19 18:17:50 +01:00
|
|
|
brush = settings.brush
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2019-03-19 19:31:36 +01:00
|
|
|
if context.image_paint_object:
|
|
|
|
|
capabilities = brush.image_paint_capabilities
|
2019-03-19 19:42:17 +01:00
|
|
|
return capabilities.has_color
|
2019-03-19 19:31:36 +01:00
|
|
|
elif context.vertex_paint_object:
|
|
|
|
|
capabilities = brush.vertex_paint_capabilities
|
2019-03-19 19:42:17 +01:00
|
|
|
return capabilities.has_color
|
2022-04-05 11:42:55 -07:00
|
|
|
elif context.sculpt_object:
|
|
|
|
|
capabilities = brush.sculpt_capabilities
|
|
|
|
|
return capabilities.has_color
|
2019-03-19 18:17:50 +01:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
return False
|
|
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
draw_color_settings(context, layout, brush, color_type=not context.vertex_paint_object)
|
2019-08-04 11:53:48 -04:00
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel, ColorPalettePanel):
|
|
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_label = "Color Palette"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_clone(Panel, View3DPaintPanel, ClonePanel):
|
|
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_label = "Clone from Paint Slot"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
|
2014-09-21 00:29:50 +02:00
|
|
|
class VIEW3D_MT_tools_projectpaint_uvlayer(Menu):
|
|
|
|
|
bl_label = "Clone Layer"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2017-05-25 15:11:00 +10:00
|
|
|
for i, uv_layer in enumerate(context.active_object.data.uv_layers):
|
|
|
|
|
props = layout.operator("wm.context_set_int", text=uv_layer.name, translate=False)
|
|
|
|
|
props.data_path = "active_object.data.uv_layers.active_index"
|
2014-09-21 00:29:50 +02:00
|
|
|
props.value = i
|
|
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
class SelectPaintSlotHelper:
|
2023-09-06 16:21:11 +02:00
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
canvas_source_attr_name = "canvas_source"
|
|
|
|
|
canvas_image_attr_name = "canvas_image"
|
2014-07-21 12:02:05 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-10-05 17:40:24 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2014-07-21 12:02:05 +02:00
|
|
|
|
|
|
|
|
settings = context.tool_settings.image_paint
|
2022-04-08 16:37:35 +02:00
|
|
|
mode_settings = self.get_mode_settings(context)
|
2014-07-21 12:02:05 +02:00
|
|
|
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
layout.prop(mode_settings, self.canvas_source_attr_name, text="Mode")
|
2018-10-05 17:40:24 +02:00
|
|
|
layout.separator()
|
2014-07-21 12:02:05 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
have_image = False
|
|
|
|
|
|
|
|
|
|
match getattr(mode_settings, self.canvas_source_attr_name):
|
|
|
|
|
case 'MATERIAL':
|
|
|
|
|
if len(ob.material_slots) > 1:
|
2022-04-19 15:05:55 +10:00
|
|
|
layout.template_list(
|
|
|
|
|
"MATERIAL_UL_matslots", "layers",
|
|
|
|
|
ob, "material_slots",
|
|
|
|
|
ob, "active_material_index", rows=2,
|
|
|
|
|
)
|
2022-04-08 16:37:35 +02:00
|
|
|
mat = ob.active_material
|
|
|
|
|
if mat and mat.texture_paint_images:
|
|
|
|
|
row = layout.row()
|
2022-04-19 15:05:55 +10:00
|
|
|
row.template_list(
|
|
|
|
|
"TEXTURE_UL_texpaintslots", "",
|
|
|
|
|
mat, "texture_paint_slots",
|
|
|
|
|
mat, "paint_active_slot", rows=2,
|
|
|
|
|
)
|
2022-04-08 16:37:35 +02:00
|
|
|
|
|
|
|
|
if mat.texture_paint_slots:
|
|
|
|
|
slot = mat.texture_paint_slots[mat.paint_active_slot]
|
|
|
|
|
else:
|
|
|
|
|
slot = None
|
|
|
|
|
|
|
|
|
|
have_image = slot is not None
|
2015-01-28 15:24:21 +01:00
|
|
|
else:
|
2022-04-08 16:37:35 +02:00
|
|
|
row = layout.row()
|
2015-01-28 14:42:47 +01:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
box = row.box()
|
|
|
|
|
box.label(text="No Textures")
|
2018-10-05 17:40:24 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
sub = row.column(align=True)
|
|
|
|
|
sub.operator_menu_enum("paint.add_texture_paint_slot", "type", icon='ADD', text="")
|
2014-08-28 16:40:38 +02:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
case 'IMAGE':
|
|
|
|
|
mesh = ob.data
|
|
|
|
|
uv_text = mesh.uv_layers.active.name if mesh.uv_layers.active else ""
|
|
|
|
|
layout.template_ID(mode_settings, self.canvas_image_attr_name, new="image.new", open="image.open")
|
|
|
|
|
if settings.missing_uvs:
|
|
|
|
|
layout.operator("paint.add_simple_uvs", icon='ADD', text="Add UVs")
|
|
|
|
|
else:
|
|
|
|
|
layout.menu("VIEW3D_MT_tools_projectpaint_uvlayer", text=uv_text, translate=False)
|
|
|
|
|
have_image = getattr(settings, self.canvas_image_attr_name) is not None
|
2022-04-19 15:05:55 +10:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
self.draw_image_interpolation(layout=layout, mode_settings=mode_settings)
|
|
|
|
|
|
|
|
|
|
case 'COLOR_ATTRIBUTE':
|
|
|
|
|
mesh = ob.data
|
2022-04-20 16:54:46 +02:00
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
col = row.column()
|
|
|
|
|
col.template_list(
|
2022-04-08 16:37:35 +02:00
|
|
|
"MESH_UL_color_attributes_selector",
|
|
|
|
|
"color_attributes",
|
|
|
|
|
mesh,
|
|
|
|
|
"color_attributes",
|
|
|
|
|
mesh.color_attributes,
|
|
|
|
|
"active_color_index",
|
|
|
|
|
rows=3,
|
|
|
|
|
)
|
2018-12-23 16:26:21 +01:00
|
|
|
|
2022-04-20 16:54:46 +02:00
|
|
|
col = row.column(align=True)
|
|
|
|
|
col.operator("geometry.color_attribute_add", icon='ADD', text="")
|
|
|
|
|
col.operator("geometry.color_attribute_remove", icon='REMOVE', text="")
|
|
|
|
|
|
2018-10-05 17:40:24 +02:00
|
|
|
if settings.missing_uvs:
|
|
|
|
|
layout.separator()
|
|
|
|
|
split = layout.split()
|
|
|
|
|
split.label(text="UV Map Needed", icon='INFO')
|
2018-10-01 10:45:50 +02:00
|
|
|
split.operator("paint.add_simple_uvs", icon='ADD', text="Add Simple UVs")
|
2018-10-05 17:40:24 +02:00
|
|
|
elif have_image:
|
|
|
|
|
layout.separator()
|
2019-05-16 16:01:11 +02:00
|
|
|
layout.operator("image.save_all_modified", text="Save All Images", icon='FILE_TICK')
|
2013-11-20 03:38:18 +11:00
|
|
|
|
2018-09-21 07:31:29 +10:00
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
class VIEW3D_PT_slots_projectpaint(SelectPaintSlotHelper, View3DPanel, Panel):
|
|
|
|
|
bl_label = "Texture Slots"
|
|
|
|
|
|
|
|
|
|
canvas_source_attr_name = "mode"
|
|
|
|
|
canvas_image_attr_name = "canvas"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
|
return (brush is not None and context.active_object is not None)
|
|
|
|
|
|
|
|
|
|
def get_mode_settings(self, context):
|
|
|
|
|
return context.tool_settings.image_paint
|
|
|
|
|
|
|
|
|
|
def draw_image_interpolation(self, layout, mode_settings):
|
|
|
|
|
layout.prop(mode_settings, "interpolation", text="")
|
|
|
|
|
|
2023-09-06 16:21:11 +02:00
|
|
|
def draw_header(self, context):
|
|
|
|
|
tool = context.tool_settings.image_paint
|
|
|
|
|
ob = context.object
|
|
|
|
|
mat = ob.active_material
|
|
|
|
|
|
|
|
|
|
label = iface_("Texture Slots")
|
|
|
|
|
|
|
|
|
|
if tool.mode == 'MATERIAL':
|
|
|
|
|
if mat and mat.texture_paint_images and mat.texture_paint_slots:
|
|
|
|
|
label = mat.texture_paint_slots[mat.paint_active_slot].name
|
|
|
|
|
elif tool.canvas:
|
|
|
|
|
label = tool.canvas.name
|
|
|
|
|
|
|
|
|
|
self.bl_label = label
|
|
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
|
|
|
|
|
class VIEW3D_PT_slots_paint_canvas(SelectPaintSlotHelper, View3DPanel, Panel):
|
|
|
|
|
bl_label = "Canvas"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
if not context.preferences.experimental.use_sculpt_texture_paint:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
if tool is None:
|
|
|
|
|
return False
|
|
|
|
|
return tool.use_paint_canvas
|
|
|
|
|
|
|
|
|
|
def get_mode_settings(self, context):
|
|
|
|
|
return context.tool_settings.paint_mode
|
|
|
|
|
|
|
|
|
|
def draw_image_interpolation(self, **kwargs):
|
|
|
|
|
pass
|
|
|
|
|
|
2023-09-06 16:21:11 +02:00
|
|
|
def draw_header(self, context):
|
|
|
|
|
paint = context.tool_settings.paint_mode
|
|
|
|
|
ob = context.object
|
2024-03-29 10:08:59 +11:00
|
|
|
me = ob.data
|
2023-09-06 16:21:11 +02:00
|
|
|
mat = ob.active_material
|
|
|
|
|
|
|
|
|
|
label = iface_("Canvas")
|
|
|
|
|
|
|
|
|
|
if paint.canvas_source == 'MATERIAL':
|
|
|
|
|
if mat and mat.texture_paint_images and mat.texture_paint_slots:
|
|
|
|
|
label = mat.texture_paint_slots[mat.paint_active_slot].name
|
|
|
|
|
elif paint.canvas_source == 'COLOR_ATTRIBUTE':
|
2024-04-11 17:43:36 +10:00
|
|
|
active_color = me.color_attributes.active_color
|
|
|
|
|
label = (
|
|
|
|
|
active_color.name if active_color else
|
|
|
|
|
iface_("Color Attribute")
|
|
|
|
|
)
|
2023-09-06 16:21:11 +02:00
|
|
|
elif paint.canvas_image:
|
|
|
|
|
label = paint.canvas_image.name
|
|
|
|
|
|
|
|
|
|
self.bl_label = label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_slots_color_attributes(Panel):
|
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Color Attributes"
|
|
|
|
|
bl_ui_units_x = 12
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
me = context.object.data
|
2024-04-10 14:48:56 +10:00
|
|
|
active_color = me.color_attributes.active_color
|
2023-09-06 16:21:11 +02:00
|
|
|
self.bl_label = (
|
2024-04-11 17:43:36 +10:00
|
|
|
active_color.name if active_color else
|
2023-09-06 16:21:11 +02:00
|
|
|
iface_("Color Attributes")
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
2024-03-29 10:08:59 +11:00
|
|
|
ob = context.object
|
|
|
|
|
mesh = ob.data
|
2023-09-06 16:21:11 +02:00
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
|
col.template_list(
|
|
|
|
|
"MESH_UL_color_attributes",
|
|
|
|
|
"color_attributes",
|
|
|
|
|
mesh,
|
|
|
|
|
"color_attributes",
|
|
|
|
|
mesh.color_attributes,
|
|
|
|
|
"active_color_index",
|
|
|
|
|
rows=3,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
|
col.operator("geometry.color_attribute_add", icon='ADD', text="")
|
|
|
|
|
col.operator("geometry.color_attribute_remove", icon='REMOVE', text="")
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col.menu("MESH_MT_color_attribute_context_menu", icon='DOWNARROW_HLT', text="")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_slots_vertex_groups(Panel):
|
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Vertex Groups"
|
|
|
|
|
bl_ui_units_x = 12
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
ob = context.object
|
2023-12-01 17:55:29 +01:00
|
|
|
groups = ob.vertex_groups
|
2023-09-06 16:21:11 +02:00
|
|
|
self.bl_label = (
|
2024-04-11 17:43:36 +10:00
|
|
|
groups.active.name if groups and groups.active else
|
2023-09-06 16:21:11 +02:00
|
|
|
iface_("Vertex Groups")
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
row = layout.row()
|
|
|
|
|
col = row.column()
|
|
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
group = ob.vertex_groups.active
|
|
|
|
|
|
|
|
|
|
rows = 3
|
|
|
|
|
if group:
|
|
|
|
|
rows = 5
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
|
|
|
|
|
|
|
|
|
|
col = row.column(align=True)
|
|
|
|
|
|
|
|
|
|
col.operator("object.vertex_group_add", icon='ADD', text="")
|
|
|
|
|
props = col.operator("object.vertex_group_remove", icon='REMOVE', text="")
|
|
|
|
|
props.all_unlocked = props.all = False
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col.menu("MESH_MT_vertex_group_context_menu", icon='DOWNARROW_HLT', text="")
|
|
|
|
|
|
|
|
|
|
if group:
|
|
|
|
|
col.separator()
|
|
|
|
|
col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP'
|
|
|
|
|
col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
|
|
|
|
|
|
2022-04-08 16:37:35 +02:00
|
|
|
|
2023-10-02 13:13:13 +02:00
|
|
|
class VIEW3D_PT_mask(Panel):
|
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
2020-01-23 11:45:48 +01:00
|
|
|
bl_label = "Masking"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# TODO, move to space_view3d.py
|
2023-10-02 13:13:13 +02:00
|
|
|
class VIEW3D_PT_stencil_projectpaint(Panel):
|
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
2020-01-23 11:45:48 +01:00
|
|
|
bl_label = "Stencil Mask"
|
2018-10-05 17:40:24 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-01-23 11:45:48 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_mask"
|
2019-09-13 00:20:59 +02:00
|
|
|
bl_ui_units_x = 14
|
2014-07-24 12:41:39 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
return (brush is not None and ob is not None)
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
ipaint = context.tool_settings.image_paint
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(ipaint, "use_stencil_layer", text=self.bl_label if self.is_popover else "")
|
2014-07-24 12:41:39 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-10 16:29:55 +02:00
|
|
|
layout.use_property_split = True
|
2018-10-25 15:27:31 +02:00
|
|
|
layout.use_property_decorate = False
|
2014-07-24 12:41:39 +02:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
2014-07-24 12:41:39 +02:00
|
|
|
ob = context.active_object
|
|
|
|
|
mesh = ob.data
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = ipaint.use_stencil_layer
|
|
|
|
|
|
2019-09-13 00:20:59 +02:00
|
|
|
col.label(text="Stencil Image")
|
|
|
|
|
col.template_ID(ipaint, "stencil_image", new="image.new", open="image.open")
|
|
|
|
|
|
2017-07-13 19:28:20 +10:00
|
|
|
stencil_text = mesh.uv_layer_stencil.name if mesh.uv_layer_stencil else ""
|
2019-09-13 00:20:59 +02:00
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
split = col.split()
|
2018-06-10 16:29:55 +02:00
|
|
|
colsub = split.column()
|
|
|
|
|
colsub.alignment = 'RIGHT'
|
2018-08-28 12:34:51 +10:00
|
|
|
colsub.label(text="UV Layer")
|
2018-06-10 16:29:55 +02:00
|
|
|
split.column().menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
|
2014-07-24 12:41:39 +02:00
|
|
|
|
2019-09-13 00:20:59 +02:00
|
|
|
col.separator()
|
2014-10-06 15:12:06 +02:00
|
|
|
|
2014-07-24 12:41:39 +02:00
|
|
|
row = col.row(align=True)
|
2018-06-10 16:29:55 +02:00
|
|
|
row.prop(ipaint, "stencil_color", text="Display Color")
|
2014-07-24 12:41:39 +02:00
|
|
|
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
|
|
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_display(Panel, View3DPaintBrushPanel, DisplayPanel):
|
|
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
|
|
|
|
bl_label = "Cursor"
|
2018-10-01 15:39:03 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 12
|
2013-04-22 20:46:18 +00:00
|
|
|
|
2010-01-03 08:37:18 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_context = ".paint_common"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2010-01-03 08:37:18 +00:00
|
|
|
bl_label = "Texture"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-01-03 08:37:18 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2021-03-28 19:45:56 +11:00
|
|
|
if (
|
|
|
|
|
(settings := cls.paint_settings(context)) and
|
|
|
|
|
(brush := settings.brush)
|
|
|
|
|
):
|
|
|
|
|
if context.sculpt_object or context.vertex_paint_object:
|
|
|
|
|
return True
|
|
|
|
|
elif context.image_paint_object:
|
|
|
|
|
return (brush.image_tool == 'DRAW')
|
|
|
|
|
return False
|
2010-01-03 08:37:18 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2011-07-11 05:50:49 +00:00
|
|
|
settings = self.paint_settings(context)
|
2010-01-03 08:37:18 +00:00
|
|
|
brush = settings.brush
|
2021-03-02 14:57:51 +01:00
|
|
|
tex_slot = brush.texture_slot
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-03 08:37:18 +00:00
|
|
|
col = layout.column()
|
2021-03-02 14:57:51 +01:00
|
|
|
col.template_ID_preview(tex_slot, "texture", new="texture.new", rows=3, cols=8)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2013-01-16 12:57:35 +00:00
|
|
|
brush_texture_settings(col, brush, context.sculpt_object)
|
2011-10-31 01:50:04 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel, TextureMaskPanel):
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2013-03-25 01:00:16 +00:00
|
|
|
bl_label = "Texture Mask"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2014-10-06 15:12:06 +02:00
|
|
|
settings = cls.paint_settings(context)
|
2014-10-10 12:33:02 +02:00
|
|
|
return (settings and settings.brush and context.image_paint_object)
|
2013-03-25 01:00:16 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
2021-03-02 14:57:51 +01:00
|
|
|
mask_tex_slot = brush.mask_texture_slot
|
2013-03-25 01:00:16 +00:00
|
|
|
|
2021-03-02 14:57:51 +01:00
|
|
|
col.template_ID_preview(mask_tex_slot, "texture", new="texture.new", rows=3, cols=8)
|
2013-03-25 01:00:16 +00:00
|
|
|
|
|
|
|
|
brush_mask_texture_settings(col, brush)
|
2013-06-27 03:05:19 +00:00
|
|
|
|
2013-03-25 01:00:16 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel, StrokePanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".paint_common" # dot on purpose (access from topbar)
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Stroke"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_stroke_smooth_stroke(Panel, View3DPaintPanel, SmoothStrokePanel):
|
2018-10-31 17:23:43 +01:00
|
|
|
bl_context = ".paint_common" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Stabilize Stroke"
|
2018-10-31 17:23:43 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_stroke"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
2013-04-07 01:38:03 +00:00
|
|
|
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel):
|
2023-09-03 21:35:03 +10:00
|
|
|
# Don't give context on purpose to not show this in the generic header tool-settings
|
2021-11-18 10:45:35 +01:00
|
|
|
# this is added only in the gradient tool's ToolDef
|
2023-09-03 21:35:03 +10:00
|
|
|
# `bl_context = ".weightpaint"` # dot on purpose (access from top-bar)
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
bl_label = "Falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-09-05 10:49:20 +10:00
|
|
|
# Also don't draw as an extra panel in the sidebar (already included in the Brush settings).
|
2021-12-20 10:01:18 +01:00
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2023-09-08 16:58:00 +10:00
|
|
|
# since we don't give context above, check mode here (to not show in other modes like sculpt).
|
2021-12-20 10:01:18 +01:00
|
|
|
if context.mode != 'PAINT_WEIGHT':
|
|
|
|
|
return False
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
settings = context.tool_settings.weight_paint
|
2021-12-23 14:10:24 +01:00
|
|
|
if settings is None:
|
|
|
|
|
return False
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
brush = settings.brush
|
|
|
|
|
return brush is not None
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
settings = context.tool_settings.weight_paint
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(brush, "curve_preset", text="")
|
|
|
|
|
|
|
|
|
|
if brush.curve_preset == 'CUSTOM':
|
|
|
|
|
layout.template_curve_mapping(brush, "curve", brush=True)
|
|
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
|
|
|
|
|
row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
|
|
|
|
|
row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
|
|
|
|
|
row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
|
|
|
|
|
row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
|
|
|
|
|
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
|
|
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_brush_falloff(Panel, View3DPaintPanel, FalloffPanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".paint_common" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_settings"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_label = "Falloff"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 08:18:49 +00:00
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
class VIEW3D_PT_tools_brush_falloff_frontface(View3DPaintPanel, Panel):
|
|
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
2020-10-24 11:42:17 -07:00
|
|
|
bl_label = "Front-Face Falloff"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return (context.weight_paint_object or context.vertex_paint_object)
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(brush, "use_frontface_falloff", text=self.bl_label if self.is_popover else "")
|
2019-03-19 18:17:50 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
layout.active = brush.use_frontface_falloff
|
|
|
|
|
layout.prop(brush, "falloff_angle", text="Angle")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_brush_falloff_normal(View3DPaintPanel, Panel):
|
|
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Normal Falloff"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_brush_falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return context.image_paint_object
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
|
|
|
|
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(ipaint, "use_normal_falloff", text=self.bl_label if self.is_popover else "")
|
2019-03-19 18:17:50 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
|
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
layout.active = ipaint.use_normal_falloff
|
|
|
|
|
layout.prop(ipaint, "normal_angle", text="Angle")
|
|
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2014-03-24 23:17:01 +02:00
|
|
|
class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
2014-03-24 23:17:01 +02:00
|
|
|
bl_label = "Dyntopo"
|
2012-12-30 18:31:17 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-07-13 17:58:22 +02:00
|
|
|
bl_ui_units_x = 12
|
2012-12-30 18:31:17 +00:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2020-06-25 14:37:22 +02:00
|
|
|
paint_settings = cls.paint_settings(context)
|
|
|
|
|
return (context.sculpt_object and context.tool_settings.sculpt and paint_settings)
|
2012-12-30 18:31:17 +00:00
|
|
|
|
2016-07-01 21:40:59 +10:00
|
|
|
def draw_header(self, context):
|
2018-06-09 17:36:28 +02:00
|
|
|
is_popover = self.is_popover
|
2016-07-01 21:40:59 +10:00
|
|
|
layout = self.layout
|
|
|
|
|
layout.operator(
|
2018-06-05 16:32:11 +02:00
|
|
|
"sculpt.dynamic_topology_toggle",
|
|
|
|
|
icon='CHECKBOX_HLT' if context.sculpt_object.use_dynamic_topology_sculpting else 'CHECKBOX_DEHLT',
|
|
|
|
|
text="",
|
2018-06-09 17:36:28 +02:00
|
|
|
emboss=is_popover,
|
2018-06-05 16:32:11 +02:00
|
|
|
)
|
2016-07-01 21:40:59 +10:00
|
|
|
|
2012-12-30 18:31:17 +00:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-10 15:55:19 +02:00
|
|
|
layout.use_property_split = True
|
2018-07-13 17:58:22 +02:00
|
|
|
layout.use_property_decorate = False
|
2012-12-30 18:31:17 +00:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
sculpt = tool_settings.sculpt
|
2013-11-19 21:55:46 +01:00
|
|
|
settings = self.paint_settings(context)
|
|
|
|
|
brush = settings.brush
|
2012-12-30 18:31:17 +00:00
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = context.sculpt_object.use_dynamic_topology_sculpting
|
2018-06-10 15:55:19 +02:00
|
|
|
|
|
|
|
|
sub = col.column()
|
2014-06-12 22:00:26 +10:00
|
|
|
sub.active = (brush and brush.sculpt_tool != 'MASK')
|
2018-07-02 18:35:50 +02:00
|
|
|
if sculpt.detail_type_method in {'CONSTANT', 'MANUAL'}:
|
2014-03-23 00:01:46 +02:00
|
|
|
row = sub.row(align=True)
|
2016-11-12 16:14:09 +01:00
|
|
|
row.prop(sculpt, "constant_detail_resolution")
|
2019-11-26 18:53:38 +01:00
|
|
|
props = row.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
|
|
|
|
|
props.mode = 'DYNTOPO'
|
2015-05-06 22:51:49 +02:00
|
|
|
elif (sculpt.detail_type_method == 'BRUSH'):
|
|
|
|
|
sub.prop(sculpt, "detail_percent")
|
2014-03-22 17:47:18 +02:00
|
|
|
else:
|
2014-03-31 20:01:28 +03:00
|
|
|
sub.prop(sculpt, "detail_size")
|
2018-06-10 15:55:19 +02:00
|
|
|
sub.prop(sculpt, "detail_refine_method", text="Refine Method")
|
|
|
|
|
sub.prop(sculpt, "detail_type_method", text="Detailing")
|
|
|
|
|
|
2020-02-02 20:14:33 +01:00
|
|
|
if sculpt.detail_type_method in {'CONSTANT', 'MANUAL'}:
|
|
|
|
|
col.operator("sculpt.detail_flood_fill")
|
|
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
|
2019-08-14 18:37:46 +02:00
|
|
|
class VIEW3D_PT_sculpt_voxel_remesh(Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Remesh"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_ui_units_x = 12
|
2018-12-20 13:01:40 +11:00
|
|
|
|
2019-08-14 18:37:46 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return (context.sculpt_object and context.tool_settings.sculpt)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
mesh = context.active_object.data
|
2019-11-26 18:53:38 +01:00
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(mesh, "remesh_voxel_size")
|
|
|
|
|
props = row.operator("sculpt.sample_detail_size", text="", icon='EYEDROPPER')
|
|
|
|
|
props.mode = 'VOXEL'
|
2019-09-27 17:41:05 +02:00
|
|
|
col.prop(mesh, "remesh_voxel_adaptivity")
|
2019-10-30 05:30:38 +11:00
|
|
|
col.prop(mesh, "use_remesh_fix_poles")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
|
|
|
|
|
col = layout.column(heading="Preserve", align=True)
|
|
|
|
|
col.prop(mesh, "use_remesh_preserve_volume", text="Volume")
|
2023-11-22 15:21:58 +01:00
|
|
|
col.prop(mesh, "use_remesh_preserve_attributes", text="Attributes")
|
Sculpt Vertex Colors: Initial implementation
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
2020-06-22 20:05:28 +02:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.operator("object.voxel_remesh", text="Remesh")
|
2019-08-14 18:37:46 +02:00
|
|
|
|
2022-09-29 09:46:46 +10:00
|
|
|
|
2019-08-14 18:37:46 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Options"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-08-14 10:44:22 +02:00
|
|
|
bl_ui_units_x = 12
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2009-12-23 15:51:39 +00:00
|
|
|
return (context.sculpt_object and context.tool_settings.sculpt)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2018-12-17 17:26:47 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
sculpt = tool_settings.sculpt
|
2018-10-31 17:23:43 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Display", align=True)
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(sculpt, "show_low_resolution")
|
2020-03-12 17:51:39 +01:00
|
|
|
col.prop(sculpt, "use_sculpt_delay_updates")
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(sculpt, "use_deform_only")
|
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_sculpt_options"
|
|
|
|
|
bl_label = "Gravity"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
return (context.sculpt_object and context.tool_settings.sculpt)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2014-04-01 08:30:24 +11:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
sculpt = tool_settings.sculpt
|
2013-12-12 19:01:11 +02:00
|
|
|
capabilities = sculpt.brush.sculpt_capabilities
|
|
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
col = layout.column()
|
2013-12-12 19:01:11 +02:00
|
|
|
col.active = capabilities.has_gravity
|
|
|
|
|
col.prop(sculpt, "gravity", slider=True, text="Factor")
|
|
|
|
|
col.prop(sculpt, "gravity_object")
|
2011-05-04 13:15:42 +00:00
|
|
|
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
|
2018-04-30 16:59:16 +02:00
|
|
|
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
|
2019-03-20 14:09:55 +01:00
|
|
|
bl_label = "Symmetry"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2019-05-21 15:49:36 +10:00
|
|
|
return (
|
|
|
|
|
(context.sculpt_object and context.tool_settings.sculpt) and
|
|
|
|
|
# When used in the tool header, this is explicitly included next to the XYZ symmetry buttons.
|
|
|
|
|
(context.region.type != 'TOOL_HEADER')
|
|
|
|
|
)
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2010-07-14 14:11:03 +00:00
|
|
|
|
|
|
|
|
sculpt = context.tool_settings.sculpt
|
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
row = layout.row(align=True, heading="Mirror")
|
2024-03-29 10:08:59 +11:00
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
mesh = ob.data
|
2020-09-18 19:58:48 +02:00
|
|
|
row.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
|
|
|
|
row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
2011-10-31 01:50:04 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
row = layout.row(align=True, heading="Lock")
|
2014-02-12 17:04:39 +02:00
|
|
|
row.prop(sculpt, "lock_x", text="X", toggle=True)
|
|
|
|
|
row.prop(sculpt, "lock_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(sculpt, "lock_z", text="Z", toggle=True)
|
2010-09-07 15:17:42 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
row = layout.row(align=True, heading="Tiling")
|
2015-07-23 22:52:03 +02:00
|
|
|
row.prop(sculpt, "tile_x", text="X", toggle=True)
|
|
|
|
|
row.prop(sculpt, "tile_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(sculpt, "tile_z", text="Z", toggle=True)
|
|
|
|
|
|
2018-06-10 15:55:19 +02:00
|
|
|
layout.prop(sculpt, "use_symmetry_feather", text="Feather")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.prop(sculpt, "radial_symmetry", text="Radial")
|
|
|
|
|
layout.prop(sculpt, "tile_offset", text="Tile Offset")
|
2015-07-23 22:52:03 +02:00
|
|
|
|
2020-02-02 20:14:33 +01:00
|
|
|
layout.separator()
|
|
|
|
|
|
2024-03-01 22:28:45 +01:00
|
|
|
layout.label(text="Symmetrize")
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
layout.prop(sculpt, "symmetrize_direction")
|
2022-11-10 10:53:00 -08:00
|
|
|
layout.prop(WindowManager.operator_properties_last("sculpt.symmetrize"), "merge_tolerance")
|
2024-03-01 22:28:45 +01:00
|
|
|
layout.operator("sculpt.symmetrize")
|
2020-02-02 20:14:33 +01:00
|
|
|
|
2015-09-01 03:51:50 +10:00
|
|
|
|
2019-05-21 15:49:36 +10:00
|
|
|
class VIEW3D_PT_sculpt_symmetry_for_topbar(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Symmetry"
|
2024-03-01 22:28:45 +01:00
|
|
|
bl_ui_units_x = 13
|
2019-05-21 15:49:36 +10:00
|
|
|
|
|
|
|
|
draw = VIEW3D_PT_sculpt_symmetry.draw
|
|
|
|
|
|
2022-05-05 17:32:57 +10:00
|
|
|
|
2022-05-04 09:51:32 +02:00
|
|
|
class VIEW3D_PT_curves_sculpt_symmetry(Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".curves_sculpt" # dot on purpose (access from topbar)
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2024-03-29 10:08:59 +11:00
|
|
|
ob = context.object
|
|
|
|
|
return ob and ob.type == 'CURVES'
|
2022-05-04 09:51:32 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2024-03-29 10:08:59 +11:00
|
|
|
ob = context.object
|
|
|
|
|
curves = ob.data
|
2022-05-04 09:51:32 +02:00
|
|
|
|
|
|
|
|
row = layout.row(align=True, heading="Mirror")
|
|
|
|
|
row.prop(curves, "use_mirror_x", text="X", toggle=True)
|
|
|
|
|
row.prop(curves, "use_mirror_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(curves, "use_mirror_z", text="Z", toggle=True)
|
|
|
|
|
|
2022-05-05 17:32:57 +10:00
|
|
|
|
2022-05-04 09:51:32 +02:00
|
|
|
class VIEW3D_PT_curves_sculpt_symmetry_for_topbar(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
|
|
|
|
|
draw = VIEW3D_PT_curves_sculpt_symmetry.draw
|
|
|
|
|
|
|
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for weight-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-12-12 07:19:59 +01:00
|
|
|
# TODO, move to space_view3d.py
|
|
|
|
|
class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".weightpaint"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
# When used in the tool header, this is explicitly included next to the XYZ symmetry buttons.
|
|
|
|
|
return (context.region.type != 'TOOL_HEADER')
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2020-10-25 23:23:38 -05:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2019-12-12 07:19:59 +01:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
wpaint = tool_settings.weight_paint
|
2024-03-29 10:08:59 +11:00
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
mesh = ob.data
|
2020-09-18 19:58:48 +02:00
|
|
|
|
2023-01-06 13:52:57 +11:00
|
|
|
layout.prop(mesh, "use_mirror_vertex_groups")
|
2020-09-30 15:01:12 +10:00
|
|
|
|
2024-03-29 10:08:59 +11:00
|
|
|
draw_vpaint_symmetry(layout, wpaint, ob)
|
2021-04-02 14:44:26 +02:00
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.active = mesh.use_mirror_vertex_groups
|
2020-10-25 23:08:29 -05:00
|
|
|
row.prop(mesh, "use_mirror_topology")
|
2019-12-12 07:19:59 +01:00
|
|
|
|
2020-12-16 18:02:40 +11:00
|
|
|
|
2019-12-12 07:19:59 +01:00
|
|
|
class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
|
|
|
|
|
draw = VIEW3D_PT_tools_weightpaint_symmetry.draw
|
|
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
|
2018-04-30 16:06:51 +02:00
|
|
|
bl_context = ".weightpaint"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Options"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2019-03-20 14:09:55 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2010-07-22 18:56:46 +00:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
wpaint = tool_settings.weight_paint
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
col = layout.column()
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize")
|
2018-10-07 18:25:51 +03:00
|
|
|
col.prop(tool_settings, "use_lock_relative", text="Lock-Relative")
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col.prop(tool_settings, "use_multipaint", text="Multi-Paint")
|
|
|
|
|
|
2017-10-06 20:11:17 +11:00
|
|
|
col.prop(wpaint, "use_group_restrict")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-03-20 14:09:55 +01:00
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for vertex-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2019-03-20 14:09:55 +01:00
|
|
|
class VIEW3D_PT_tools_vertexpaint_options(Panel, View3DPaintPanel):
|
2018-04-30 15:21:04 +02:00
|
|
|
bl_context = ".vertexpaint" # dot on purpose (access from topbar)
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Options"
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
@classmethod
|
2021-08-09 15:03:32 +10:00
|
|
|
def poll(cls, _context):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# This is currently unused, since there aren't any Vertex Paint mode specific options.
|
|
|
|
|
return False
|
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2019-03-20 14:09:55 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2017-09-28 01:38:17 +10:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2017-09-28 01:38:17 +10:00
|
|
|
class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
|
2018-04-30 15:21:04 +02:00
|
|
|
bl_context = ".vertexpaint" # dot on purpose (access from topbar)
|
2017-09-28 01:38:17 +10:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
|
2019-05-21 15:49:36 +10:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
# When used in the tool header, this is explicitly included next to the XYZ symmetry buttons.
|
|
|
|
|
return (context.region.type != 'TOOL_HEADER')
|
|
|
|
|
|
2017-09-28 01:38:17 +10:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2020-10-25 23:23:38 -05:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
vpaint = tool_settings.vertex_paint
|
2020-10-25 23:23:38 -05:00
|
|
|
|
2024-03-29 10:08:59 +11:00
|
|
|
ob = context.object
|
|
|
|
|
|
|
|
|
|
draw_vpaint_symmetry(layout, vpaint, ob)
|
2017-09-28 01:38:17 +10:00
|
|
|
|
|
|
|
|
|
2019-05-21 15:49:36 +10:00
|
|
|
class VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
|
|
|
|
|
draw = VIEW3D_PT_tools_vertexpaint_symmetry.draw
|
|
|
|
|
|
|
|
|
|
|
2011-10-17 06:58:07 +00:00
|
|
|
# ********** default tools for texture-paint ****************
|
2009-07-02 11:24:27 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2019-03-20 14:09:55 +01:00
|
|
|
class VIEW3D_PT_tools_imagepaint_options_external(Panel, View3DPaintPanel):
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
2014-06-03 12:05:47 +10:00
|
|
|
bl_label = "External"
|
2019-03-20 14:09:55 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_imagepaint_options"
|
2014-06-03 12:05:47 +10:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2014-06-03 12:05:47 +10:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
2014-06-03 12:05:47 +10:00
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.prop(ipaint, "screen_grab_size", text="Screen Grab Size")
|
2014-06-03 12:05:47 +10:00
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.separator()
|
2014-06-03 12:05:47 +10:00
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
|
|
|
|
col = flow.column()
|
|
|
|
|
col.operator("image.project_edit", text="Quick Edit")
|
|
|
|
|
col = flow.column()
|
|
|
|
|
col.operator("image.project_apply", text="Apply")
|
|
|
|
|
col = flow.column()
|
2014-06-03 12:05:47 +10:00
|
|
|
col.operator("paint.project_image", text="Apply Camera Image")
|
|
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2015-04-28 23:34:40 +10:00
|
|
|
class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
2015-04-28 23:34:40 +10:00
|
|
|
bl_label = "Symmetry"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
2019-05-21 15:49:36 +10:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
# When used in the tool header, this is explicitly included next to the XYZ symmetry buttons.
|
|
|
|
|
return (context.region.type != 'TOOL_HEADER')
|
|
|
|
|
|
2015-04-28 23:34:40 +10:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2018-06-10 15:55:19 +02:00
|
|
|
split = layout.split()
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
col.alignment = 'RIGHT'
|
|
|
|
|
col.label(text="Mirror")
|
|
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
|
|
2015-04-28 23:34:40 +10:00
|
|
|
row = col.row(align=True)
|
2024-03-29 10:08:59 +11:00
|
|
|
ob = context.object
|
|
|
|
|
mesh = ob.data
|
2020-09-18 19:58:48 +02:00
|
|
|
row.prop(mesh, "use_mirror_x", text="X", toggle=True)
|
|
|
|
|
row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
|
|
|
|
|
row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
|
2015-04-28 23:34:40 +10:00
|
|
|
|
|
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2019-03-20 14:09:55 +01:00
|
|
|
class VIEW3D_PT_tools_imagepaint_options(View3DPaintPanel, Panel):
|
2018-06-05 16:35:20 +02:00
|
|
|
bl_context = ".imagepaint" # dot on purpose (access from topbar)
|
2019-03-20 14:09:55 +01:00
|
|
|
bl_label = "Options"
|
2018-10-01 15:39:03 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2010-08-04 12:18:07 +00:00
|
|
|
brush = context.tool_settings.image_paint.brush
|
2012-11-06 09:19:51 +00:00
|
|
|
return (brush is not None)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-11-02 16:19:57 +00:00
|
|
|
layout.prop(ipaint, "seam_bleed")
|
2019-03-12 11:07:43 +01:00
|
|
|
layout.prop(ipaint, "dither", slider=True)
|
2018-10-31 17:23:43 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(ipaint, "use_occlude")
|
2019-03-12 11:07:43 +01:00
|
|
|
col.prop(ipaint, "use_backface_culling", text="Backface Culling")
|
|
|
|
|
|
|
|
|
|
|
2023-10-02 13:13:13 +02:00
|
|
|
class VIEW3D_PT_tools_imagepaint_options_cavity(Panel):
|
|
|
|
|
bl_space_type = 'VIEW_3D'
|
|
|
|
|
bl_region_type = 'HEADER'
|
2018-10-31 17:23:43 +01:00
|
|
|
bl_label = "Cavity Mask"
|
2020-01-23 11:45:48 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_mask"
|
2018-10-31 17:23:43 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2018-12-17 17:26:47 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
2018-10-31 17:23:43 +01:00
|
|
|
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(ipaint, "use_cavity", text=self.bl_label if self.is_popover else "")
|
2018-10-31 17:23:43 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2018-12-17 17:26:47 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
ipaint = tool_settings.image_paint
|
2018-10-31 17:23:43 +01:00
|
|
|
|
|
|
|
|
layout.active = ipaint.use_cavity
|
|
|
|
|
|
2024-03-15 10:04:03 +11:00
|
|
|
layout.template_curve_mapping(ipaint, "cavity_curve", brush=True, use_negative_slope=True)
|
2018-10-31 17:23:43 +01:00
|
|
|
|
2009-12-22 10:48:13 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2012-01-18 05:54:19 +00:00
|
|
|
class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
|
2010-07-22 18:56:46 +00:00
|
|
|
bl_label = "Options"
|
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
2019-12-16 14:29:03 +11:00
|
|
|
def poll(cls, _context):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# This is currently unused, since there aren't any Vertex Paint mode specific options.
|
2019-12-16 13:43:45 +11:00
|
|
|
return False
|
2019-12-16 14:29:03 +11:00
|
|
|
# return (context.image_paint_object and context.tool_settings.image_paint)
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
def draw(self, _context):
|
2010-07-22 18:56:46 +00:00
|
|
|
layout = self.layout
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2010-09-07 15:17:42 +00:00
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class VIEW3D_MT_tools_projectpaint_stencil(Menu):
|
2010-02-14 11:21:21 +00:00
|
|
|
bl_label = "Mask Layer"
|
2009-12-22 10:48:13 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2017-05-25 15:11:00 +10:00
|
|
|
for i, uv_layer in enumerate(context.active_object.data.uv_layers):
|
|
|
|
|
props = layout.operator("wm.context_set_int", text=uv_layer.name, translate=False)
|
2017-07-13 19:28:20 +10:00
|
|
|
props.data_path = "active_object.data.uv_layer_stencil_index"
|
2012-01-01 13:09:58 +00:00
|
|
|
props.value = i
|
2009-12-22 10:48:13 +00:00
|
|
|
|
2009-07-25 22:31:02 +00:00
|
|
|
|
2018-06-10 15:40:02 +02:00
|
|
|
# TODO, move to space_view3d.py
|
2019-03-18 21:30:56 +01:00
|
|
|
class VIEW3D_PT_tools_particlemode_options(View3DPanel, Panel):
|
2013-03-10 17:42:08 +00:00
|
|
|
"""Default tools for particle mode"""
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2018-05-07 15:01:37 +02:00
|
|
|
bl_context = ".particlemode"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Options"
|
2019-03-18 21:30:56 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
pe = context.tool_settings.particle_edit
|
|
|
|
|
ob = pe.object
|
|
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
layout.prop(pe, "type", text="Editing Type")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-06 12:27:28 +00:00
|
|
|
ptcache = None
|
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if pe.type == 'PARTICLES':
|
|
|
|
|
if ob.particle_systems:
|
|
|
|
|
if len(ob.particle_systems) > 1:
|
2024-04-30 12:46:05 +10:00
|
|
|
layout.template_list(
|
|
|
|
|
"UI_UL_list", "particle_systems", ob, "particle_systems",
|
|
|
|
|
ob.particle_systems, "active_index", rows=2, maxrows=3,
|
|
|
|
|
)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-24 04:02:50 +00:00
|
|
|
ptcache = ob.particle_systems.active.point_cache
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
|
for md in ob.modifiers:
|
2009-10-31 23:35:56 +00:00
|
|
|
if md.type == pe.type:
|
2009-10-31 19:31:45 +00:00
|
|
|
ptcache = md.point_cache
|
|
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
if ptcache and len(ptcache.point_caches) > 1:
|
2024-04-30 12:46:05 +10:00
|
|
|
layout.template_list(
|
|
|
|
|
"UI_UL_list", "particles_point_caches", ptcache, "point_caches",
|
|
|
|
|
ptcache.point_caches, "active_index", rows=2, maxrows=3,
|
|
|
|
|
)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
if not pe.is_editable:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.label(text="Point cache must be baked")
|
2010-12-21 20:25:37 +00:00
|
|
|
layout.label(text="in memory to enable editing!")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
2010-08-18 08:26:18 +00:00
|
|
|
col.active = pe.is_editable
|
2021-01-21 16:06:23 +11:00
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
if not pe.is_hair:
|
|
|
|
|
col.prop(pe, "use_auto_velocity", text="Auto-Velocity")
|
2021-01-21 16:06:23 +11:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
sub = col.column(align=True, heading="Mirror")
|
|
|
|
|
sub.prop(ob.data, "use_mirror_x")
|
|
|
|
|
if pe.tool == 'ADD':
|
|
|
|
|
sub.prop(ob.data, "use_mirror_topology")
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
sub = col.column(align=True, heading="Preserve")
|
|
|
|
|
sub.prop(pe, "use_preserve_length", text="Strand Lengths")
|
|
|
|
|
sub.prop(pe, "use_preserve_root", text="Root Positions")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-03-20 10:26:53 +11:00
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
class VIEW3D_PT_tools_particlemode_options_shapecut(View3DPanel, Panel):
|
|
|
|
|
"""Default tools for particle mode"""
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2019-03-18 21:30:56 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_particlemode_options"
|
|
|
|
|
bl_label = "Cut Particles to Shape"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2014-10-22 16:36:23 +02:00
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
|
|
|
|
pe = context.tool_settings.particle_edit
|
|
|
|
|
|
|
|
|
|
layout.prop(pe, "shape_object")
|
|
|
|
|
layout.operator("particle.shape_cut", text="Cut")
|
|
|
|
|
|
2019-03-20 10:26:53 +11:00
|
|
|
|
2019-03-18 21:30:56 +01:00
|
|
|
class VIEW3D_PT_tools_particlemode_options_display(View3DPanel, Panel):
|
|
|
|
|
"""Default tools for particle mode"""
|
2019-05-16 22:13:28 +10:00
|
|
|
bl_category = "Tool"
|
2019-03-18 21:30:56 +01:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_particlemode_options"
|
|
|
|
|
bl_label = "Viewport Display"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False # No animation.
|
|
|
|
|
|
|
|
|
|
pe = context.tool_settings.particle_edit
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
2010-08-18 08:26:18 +00:00
|
|
|
col.active = pe.is_editable
|
2018-09-03 18:58:41 +02:00
|
|
|
col.prop(pe, "display_step", text="Path Steps")
|
2010-08-18 08:26:18 +00:00
|
|
|
if pe.is_hair:
|
2010-08-17 17:03:52 +00:00
|
|
|
col.prop(pe, "show_particles", text="Children")
|
2010-03-22 19:38:40 +00:00
|
|
|
else:
|
|
|
|
|
if pe.type == 'PARTICLES':
|
2010-08-17 17:03:52 +00:00
|
|
|
col.prop(pe, "show_particles", text="Particles")
|
2021-01-21 16:06:23 +11:00
|
|
|
col = layout.column(align=False, heading="Fade Time")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.prop(pe, "use_fade_time", text="")
|
|
|
|
|
sub = sub.row(align=True)
|
2010-08-20 06:09:58 +00:00
|
|
|
sub.active = pe.use_fade_time
|
2021-01-21 16:06:23 +11:00
|
|
|
sub.prop(pe, "fade_frames", slider=True, text="")
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2014-02-13 08:51:33 +11:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
# ********** grease pencil object tool panels ****************
|
|
|
|
|
|
|
|
|
|
# Grease Pencil drawing brushes
|
2018-12-20 13:01:40 +11:00
|
|
|
|
2021-06-09 12:11:38 +02:00
|
|
|
def tool_use_brush(context):
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
if tool and tool.has_datablock is False:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
2018-12-20 13:01:40 +11:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class GreasePencilPaintPanel:
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_paint"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2019-12-16 13:43:45 +11:00
|
|
|
if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}:
|
2018-07-31 10:22:19 +02:00
|
|
|
if context.gpencil_data is None:
|
|
|
|
|
return False
|
|
|
|
|
|
2023-09-05 10:49:20 +10:00
|
|
|
# Hide for tools not using brushes.
|
2021-06-09 12:11:38 +02:00
|
|
|
if tool_use_brush(context) is False:
|
|
|
|
|
return False
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
gpd = context.gpencil_data
|
|
|
|
|
return bool(gpd.is_stroke_paint_mode)
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_select(Panel, View3DPanel, GreasePencilPaintPanel, BrushSelectPanel):
|
|
|
|
|
bl_label = "Brush Asset"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_settings(Panel, View3DPanel, GreasePencilPaintPanel):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brush Settings"
|
2020-05-14 16:31:15 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# What is the point of brush presets? Seems to serve the exact same purpose as brushes themselves??
|
|
|
|
|
def draw_header_preset(self, _context):
|
|
|
|
|
VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
gpencil_paint = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
brush = gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
if brush is not None:
|
2018-12-15 09:54:31 +01:00
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
2019-02-03 13:27:25 +01:00
|
|
|
if brush.gpencil_tool in {'DRAW', 'FILL'}:
|
2019-03-25 17:02:42 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row_mat = row.row()
|
|
|
|
|
if gp_settings.use_material_pin:
|
|
|
|
|
row_mat.template_ID(gp_settings, "material", live_icon=True)
|
|
|
|
|
else:
|
|
|
|
|
row_mat.template_ID(context.active_object, "active_material", live_icon=True)
|
2020-11-18 16:14:48 -05:00
|
|
|
row_mat.enabled = False # will otherwise allow changing material in active slot
|
2019-03-25 17:02:42 +01:00
|
|
|
|
|
|
|
|
row.prop(gp_settings, "use_material_pin", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2019-01-02 14:36:56 +11:00
|
|
|
if not self.is_popover:
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_paint_common import (
|
2019-01-02 14:36:56 +11:00
|
|
|
brush_basic_gpencil_paint_settings,
|
|
|
|
|
)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_basic_gpencil_paint_settings(layout, context, brush, compact=False)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_advanced(View3DPanel, Panel):
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_paint"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Advanced"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_settings"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2021-02-08 16:28:42 +01:00
|
|
|
bl_ui_units_x = 13
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2018-09-12 15:18:05 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2020-03-09 16:27:24 +01:00
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'TINT'}
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
gpencil_paint = tool_settings.gpencil_paint
|
|
|
|
|
brush = gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col = layout.column(align=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
if brush is not None:
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
if brush.gpencil_tool != 'FILL':
|
|
|
|
|
col.prop(gp_settings, "input_samples")
|
|
|
|
|
col.separator()
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col.prop(gp_settings, "active_smooth_factor")
|
|
|
|
|
col.separator()
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col.prop(gp_settings, "angle", slider=True)
|
|
|
|
|
col.prop(gp_settings, "angle_factor", text="Factor", slider=True)
|
2019-04-15 10:32:06 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
ob = context.object
|
2019-04-18 16:57:41 +02:00
|
|
|
ma = None
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
if ob and brush.gpencil_settings.use_material_pin is False:
|
|
|
|
|
ma = ob.active_material
|
|
|
|
|
elif brush.gpencil_settings.material:
|
|
|
|
|
ma = brush.gpencil_settings.material
|
2019-04-15 10:32:06 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col.separator()
|
2020-04-02 16:27:14 +02:00
|
|
|
col.prop(gp_settings, "hardness", slider=True)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
subcol = col.column(align=True)
|
|
|
|
|
if ma and ma.grease_pencil.mode == 'LINE':
|
|
|
|
|
subcol.enabled = False
|
2020-03-09 16:27:24 +01:00
|
|
|
subcol.prop(gp_settings, "aspect")
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
elif brush.gpencil_tool == 'FILL':
|
2019-12-17 17:14:05 +01:00
|
|
|
row = col.row(align=True)
|
2024-03-15 10:04:03 +11:00
|
|
|
row.prop(gp_settings, "fill_draw_mode", text="Boundary", text_ctxt=i18n_contexts.id_gpencil)
|
2021-06-05 17:05:11 +10:00
|
|
|
row.prop(
|
|
|
|
|
gp_settings,
|
|
|
|
|
"show_fill_boundary",
|
|
|
|
|
icon='HIDE_OFF' if gp_settings.show_fill_boundary else 'HIDE_ON',
|
|
|
|
|
text="",
|
|
|
|
|
)
|
2020-08-05 17:44:04 +02:00
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "fill_layer_mode", text="Layers")
|
|
|
|
|
|
2021-02-08 16:28:42 +01:00
|
|
|
col.separator()
|
|
|
|
|
col.prop(gp_settings, "fill_simplify_level", text="Simplify")
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
if gp_settings.fill_draw_mode != 'STROKE':
|
2020-08-05 18:25:43 +02:00
|
|
|
col = layout.column(align=False, heading="Ignore Transparent")
|
|
|
|
|
col.use_property_decorate = False
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.prop(gp_settings, "show_fill", text="")
|
|
|
|
|
sub = sub.row(align=True)
|
|
|
|
|
sub.active = gp_settings.show_fill
|
|
|
|
|
sub.prop(gp_settings, "fill_threshold", text="")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2021-02-11 15:55:33 +01:00
|
|
|
col.separator()
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "use_fill_limit")
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2019-12-17 17:14:05 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_stroke(Panel, View3DPanel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_settings"
|
2019-12-17 17:14:05 +01:00
|
|
|
bl_label = "Stroke"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 12
|
2019-12-17 17:14:05 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool == 'DRAW'
|
|
|
|
|
|
2021-03-06 18:21:17 +11:00
|
|
|
def draw(self, _context):
|
2023-04-12 17:00:51 +02:00
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2019-12-17 17:14:05 +01:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(Panel, View3DPanel):
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_stroke"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Stabilize Stroke"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-11-02 09:10:23 +11:00
|
|
|
return brush is not None and brush.gpencil_tool == 'DRAW'
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
2023-04-12 17:00:51 +02:00
|
|
|
self.layout.use_property_split = False
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(gp_settings, "use_settings_stabilizer", text=self.bl_label if self.is_popover else "")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
col.active = gp_settings.use_settings_stabilizer
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
|
|
|
|
|
col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_post_processing(View3DPanel, Panel):
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_stroke"
|
2019-03-16 12:54:08 +01:00
|
|
|
bl_label = "Post-Processing"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2020-03-09 16:27:24 +01:00
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'}
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
2023-04-12 17:00:51 +02:00
|
|
|
self.layout.use_property_split = False
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(gp_settings, "use_settings_postprocess", text=self.bl_label if self.is_popover else "")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
col.active = gp_settings.use_settings_postprocess
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.prop(gp_settings, "pen_smooth_factor")
|
|
|
|
|
col1.prop(gp_settings, "pen_smooth_steps")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.prop(gp_settings, "pen_subdivision_steps")
|
|
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.prop(gp_settings, "simplify_factor")
|
|
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
2020-09-30 15:01:12 +10:00
|
|
|
col1.prop(gp_settings, "use_trim")
|
2019-02-26 16:04:27 +00:00
|
|
|
|
2022-08-31 15:10:13 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
2022-08-29 09:47:08 +02:00
|
|
|
row = col.row(heading="Outline", align=True)
|
|
|
|
|
row.prop(gp_settings, "use_settings_outline", text="")
|
|
|
|
|
row2 = row.row(align=True)
|
|
|
|
|
row2.enabled = gp_settings.use_settings_outline
|
|
|
|
|
row2.prop(gp_settings, "material_alt", text="")
|
|
|
|
|
|
2022-08-31 15:10:13 +02:00
|
|
|
row2 = col.row(align=True)
|
|
|
|
|
row2.enabled = gp_settings.use_settings_outline
|
|
|
|
|
row2.prop(gp_settings, "outline_thickness_factor")
|
|
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_stroke"
|
2019-03-16 12:54:08 +01:00
|
|
|
bl_label = "Randomize"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2020-03-09 16:27:24 +01:00
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'}
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
2018-12-17 17:17:43 +11:00
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
2023-04-12 17:00:51 +02:00
|
|
|
self.layout.use_property_split = False
|
2024-03-15 10:04:03 +11:00
|
|
|
self.layout.prop(gp_settings, "use_settings_random", text=self.bl_label if self.is_popover else "")
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
brush = tool_settings.gpencil_paint.brush
|
|
|
|
|
mode = tool_settings.gpencil_paint.color_mode
|
2018-07-31 10:22:19 +02:00
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col = layout.column()
|
2020-05-07 15:02:21 +02:00
|
|
|
col.enabled = gp_settings.use_settings_random
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
2020-05-07 15:02:21 +02:00
|
|
|
row.prop(gp_settings, "random_pressure", text="Radius", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_radius", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_radius", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_radius and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_pressure", brush=True, use_negative_slope=True)
|
2018-11-09 18:03:34 +01:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_strength", text="Strength", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_strength", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_strength", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_strength and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_strength", brush=True, use_negative_slope=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "uv_random", text="UV", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_uv", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_uv", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_uv and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_uv", brush=True, use_negative_slope=True)
|
2018-11-09 18:03:34 +01:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
col.separator()
|
2018-11-09 18:03:34 +01:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.enabled = mode == 'VERTEXCOLOR' and gp_settings.use_settings_random
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_hue_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_hue", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_hue", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_hue and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_hue", brush=True, use_negative_slope=True)
|
2020-05-07 15:02:21 +02:00
|
|
|
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_saturation_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_sat", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_sat", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_sat and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_saturation", brush=True, use_negative_slope=True)
|
2020-05-07 15:02:21 +02:00
|
|
|
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_value_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_val", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_val", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_val and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_value", brush=True, use_negative_slope=True)
|
2018-11-09 18:03:34 +01:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
col.separator()
|
2018-11-09 18:03:34 +01:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "pen_jitter", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_jitter_pressure and self.is_popover is False:
|
2024-03-15 10:04:03 +11:00
|
|
|
col.template_curve_mapping(gp_settings, "curve_jitter", brush=True, use_negative_slope=True)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_label = "Falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
if brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
2021-06-09 12:11:38 +02:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
2024-03-29 10:06:17 +11:00
|
|
|
if tool and tool.idname != "builtin_brush.Tint":
|
2021-06-09 12:11:38 +02:00
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
gptool = brush.gpencil_tool
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2021-06-09 12:11:38 +02:00
|
|
|
return (settings and settings.brush and settings.brush.curve and gptool == 'TINT')
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
|
2022-09-16 13:09:12 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_gap_closure(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_advanced"
|
2022-09-16 13:09:12 +02:00
|
|
|
bl_label = "Gap Closure"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool == 'FILL'
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
brush = tool_settings.gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
col.prop(gp_settings, "extend_stroke_factor", text="Size")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "fill_extend_mode", text="Mode")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "show_fill_extend", text="Visual Aids")
|
|
|
|
|
|
2022-09-28 14:32:56 +02:00
|
|
|
if gp_settings.fill_extend_mode == 'EXTEND':
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "use_collide_strokes")
|
|
|
|
|
|
2022-09-16 13:09:12 +02:00
|
|
|
|
2015-12-13 21:03:13 +13:00
|
|
|
# Grease Pencil stroke sculpting tools
|
2020-03-09 16:27:24 +01:00
|
|
|
class GreasePencilSculptPanel:
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_sculpt"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2015-12-13 21:03:13 +13:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2020-06-23 13:30:21 +10:00
|
|
|
if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}:
|
2020-03-09 16:27:24 +01:00
|
|
|
if context.gpencil_data is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
gpd = context.gpencil_data
|
|
|
|
|
return bool(gpd.is_stroke_sculpt_mode)
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_sculpt_select(Panel, View3DPanel, GreasePencilSculptPanel, BrushSelectPanel):
|
|
|
|
|
bl_label = "Brush Asset"
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_sculpt_settings(Panel, View3DPanel, GreasePencilSculptPanel):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brush Settings"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_sculpt_paint
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if not self.is_popover:
|
|
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
|
brush_basic_gpencil_sculpt_settings,
|
|
|
|
|
)
|
|
|
|
|
brush_basic_gpencil_sculpt_settings(layout, context, brush)
|
2015-12-13 21:03:13 +13:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_sculpt_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".greasepencil_sculpt"
|
|
|
|
|
bl_label = "Falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_sculpt_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
return (settings and settings.brush and settings.brush.curve)
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2022-05-02 16:05:04 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_sculpt_brush_advanced(GreasePencilSculptAdvancedPanel, View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_sculpt"
|
|
|
|
|
bl_label = "Advanced"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_sculpt_settings"
|
2022-05-02 16:05:04 +02:00
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_sculpt_paint.brush
|
|
|
|
|
if brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
tool = brush.gpencil_sculpt_tool
|
2022-11-08 16:55:59 +01:00
|
|
|
return tool in {'SMOOTH', 'RANDOMIZE'}
|
2022-05-02 16:05:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover(GreasePencilSculptAdvancedPanel, View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_sculpt"
|
|
|
|
|
bl_label = "Brush"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
if context.region.type != 'TOOL_HEADER':
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
brush = context.tool_settings.gpencil_sculpt_paint.brush
|
|
|
|
|
if brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
tool = brush.gpencil_sculpt_tool
|
2022-11-08 16:55:59 +01:00
|
|
|
return tool in {'SMOOTH', 'RANDOMIZE'}
|
2022-05-02 16:05:04 +02:00
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
# Grease Pencil weight painting tools
|
|
|
|
|
class GreasePencilWeightPanel:
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_weight"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2016-08-03 23:31:48 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2020-06-23 13:30:21 +10:00
|
|
|
if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}:
|
GPv3: Weight Paint tools (Draw, Blur, Average, Smear, Sample weight)
This PR implements the Weight Paint tools for GPv3.
Tools:
- Draw, for assigning weight to stroke points
- Blur, smooths out weight using adjacent stroke point weights
- Average, smooths weight using the average weight under the brush
- Smear, like finger painting, drags weights in the direction of the brush
- Sample weight, sets the brush weight to the weight under the cursor
The weights are assigned to the active vertex group. When there is no
active vertex group, a group is automatically created.
When the Auto Normalize option is enabled, it is ensured that all
bone-deforming vertex groups add up to the weight of 1.0.
When a vertex group is locked, it's weights will not be altered by
Auto Normalize.
The PR already supports multi frame editing, including the use of a
falloff (defined by a curve).
The implementation is in accordance with the Weight Paint tools in GPv2.
Pull Request: https://projects.blender.org/blender/blender/pulls/118347
2024-04-25 15:21:14 +02:00
|
|
|
if context.object and context.object.type == 'GREASEPENCIL' and context.mode == 'WEIGHT_GREASE_PENCIL':
|
|
|
|
|
return True
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
if context.gpencil_data is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
gpd = context.gpencil_data
|
|
|
|
|
return bool(gpd.is_stroke_weight_mode)
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_weight_paint_select(View3DPanel, Panel, GreasePencilWeightPanel, BrushSelectPanel):
|
|
|
|
|
bl_label = "Brush Asset"
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_weight_paint_settings(Panel, View3DPanel, GreasePencilWeightPanel):
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brush Settings"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
2023-04-20 07:55:24 +02:00
|
|
|
if self.is_popover:
|
|
|
|
|
return
|
2023-04-20 18:27:36 +10:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_weight_paint
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
GPv3: Weight Paint tools (Draw, Blur, Average, Smear, Sample weight)
This PR implements the Weight Paint tools for GPv3.
Tools:
- Draw, for assigning weight to stroke points
- Blur, smooths out weight using adjacent stroke point weights
- Average, smooths weight using the average weight under the brush
- Smear, like finger painting, drags weights in the direction of the brush
- Sample weight, sets the brush weight to the weight under the cursor
The weights are assigned to the active vertex group. When there is no
active vertex group, a group is automatically created.
When the Auto Normalize option is enabled, it is ensured that all
bone-deforming vertex groups add up to the weight of 1.0.
When a vertex group is locked, it's weights will not be altered by
Auto Normalize.
The PR already supports multi frame editing, including the use of a
falloff (defined by a curve).
The implementation is in accordance with the Weight Paint tools in GPv2.
Pull Request: https://projects.blender.org/blender/blender/pulls/118347
2024-04-25 15:21:14 +02:00
|
|
|
if context.mode == 'WEIGHT_GPENCIL':
|
|
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
|
brush_basic_gpencil_weight_settings,
|
|
|
|
|
)
|
|
|
|
|
brush_basic_gpencil_weight_settings(layout, context, brush)
|
|
|
|
|
else:
|
|
|
|
|
# Grease Pencil v3
|
|
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
|
brush_basic_grease_pencil_weight_settings,
|
|
|
|
|
)
|
|
|
|
|
brush_basic_grease_pencil_weight_settings(layout, context, brush)
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_weight_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".greasepencil_weight"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_weight_paint_settings"
|
2020-03-09 16:27:24 +01:00
|
|
|
bl_label = "Falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_weight_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
2021-03-23 16:21:51 +11:00
|
|
|
return (brush and brush.curve)
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
|
2023-04-20 07:55:24 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_weight_options(Panel, View3DPanel, GreasePencilWeightPanel):
|
|
|
|
|
bl_label = "Options"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-04-20 18:27:36 +10:00
|
|
|
|
2023-04-20 07:55:24 +02:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
tool_settings = context.scene.tool_settings
|
2023-04-20 18:27:36 +10:00
|
|
|
|
2023-04-20 07:55:24 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize")
|
|
|
|
|
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
# Grease Pencil vertex painting tools
|
|
|
|
|
class GreasePencilVertexPanel:
|
|
|
|
|
bl_context = ".greasepencil_vertex"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2020-06-23 13:30:21 +10:00
|
|
|
if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}:
|
2020-03-09 16:27:24 +01:00
|
|
|
if context.gpencil_data is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
gpd = context.gpencil_data
|
|
|
|
|
return bool(gpd.is_stroke_vertex_mode)
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_vertex_paint_select(View3DPanel, Panel, GreasePencilVertexPanel, BrushSelectPanel):
|
|
|
|
|
bl_label = "Brush Asset"
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_vertex_paint_settings(Panel, View3DPanel, GreasePencilVertexPanel):
|
|
|
|
|
bl_label = "Brush Settings"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if not self.is_popover:
|
|
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
|
brush_basic_gpencil_vertex_settings,
|
|
|
|
|
)
|
|
|
|
|
brush_basic_gpencil_vertex_settings(layout, context, brush)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_vertex_color(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_vertex"
|
|
|
|
|
bl_label = "Color"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if context.region.type == 'TOOL_HEADER' or brush.gpencil_vertex_tool in {'BLUR', 'AVERAGE', 'SMEAR'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
col.template_color_picker(brush, "color", value_slider=True)
|
|
|
|
|
|
|
|
|
|
sub_row = col.row(align=True)
|
|
|
|
|
sub_row.prop(brush, "color", text="")
|
|
|
|
|
sub_row.prop(brush, "secondary_color", text="")
|
|
|
|
|
|
|
|
|
|
sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
|
|
|
|
|
bl_context = ".greasepencil_vertex"
|
|
|
|
|
bl_label = "Falloff"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
return (settings and settings.brush and settings.brush.curve)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_vertex_palette(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_vertex"
|
|
|
|
|
bl_label = "Palette"
|
|
|
|
|
bl_category = "Tool"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_vertex_color"
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_vertex_tool in {'BLUR', 'AVERAGE', 'SMEAR'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_vertex_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.template_ID(settings, "palette", new="palette.new")
|
|
|
|
|
if settings.palette:
|
|
|
|
|
col.template_palette(settings, "palette", color=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_label = "Color"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if context.region.type == 'TOOL_HEADER':
|
|
|
|
|
return False
|
|
|
|
|
|
2021-06-09 12:11:38 +02:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
2024-03-29 10:06:17 +11:00
|
|
|
if tool and tool.idname in {"builtin.cutter", "builtin.eyedropper", "builtin.interpolate"}:
|
2021-06-09 12:11:38 +02:00
|
|
|
return False
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool not in {'DRAW', 'FILL'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool != 'TINT':
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.prop(settings, "color_mode", expand=True)
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.enabled = settings.color_mode == 'VERTEXCOLOR' or brush.gpencil_tool == 'TINT'
|
|
|
|
|
|
|
|
|
|
col.template_color_picker(brush, "color", value_slider=True)
|
|
|
|
|
|
|
|
|
|
sub_row = col.row(align=True)
|
|
|
|
|
sub_row.prop(brush, "color", text="")
|
|
|
|
|
sub_row.prop(brush, "secondary_color", text="")
|
|
|
|
|
|
|
|
|
|
sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool in {'DRAW', 'FILL'}:
|
|
|
|
|
col.prop(gp_settings, "vertex_mode", text="Mode")
|
|
|
|
|
col.prop(gp_settings, "vertex_color_factor", slider=True, text="Mix Factor")
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
|
col.prop(gp_settings, "vertex_mode", text="Mode")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_label = "Palette"
|
|
|
|
|
bl_category = "Tool"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_mixcolor"
|
2020-03-09 16:27:24 +01:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
2021-06-09 12:11:38 +02:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
2024-03-29 10:06:17 +11:00
|
|
|
if tool and tool.idname in {"builtin.cutter", "builtin.eyedropper", "builtin.interpolate"}:
|
2021-06-09 12:11:38 +02:00
|
|
|
return False
|
|
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool not in {'DRAW', 'FILL'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2023-04-13 13:14:01 +10:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.enabled = settings.color_mode == 'VERTEXCOLOR' or brush.gpencil_tool == 'TINT'
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.template_ID(settings, "palette", new="palette.new")
|
|
|
|
|
if settings.palette:
|
|
|
|
|
col.template_palette(settings, "palette", color=True)
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_brush_eraser(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_label = "Eraser"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
if context.region.type == 'TOOL_HEADER':
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
return (tool and tool.idname == "builtin.brush")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(settings, "eraser_brush")
|
|
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
# Grease Pencil Brush Appearance (one for each mode)
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_paint_appearance(GreasePencilDisplayPanel, Panel, View3DPanel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_settings"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Cursor"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 15
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_sculpt_appearance(GreasePencilDisplayPanel, Panel, View3DPanel):
|
2018-09-21 20:15:25 +02:00
|
|
|
bl_context = ".greasepencil_sculpt"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_sculpt_settings"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Cursor"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
2018-09-21 20:15:25 +02:00
|
|
|
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_weight_appearance(GreasePencilDisplayPanel, Panel, View3DPanel):
|
2018-07-31 10:22:19 +02:00
|
|
|
bl_context = ".greasepencil_weight"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_weight_paint_settings"
|
2019-05-10 13:43:07 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Cursor"
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_vertex_appearance(GreasePencilDisplayPanel, Panel, View3DPanel):
|
|
|
|
|
bl_context = ".greasepencil_vertex"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_vertex_paint_settings"
|
2020-03-09 16:27:24 +01:00
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_label = "Cursor"
|
2018-07-31 10:22:19 +02:00
|
|
|
|
2020-05-07 15:02:21 +02:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class VIEW3D_PT_gpencil_brush_presets(Panel, PresetPanel):
|
2018-07-31 10:22:19 +02:00
|
|
|
"""Brush settings"""
|
|
|
|
|
bl_label = "Brush Presets"
|
|
|
|
|
preset_subdir = "gpencil_brush"
|
|
|
|
|
preset_operator = "script.execute_preset"
|
|
|
|
|
preset_add_operator = "scene.gpencil_brush_preset_add"
|
2016-08-03 23:31:48 +02:00
|
|
|
|
|
|
|
|
|
2024-02-29 10:44:19 +01:00
|
|
|
class GreasePencilV3PaintPanel:
|
|
|
|
|
bl_context = ".grease_pencil_paint"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}:
|
|
|
|
|
# Hide for tools not using brushes.
|
|
|
|
|
if tool_use_brush(context) is False:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_select(Panel, View3DPanel, GreasePencilV3PaintPanel, BrushSelectPanel):
|
|
|
|
|
bl_label = "Brush Asset"
|
2024-02-29 10:44:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_settings(Panel, View3DPanel, GreasePencilV3PaintPanel):
|
|
|
|
|
bl_label = "Brush Settings"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
def draw_header_preset(self, _context):
|
|
|
|
|
VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
gpencil_paint = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
brush = gpencil_paint.brush
|
|
|
|
|
|
|
|
|
|
if brush is not None:
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool in {'DRAW', 'FILL'}:
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row_mat = row.row()
|
|
|
|
|
if gp_settings.use_material_pin:
|
|
|
|
|
row_mat.template_ID(gp_settings, "material", live_icon=True)
|
|
|
|
|
else:
|
|
|
|
|
row_mat.template_ID(context.active_object, "active_material", live_icon=True)
|
|
|
|
|
row_mat.enabled = False # will otherwise allow changing material in active slot
|
|
|
|
|
|
|
|
|
|
row.prop(gp_settings, "use_material_pin", text="")
|
|
|
|
|
|
|
|
|
|
if not self.is_popover:
|
|
|
|
|
from bl_ui.properties_paint_common import (
|
|
|
|
|
brush_basic_grease_pencil_paint_settings,
|
|
|
|
|
)
|
|
|
|
|
brush_basic_grease_pencil_paint_settings(layout, context, brush, compact=False)
|
|
|
|
|
|
|
|
|
|
|
2024-05-14 15:20:31 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_advanced(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_label = "Advanced"
|
2024-05-15 13:36:06 +02:00
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_settings"
|
2024-05-14 15:20:31 +02:00
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_ui_units_x = 13
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
if ob.type != 'GREASEPENCIL':
|
|
|
|
|
return False
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'TINT'}
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.scene.tool_settings
|
|
|
|
|
ups = tool_settings.unified_paint_settings
|
|
|
|
|
gpencil_paint = tool_settings.gpencil_paint
|
|
|
|
|
brush = gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
|
if brush is None:
|
|
|
|
|
return
|
|
|
|
|
if brush.gpencil_tool != 'FILL':
|
|
|
|
|
row = col.row(align=True)
|
2024-06-07 16:31:53 +02:00
|
|
|
row.prop(brush, "use_locked_size", expand=True)
|
2024-05-14 15:20:31 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
2024-05-29 11:55:59 +02:00
|
|
|
col.prop(brush, "spacing", slider=True)
|
2024-05-14 15:20:31 +02:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col.prop(gp_settings, "active_smooth_factor")
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col.prop(gp_settings, "angle", slider=True)
|
|
|
|
|
col.prop(gp_settings, "angle_factor", text="Factor", slider=True)
|
|
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
ma = None
|
|
|
|
|
if ob and brush.gpencil_settings.use_material_pin is False:
|
|
|
|
|
ma = ob.active_material
|
|
|
|
|
elif brush.gpencil_settings.material:
|
|
|
|
|
ma = brush.gpencil_settings.material
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
col.prop(gp_settings, "hardness", slider=True)
|
|
|
|
|
subcol = col.column(align=True)
|
|
|
|
|
if ma and ma.grease_pencil.mode == 'LINE':
|
|
|
|
|
subcol.enabled = False
|
|
|
|
|
subcol.prop(gp_settings, "aspect")
|
|
|
|
|
elif brush.gpencil_tool == 'FILL':
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "fill_draw_mode", text="Boundary", text_ctxt=i18n_contexts.id_gpencil)
|
|
|
|
|
row.prop(
|
|
|
|
|
gp_settings,
|
|
|
|
|
"show_fill_boundary",
|
|
|
|
|
icon='HIDE_OFF' if gp_settings.show_fill_boundary else 'HIDE_ON',
|
|
|
|
|
text="",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "fill_layer_mode", text="Layers")
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
col.prop(gp_settings, "fill_simplify_level", text="Simplify")
|
|
|
|
|
if gp_settings.fill_draw_mode != 'STROKE':
|
|
|
|
|
col = layout.column(align=False, heading="Ignore Transparent")
|
|
|
|
|
col.use_property_decorate = False
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.prop(gp_settings, "show_fill", text="")
|
|
|
|
|
sub = sub.row(align=True)
|
|
|
|
|
sub.active = gp_settings.show_fill
|
|
|
|
|
sub.prop(gp_settings, "fill_threshold", text="")
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "use_fill_limit")
|
|
|
|
|
|
|
|
|
|
|
2024-06-04 13:56:24 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_stroke(Panel, View3DPanel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brush_settings"
|
|
|
|
|
bl_label = "Stroke"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
bl_ui_units_x = 12
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
if ob.type != 'GREASEPENCIL':
|
|
|
|
|
return False
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool == 'DRAW'
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_post_processing(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_stroke"
|
|
|
|
|
bl_label = "Post-Processing"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
if ob.type != 'GREASEPENCIL':
|
|
|
|
|
return False
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'}
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
self.layout.use_property_split = False
|
|
|
|
|
self.layout.prop(gp_settings, "use_settings_postprocess", text=self.bl_label if self.is_popover else "")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = gp_settings.use_settings_postprocess
|
|
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.prop(gp_settings, "pen_smooth_factor")
|
|
|
|
|
col1.prop(gp_settings, "pen_smooth_steps")
|
|
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
2024-06-04 17:24:51 +02:00
|
|
|
col1.prop(gp_settings, "pen_subdivision_steps", text="Subdivisions")
|
2024-06-04 13:56:24 +02:00
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
2024-06-05 15:06:49 +02:00
|
|
|
col1.prop(gp_settings, "simplify_pixel_threshold", slider=True)
|
2024-06-04 13:56:24 +02:00
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.prop(gp_settings, "use_trim")
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
row = col.row(heading="Outline", align=True)
|
|
|
|
|
row.prop(gp_settings, "use_settings_outline", text="")
|
|
|
|
|
row2 = row.row(align=True)
|
|
|
|
|
row2.enabled = gp_settings.use_settings_outline
|
|
|
|
|
row2.prop(gp_settings, "material_alt", text="")
|
|
|
|
|
|
|
|
|
|
row2 = col.row(align=True)
|
|
|
|
|
row2.enabled = gp_settings.use_settings_outline
|
|
|
|
|
row2.prop(gp_settings, "outline_thickness_factor")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_random(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_stroke"
|
|
|
|
|
bl_label = "Randomize"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
if ob.type != 'GREASEPENCIL':
|
|
|
|
|
return False
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'}
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
self.layout.use_property_split = False
|
|
|
|
|
self.layout.prop(gp_settings, "use_settings_random", text=self.bl_label if self.is_popover else "")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
brush = tool_settings.gpencil_paint.brush
|
|
|
|
|
mode = tool_settings.gpencil_paint.color_mode
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.enabled = gp_settings.use_settings_random
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_pressure", text="Radius", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_radius", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_radius", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_radius and self.is_popover is False:
|
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_pressure", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_strength", text="Strength", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_strength", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_strength", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_strength and self.is_popover is False:
|
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_strength", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
2024-06-25 19:21:13 +02:00
|
|
|
row.prop(gp_settings, "uv_random", text="Rotation", slider=True)
|
2024-06-04 13:56:24 +02:00
|
|
|
row.prop(gp_settings, "use_stroke_random_uv", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_uv", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_uv and self.is_popover is False:
|
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_random_uv", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col1 = col.column(align=True)
|
|
|
|
|
col1.enabled = mode == 'VERTEXCOLOR' and gp_settings.use_settings_random
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_hue_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_hue", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_hue", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_hue and self.is_popover is False:
|
|
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_hue", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_saturation_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_sat", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_sat", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_sat and self.is_popover is False:
|
|
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_saturation", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
row = col1.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "random_value_factor", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_stroke_random_val", text="", icon='GP_SELECT_STROKES')
|
|
|
|
|
row.prop(gp_settings, "use_random_press_val", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_random_press_val and self.is_popover is False:
|
|
|
|
|
col1.template_curve_mapping(gp_settings, "curve_random_value", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "pen_jitter", slider=True)
|
|
|
|
|
row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
if gp_settings.use_jitter_pressure and self.is_popover is False:
|
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_jitter", brush=True, use_negative_slope=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_stabilizer(Panel, View3DPanel):
|
|
|
|
|
bl_context = ".greasepencil_paint"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_stroke"
|
|
|
|
|
bl_label = "Stabilize Stroke"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.active_object
|
|
|
|
|
if ob.type != 'GREASEPENCIL':
|
|
|
|
|
return False
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool == 'DRAW'
|
|
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
self.layout.use_property_split = False
|
|
|
|
|
self.layout.prop(brush, "use_smooth_stroke", text=self.bl_label if self.is_popover else "")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = brush.use_smooth_stroke
|
|
|
|
|
|
|
|
|
|
col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
|
|
|
|
|
col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
|
|
|
|
|
|
|
|
|
|
|
2024-02-29 10:44:19 +01:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_mixcolor(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".grease_pencil_paint"
|
|
|
|
|
bl_label = "Color"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if context.region.type == 'TOOL_HEADER':
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
2024-03-29 10:06:17 +11:00
|
|
|
if tool and tool.idname in {"builtin.cutter", "builtin.eyedropper", "builtin.interpolate"}:
|
2024-02-29 10:44:19 +01:00
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool not in {'DRAW', 'FILL'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
row.prop(settings, "color_mode", expand=True)
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.enabled = settings.color_mode == 'VERTEXCOLOR'
|
|
|
|
|
|
|
|
|
|
col.template_color_picker(brush, "color", value_slider=True)
|
|
|
|
|
|
|
|
|
|
sub_row = col.row(align=True)
|
|
|
|
|
UnifiedPaintPanel.prop_unified_color(sub_row, context, brush, "color", text="")
|
|
|
|
|
UnifiedPaintPanel.prop_unified_color(sub_row, context, brush, "secondary_color", text="")
|
|
|
|
|
|
|
|
|
|
sub_row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool in {'DRAW', 'FILL'}:
|
|
|
|
|
col.prop(gp_settings, "vertex_mode", text="Mode")
|
|
|
|
|
col.prop(gp_settings, "vertex_color_factor", slider=True, text="Mix Factor")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_mix_palette(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".grease_pencil_paint"
|
|
|
|
|
bl_label = "Palette"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_mixcolor"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
|
|
if ob is None or brush is None:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
2024-03-29 10:06:17 +11:00
|
|
|
if tool and tool.idname in {"builtin.cutter", "builtin.eyedropper", "builtin.interpolate"}:
|
2024-02-29 10:44:19 +01:00
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
if brush.gpencil_tool not in {'DRAW', 'FILL'}:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.enabled = settings.color_mode == 'VERTEXCOLOR'
|
|
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.template_ID(settings, "palette", new="palette.new")
|
|
|
|
|
if settings.palette:
|
|
|
|
|
col.template_palette(settings, "palette", color=True)
|
|
|
|
|
|
|
|
|
|
|
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 13:09:57 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_eraser(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".grease_pencil_paint"
|
|
|
|
|
bl_label = "Eraser"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
if context.region.type == 'TOOL_HEADER':
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
return (tool and tool.idname == "builtin.brush")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
settings = tool_settings.gpencil_paint
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop_search(settings, "eraser_brush", bpy.data, "brushes")
|
|
|
|
|
|
|
|
|
|
|
2024-07-12 11:11:17 +02:00
|
|
|
class VIEW3D_PT_tools_grease_pencil_v3_brush_gap_closure(View3DPanel, Panel):
|
|
|
|
|
bl_context = ".grease_pencil_paint"
|
|
|
|
|
bl_parent_id = "VIEW3D_PT_tools_grease_pencil_v3_brush_advanced"
|
|
|
|
|
bl_label = "Gap Closure"
|
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
brush = context.tool_settings.gpencil_paint.brush
|
|
|
|
|
return brush is not None and brush.gpencil_tool == 'FILL'
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
brush = tool_settings.gpencil_paint.brush
|
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
col.prop(gp_settings, "extend_stroke_factor", text="Size")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "fill_extend_mode", text="Mode")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "show_fill_extend", text="Visual Aids")
|
|
|
|
|
|
|
|
|
|
if gp_settings.fill_extend_mode == 'EXTEND':
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(gp_settings, "use_collide_strokes")
|
|
|
|
|
|
|
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2019-08-08 22:54:57 +02:00
|
|
|
VIEW3D_MT_brush_context_menu,
|
2020-03-09 16:27:24 +01:00
|
|
|
VIEW3D_MT_brush_gpencil_context_menu,
|
2019-09-12 00:50:37 +10:00
|
|
|
VIEW3D_PT_tools_object_options,
|
|
|
|
|
VIEW3D_PT_tools_object_options_transform,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_meshedit_options,
|
2023-05-19 17:32:46 +02:00
|
|
|
VIEW3D_PT_tools_meshedit_options_transform,
|
|
|
|
|
VIEW3D_PT_tools_meshedit_options_uvs,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_armatureedit_options,
|
|
|
|
|
VIEW3D_PT_tools_posemode_options,
|
2020-03-05 08:05:21 +11:00
|
|
|
|
2018-10-05 17:40:24 +02:00
|
|
|
VIEW3D_PT_slots_projectpaint,
|
2022-04-08 16:37:35 +02:00
|
|
|
VIEW3D_PT_slots_paint_canvas,
|
2023-09-06 16:21:11 +02:00
|
|
|
VIEW3D_PT_slots_color_attributes,
|
|
|
|
|
VIEW3D_PT_slots_vertex_groups,
|
2019-12-16 13:43:45 +11:00
|
|
|
VIEW3D_PT_tools_brush_select,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_brush_settings,
|
2019-03-19 18:17:50 +01:00
|
|
|
VIEW3D_PT_tools_brush_color,
|
|
|
|
|
VIEW3D_PT_tools_brush_swatches,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_brush_settings_advanced,
|
2019-03-19 18:17:50 +01:00
|
|
|
VIEW3D_PT_tools_brush_clone,
|
2017-03-20 02:34:32 +11:00
|
|
|
TEXTURE_UL_texpaintslots,
|
|
|
|
|
VIEW3D_MT_tools_projectpaint_uvlayer,
|
2017-03-18 20:03:24 +11:00
|
|
|
VIEW3D_PT_tools_brush_texture,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_mask_texture,
|
|
|
|
|
VIEW3D_PT_tools_brush_stroke,
|
2018-10-31 17:23:43 +01:00
|
|
|
VIEW3D_PT_tools_brush_stroke_smooth_stroke,
|
2019-03-19 18:17:50 +01:00
|
|
|
VIEW3D_PT_tools_brush_falloff,
|
|
|
|
|
VIEW3D_PT_tools_brush_falloff_frontface,
|
|
|
|
|
VIEW3D_PT_tools_brush_falloff_normal,
|
|
|
|
|
VIEW3D_PT_tools_brush_display,
|
Weightpaint Gradient tool: expose falloff to the UI
By default, we'll always get a falloff like this from the tool:
{F10559413}
But in the context of using vertexgroups in modifiers/modeling, a choice
on how the gradient falloff of the Weightpaint Gradient tool is shaped
would be desirable:
"real" linear:
{F10559416}
Custom:
{F10559421}
{F10559428}
The way the Weightpaint gradient tool works is a bit outside the usual
tools that use brushes [even though it creates a brush on the fly in
`WPGradient_userData`].
However, it does not have an entry in `eBrushWeightPaintTool` and adding
one there does not play nice for the same reasons (not "really" being
integrated in the brush-based tools).
So in order to expose the brush curve in the UI, we would have to do one
of the following:
- [1] try to use `VIEW3D_PT_tools_brush_falloff`, for this to work:
-- make all kinds of exception in python super classes [`FalloffPanel`,
`BrushPanel`, `UnifiedPaintPanel`, ... -- including making real entries
in `eBrushWeightPaintTool`] to get a proper tool mode and...
-- .. to also make sure Falloff Shape and Front-Face Falloff are not
available [which the tool seems to just not support in its current form]
- [2] just have a simple, contained panel for this tool alone
This patch implements [2] and adds it as part of the ToolDef (could also
be done in `VIEW3D_HT_tool_header`, but again, I think this is nice to
keep separate from the usual tools)
{F10559482}
{F10559485}
Testfile:
{F10559442}
Fixes T91636
Maniphest Tasks: T91636
Differential Revision: https://developer.blender.org/D12614
2021-09-23 15:48:32 +02:00
|
|
|
VIEW3D_PT_tools_weight_gradient,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_sculpt_dyntopo,
|
2019-09-26 15:58:33 +02:00
|
|
|
VIEW3D_PT_sculpt_voxel_remesh,
|
2019-03-20 14:09:55 +01:00
|
|
|
VIEW3D_PT_sculpt_symmetry,
|
2019-05-21 15:49:36 +10:00
|
|
|
VIEW3D_PT_sculpt_symmetry_for_topbar,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_sculpt_options,
|
2018-10-31 17:23:43 +01:00
|
|
|
VIEW3D_PT_sculpt_options_gravity,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2022-05-04 09:51:32 +02:00
|
|
|
VIEW3D_PT_curves_sculpt_symmetry,
|
|
|
|
|
VIEW3D_PT_curves_sculpt_symmetry_for_topbar,
|
|
|
|
|
|
2019-12-12 07:19:59 +01:00
|
|
|
VIEW3D_PT_tools_weightpaint_symmetry,
|
|
|
|
|
VIEW3D_PT_tools_weightpaint_symmetry_for_topbar,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_weightpaint_options,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2017-09-28 01:38:17 +10:00
|
|
|
VIEW3D_PT_tools_vertexpaint_symmetry,
|
2019-05-21 15:49:36 +10:00
|
|
|
VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar,
|
2019-03-20 14:09:55 +01:00
|
|
|
VIEW3D_PT_tools_vertexpaint_options,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2020-01-23 11:45:48 +01:00
|
|
|
VIEW3D_PT_mask,
|
|
|
|
|
VIEW3D_PT_stencil_projectpaint,
|
|
|
|
|
VIEW3D_PT_tools_imagepaint_options_cavity,
|
|
|
|
|
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_imagepaint_symmetry,
|
2019-03-20 14:09:55 +01:00
|
|
|
VIEW3D_PT_tools_imagepaint_options,
|
2020-03-05 08:05:21 +11:00
|
|
|
|
2019-03-20 14:09:55 +01:00
|
|
|
VIEW3D_PT_tools_imagepaint_options_external,
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_MT_tools_projectpaint_stencil,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
2017-03-20 02:34:32 +11:00
|
|
|
VIEW3D_PT_tools_particlemode,
|
2019-03-18 21:30:56 +01:00
|
|
|
VIEW3D_PT_tools_particlemode_options,
|
|
|
|
|
VIEW3D_PT_tools_particlemode_options_shapecut,
|
|
|
|
|
VIEW3D_PT_tools_particlemode_options_display,
|
2018-07-31 10:22:19 +02:00
|
|
|
|
|
|
|
|
VIEW3D_PT_gpencil_brush_presets,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_select,
|
2018-07-31 10:22:19 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_settings,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_advanced,
|
2019-12-17 17:14:05 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_stroke,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_post_processing,
|
2018-07-31 10:22:19 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_random,
|
2019-12-17 17:14:05 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_stabilizer,
|
2022-09-16 13:09:12 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_gap_closure,
|
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 13:09:57 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_eraser,
|
2018-07-31 10:22:19 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_paint_appearance,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_sculpt_select,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_sculpt_settings,
|
2022-05-02 16:05:04 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_sculpt_brush_advanced,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_sculpt_brush_popover,
|
2018-07-31 10:22:19 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_sculpt_appearance,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_weight_paint_select,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_weight_paint_settings,
|
2023-04-20 07:55:24 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_weight_options,
|
2018-07-31 10:22:19 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_weight_appearance,
|
2020-03-09 16:27:24 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_vertex_paint_select,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_vertex_paint_settings,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_vertex_appearance,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_mixcolor,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_mix_palette,
|
|
|
|
|
|
2024-02-29 10:44:19 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_select,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_settings,
|
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 13:09:57 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_eraser,
|
2024-05-14 15:20:31 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_advanced,
|
2024-06-04 13:56:24 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_stroke,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_post_processing,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_random,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_stabilizer,
|
2024-02-29 10:44:19 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_mixcolor,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_mix_palette,
|
2024-07-12 11:11:17 +02:00
|
|
|
VIEW3D_PT_tools_grease_pencil_v3_brush_gap_closure,
|
2024-02-29 10:44:19 +01:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_paint_falloff,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_sculpt_falloff,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_weight_falloff,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_vertex_color,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_vertex_palette,
|
|
|
|
|
VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
|
for cls in classes:
|
|
|
|
|
register_class(cls)
|