2012-01-18 05:54:19 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
|
|
|
|
|
|
|
# <pep8 compliant>
|
2014-08-28 16:40:38 +02:00
|
|
|
from bpy.types import Menu
|
2012-01-18 05:54:19 +00:00
|
|
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class UnifiedPaintPanel:
|
2012-01-18 05:54:19 +00:00
|
|
|
# subclass must set
|
|
|
|
# bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
# bl_region_type = 'UI'
|
|
|
|
|
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
|
|
|
@staticmethod
|
|
|
|
def get_brush_mode(context):
|
2019-12-16 14:29:03 +11:00
|
|
|
""" Get the correct mode for this context. For any context where this returns None,
|
|
|
|
no brush options should be displayed."""
|
2019-12-19 18:12:10 +11:00
|
|
|
mode = context.mode
|
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
|
|
|
|
2019-12-19 18:12:10 +11:00
|
|
|
if mode == 'PARTICLE':
|
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
|
|
|
# Particle brush settings currently completely do their own thing.
|
|
|
|
return None
|
|
|
|
|
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
|
|
|
|
if not tool:
|
|
|
|
# If there is no active tool, then there can't be an active brush.
|
|
|
|
return None
|
|
|
|
|
|
|
|
if not tool.has_datablock:
|
|
|
|
# tool.has_datablock is always true for tools that use brushes.
|
|
|
|
return None
|
|
|
|
|
|
|
|
space_data = context.space_data
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
|
|
if space_data:
|
|
|
|
space_type = space_data.type
|
|
|
|
if space_type == 'IMAGE_EDITOR':
|
|
|
|
if space_data.show_uvedit:
|
|
|
|
return 'UV_SCULPT'
|
|
|
|
return 'PAINT_2D'
|
2019-12-19 18:12:10 +11:00
|
|
|
elif space_type in {'VIEW_3D', 'PROPERTIES'}:
|
|
|
|
if mode == 'PAINT_TEXTURE':
|
|
|
|
if tool_settings.image_paint:
|
|
|
|
return mode
|
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
|
|
|
else:
|
|
|
|
return None
|
2019-12-19 18:12:10 +11:00
|
|
|
return mode
|
2019-12-16 14:29:03 +11:00
|
|
|
return 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
|
|
|
|
2012-01-18 05:54:19 +00:00
|
|
|
@staticmethod
|
|
|
|
def paint_settings(context):
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
2012-01-18 05:54:19 +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
|
|
|
mode = UnifiedPaintPanel.get_brush_mode(context)
|
|
|
|
|
|
|
|
# 3D paint settings
|
|
|
|
if mode == 'SCULPT':
|
2018-12-17 17:20:24 +11:00
|
|
|
return tool_settings.sculpt
|
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 mode == 'PAINT_VERTEX':
|
2018-12-17 17:20:24 +11:00
|
|
|
return tool_settings.vertex_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
|
|
|
elif mode == 'PAINT_WEIGHT':
|
2018-12-17 17:20:24 +11:00
|
|
|
return tool_settings.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
|
|
|
elif mode == 'PAINT_TEXTURE':
|
|
|
|
return tool_settings.image_paint
|
|
|
|
elif mode == 'PARTICLE':
|
2018-12-17 17:20:24 +11:00
|
|
|
return tool_settings.particle_edit
|
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
|
|
|
# 2D paint settings
|
|
|
|
elif mode == 'PAINT_2D':
|
|
|
|
return tool_settings.image_paint
|
|
|
|
elif mode == 'UV_SCULPT':
|
|
|
|
return tool_settings.uv_sculpt
|
|
|
|
# Grease Pencil settings
|
|
|
|
elif mode == 'PAINT_GPENCIL':
|
|
|
|
return tool_settings.gpencil_paint
|
2020-03-09 16:27:24 +01:00
|
|
|
elif mode == 'SCULPT_GPENCIL':
|
|
|
|
return tool_settings.gpencil_sculpt_paint
|
|
|
|
elif mode == 'WEIGHT_GPENCIL':
|
|
|
|
return tool_settings.gpencil_weight_paint
|
|
|
|
elif mode == 'VERTEX_GPENCIL':
|
|
|
|
return tool_settings.gpencil_vertex_paint
|
2019-12-19 18:12:10 +11:00
|
|
|
return None
|
2012-01-18 05:54:19 +00:00
|
|
|
|
|
|
|
@staticmethod
|
2019-12-16 14:29:03 +11:00
|
|
|
def prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
prop_name,
|
|
|
|
unified_name=None,
|
|
|
|
pressure_name=None,
|
|
|
|
icon='NONE',
|
|
|
|
text=None,
|
|
|
|
slider=False,
|
2019-12-23 17:28:21 +01:00
|
|
|
header=False,
|
2019-12-16 14:29:03 +11:00
|
|
|
):
|
|
|
|
""" Generalized way of adding brush options to the UI,
|
|
|
|
along with their pen pressure setting and global toggle, if they exist. """
|
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 = layout.row(align=True)
|
2012-01-18 05:54:19 +00:00
|
|
|
ups = context.tool_settings.unified_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
|
|
|
prop_owner = brush
|
2019-12-23 17:28:21 +01:00
|
|
|
if unified_name and getattr(ups, unified_name):
|
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
|
|
|
prop_owner = ups
|
2018-10-31 17:23:43 +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
|
|
|
row.prop(prop_owner, prop_name, icon=icon, text=text, slider=slider)
|
2012-01-18 05:54:19 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
if pressure_name:
|
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.prop(brush, pressure_name, text="")
|
2012-01-18 05:54:19 +00:00
|
|
|
|
2019-12-23 17:28:21 +01:00
|
|
|
if unified_name and not header:
|
|
|
|
# NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
|
2020-05-29 12:45:20 +10:00
|
|
|
row.prop(ups, unified_name, text="", icon='BRUSHES_ALL')
|
2012-04-29 20:04:25 +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
|
|
|
return row
|
2012-05-15 04:50:47 +00:00
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
@staticmethod
|
2019-03-12 16:19:37 +11:00
|
|
|
def prop_unified_color(parent, context, brush, prop_name, *, text=None):
|
2014-07-21 12:02:05 +02:00
|
|
|
ups = context.tool_settings.unified_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
|
|
|
prop_owner = ups if ups.use_unified_color else brush
|
|
|
|
parent.prop(prop_owner, prop_name, text=text)
|
2014-07-21 12:02:05 +02:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def prop_unified_color_picker(parent, context, brush, prop_name, value_slider=True):
|
|
|
|
ups = context.tool_settings.unified_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
|
|
|
prop_owner = ups if ups.use_unified_color else brush
|
|
|
|
parent.template_color_picker(prop_owner, prop_name, value_slider=value_slider)
|
2014-07-21 12:02:05 +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
|
|
|
### Classes to let various paint modes' panels share code, by sub-classing these classes. ###
|
|
|
|
class BrushPanel(UnifiedPaintPanel):
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return cls.get_brush_mode(context) is not None
|
|
|
|
|
|
|
|
|
|
|
|
class BrushSelectPanel(BrushPanel):
|
|
|
|
bl_label = "Brushes"
|
2014-08-28 16:40:38 +02: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 = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
2014-08-28 16:40:38 +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
|
|
|
row = layout.row()
|
2019-12-16 14:29:03 +11:00
|
|
|
large_preview = 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
|
|
|
if large_preview:
|
|
|
|
row.column().template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8, hide_buttons=False)
|
|
|
|
else:
|
|
|
|
row.column().template_ID(settings, "brush", new="brush.add")
|
|
|
|
col = row.column()
|
|
|
|
col.menu("VIEW3D_MT_brush_context_menu", icon='DOWNARROW_HLT', text="")
|
2014-08-28 16:40:38 +02:00
|
|
|
|
2019-12-19 18:12:10 +11:00
|
|
|
if brush is not None:
|
|
|
|
col.prop(brush, "use_custom_icon", toggle=True, icon='FILE_IMAGE', text="")
|
|
|
|
|
|
|
|
if brush.use_custom_icon:
|
|
|
|
layout.prop(brush, "icon_filepath", text="")
|
2014-08-28 16:40:38 +02:00
|
|
|
|
2014-07-21 12:02:05 +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 ColorPalettePanel(BrushPanel):
|
|
|
|
bl_label = "Color Palette"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2014-07-21 12:02:05 +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
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not super().poll(context):
|
|
|
|
return False
|
2014-07-21 12:02:05 +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
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
brush = settings.brush
|
2014-07-21 19:24:03 +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
|
|
|
if context.space_data.type == 'IMAGE_EDITOR' or context.image_paint_object:
|
|
|
|
capabilities = brush.image_paint_capabilities
|
|
|
|
return capabilities.has_color
|
2014-07-21 12:02:05 +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
|
|
|
elif context.vertex_paint_object:
|
|
|
|
capabilities = brush.vertex_paint_capabilities
|
|
|
|
return capabilities.has_color
|
2020-07-10 19:43:01 +02:00
|
|
|
|
|
|
|
elif context.sculpt_object:
|
|
|
|
capabilities = brush.sculpt_capabilities
|
|
|
|
return capabilities.has_color
|
2019-12-16 14:29:03 +11:00
|
|
|
return False
|
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
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
settings = self.paint_settings(context)
|
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
|
|
|
layout.template_ID(settings, "palette", new="palette.new")
|
|
|
|
if settings.palette:
|
|
|
|
layout.template_palette(settings, "palette", color=True)
|
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 ClonePanel(BrushPanel):
|
|
|
|
bl_label = "Clone"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
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
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not super().poll(context):
|
|
|
|
return False
|
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
|
|
|
settings = cls.paint_settings(context)
|
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
|
|
|
mode = cls.get_brush_mode(context)
|
2020-02-13 15:20:44 +01:00
|
|
|
if mode == 'PAINT_TEXTURE':
|
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
|
|
|
|
return brush.image_tool == 'CLONE'
|
2019-12-16 14:29:03 +11:00
|
|
|
return False
|
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
|
|
|
def draw_header(self, context):
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
self.layout.prop(settings, "use_clone_layer", text="")
|
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
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
settings = self.paint_settings(context)
|
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
|
|
|
layout.active = settings.use_clone_layer
|
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
|
|
|
ob = context.active_object
|
|
|
|
col = layout.column()
|
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
|
|
|
if settings.mode == 'MATERIAL':
|
|
|
|
if len(ob.material_slots) > 1:
|
|
|
|
col.label(text="Materials")
|
2019-12-16 14:29:03 +11:00
|
|
|
col.template_list(
|
|
|
|
"MATERIAL_UL_matslots", "",
|
|
|
|
ob, "material_slots",
|
|
|
|
ob, "active_material_index",
|
|
|
|
rows=2,
|
|
|
|
)
|
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
|
|
|
mat = ob.active_material
|
|
|
|
if mat:
|
|
|
|
col.label(text="Source Clone Slot")
|
2019-12-16 14:29:03 +11:00
|
|
|
col.template_list(
|
|
|
|
"TEXTURE_UL_texpaintslots", "",
|
|
|
|
mat, "texture_paint_images",
|
|
|
|
mat, "paint_clone_slot",
|
|
|
|
rows=2,
|
|
|
|
)
|
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
|
|
|
elif settings.mode == 'IMAGE':
|
|
|
|
mesh = ob.data
|
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
|
|
|
clone_text = mesh.uv_layer_clone.name if mesh.uv_layer_clone else ""
|
|
|
|
col.label(text="Source Clone Image")
|
|
|
|
col.template_ID(settings, "clone_image")
|
|
|
|
col.label(text="Source Clone UV Map")
|
|
|
|
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
|
2019-03-19 18:17:50 +01:00
|
|
|
|
2014-07-21 12:02:05 +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 TextureMaskPanel(BrushPanel):
|
|
|
|
bl_label = "Texture Mask"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
brush = context.tool_settings.image_paint.brush
|
2014-07-21 12:02:05 +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()
|
|
|
|
col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
|
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
|
|
|
mask_tex_slot = brush.mask_texture_slot
|
|
|
|
|
|
|
|
# map_mode
|
|
|
|
layout.row().prop(mask_tex_slot, "mask_map_mode", text="Mask Mapping")
|
|
|
|
|
|
|
|
if mask_tex_slot.map_mode == 'STENCIL':
|
|
|
|
if brush.mask_texture and brush.mask_texture.type == 'IMAGE':
|
|
|
|
layout.operator("brush.stencil_fit_image_aspect").mask = True
|
|
|
|
layout.operator("brush.stencil_reset_transform").mask = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(brush, "use_pressure_masking", text="Pressure Masking")
|
|
|
|
# angle and texture_angle_source
|
|
|
|
if mask_tex_slot.has_texture_angle:
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(mask_tex_slot, "angle", text="Angle")
|
|
|
|
if mask_tex_slot.has_texture_angle_source:
|
|
|
|
col.prop(mask_tex_slot, "use_rake", text="Rake")
|
|
|
|
|
|
|
|
if brush.brush_capabilities.has_random_texture_angle and mask_tex_slot.has_random_texture_angle:
|
|
|
|
col.prop(mask_tex_slot, "use_random", text="Random")
|
|
|
|
if mask_tex_slot.use_random:
|
|
|
|
col.prop(mask_tex_slot, "random_angle", text="Random Angle")
|
|
|
|
|
|
|
|
# scale and offset
|
|
|
|
col.prop(mask_tex_slot, "offset")
|
|
|
|
col.prop(mask_tex_slot, "scale")
|
|
|
|
|
|
|
|
|
|
|
|
class StrokePanel(BrushPanel):
|
|
|
|
bl_label = "Stroke"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
mode = self.get_brush_mode(context)
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(brush, "stroke_method")
|
2019-12-14 21:41:29 +01:00
|
|
|
col.separator()
|
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.use_anchor:
|
|
|
|
col.prop(brush, "use_edge_to_edge", text="Edge To Edge")
|
|
|
|
|
|
|
|
if brush.use_airbrush:
|
|
|
|
col.prop(brush, "rate", text="Rate", slider=True)
|
|
|
|
|
|
|
|
if brush.use_space:
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "spacing", text="Spacing")
|
|
|
|
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
|
|
|
|
|
|
|
|
if brush.use_line or brush.use_curve:
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "spacing", text="Spacing")
|
|
|
|
|
|
|
|
if mode == 'SCULPT':
|
|
|
|
col.row().prop(brush, "use_scene_spacing", text="Spacing Distance", expand=True)
|
|
|
|
|
2019-12-16 13:43:45 +11:00
|
|
|
if mode in {'PAINT_TEXTURE', 'PAINT_2D', 'SCULPT'}:
|
2019-12-14 21:41:29 +01:00
|
|
|
if brush.image_paint_capabilities.has_space_attenuation or brush.sculpt_capabilities.has_space_attenuation:
|
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, "use_space_attenuation")
|
|
|
|
|
2019-12-14 21:41:29 +01:00
|
|
|
if brush.use_curve:
|
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()
|
2019-12-14 21:41:29 +01:00
|
|
|
col.template_ID(brush, "paint_curve", new="paintcurve.new")
|
|
|
|
col.operator("paintcurve.draw")
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
if brush.use_space:
|
|
|
|
col.separator()
|
|
|
|
row = col.row(align=True)
|
|
|
|
col.prop(brush, "dash_ratio", text="Dash Ratio")
|
|
|
|
col.prop(brush, "dash_samples", text="Dash Length")
|
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 (mode == 'SCULPT' and brush.sculpt_capabilities.has_jitter) or mode != 'SCULPT':
|
2019-12-14 21:41:29 +01:00
|
|
|
col.separator()
|
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)
|
|
|
|
if brush.jitter_unit == 'BRUSH':
|
|
|
|
row.prop(brush, "jitter", slider=True)
|
|
|
|
else:
|
|
|
|
row.prop(brush, "jitter_absolute")
|
|
|
|
row.prop(brush, "use_pressure_jitter", toggle=True, text="")
|
|
|
|
col.row().prop(brush, "jitter_unit", expand=True)
|
|
|
|
|
2019-12-14 21:41:29 +01:00
|
|
|
col.separator()
|
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(settings, "input_samples")
|
|
|
|
|
|
|
|
|
|
|
|
class SmoothStrokePanel(BrushPanel):
|
|
|
|
bl_label = "Stabilize Stroke"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not super().poll(context):
|
|
|
|
return False
|
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
brush = settings.brush
|
|
|
|
if brush.brush_capabilities.has_smooth_stroke:
|
|
|
|
return True
|
2019-12-16 14:29:03 +11:00
|
|
|
return 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
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
self.layout.prop(brush, "use_smooth_stroke", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.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)
|
|
|
|
|
|
|
|
|
|
|
|
class FalloffPanel(BrushPanel):
|
|
|
|
bl_label = "Falloff"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
if not super().poll(context):
|
|
|
|
return False
|
|
|
|
settings = cls.paint_settings(context)
|
|
|
|
return (settings and settings.brush and settings.brush.curve)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
mode = self.get_brush_mode(context)
|
|
|
|
brush = settings.brush
|
|
|
|
|
|
|
|
if brush is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
2020-01-13 21:52:07 +01:00
|
|
|
if mode in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT'} and brush.sculpt_tool != 'POSE':
|
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()
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.use_property_split = True
|
|
|
|
row.use_property_decorate = False
|
|
|
|
row.prop(brush, "falloff_shape", expand=True)
|
|
|
|
|
|
|
|
|
|
|
|
class DisplayPanel(BrushPanel):
|
|
|
|
bl_label = "Brush Cursor"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
if settings and not self.is_popover:
|
|
|
|
self.layout.prop(settings, "show_brush", text="")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
mode = self.get_brush_mode(context)
|
|
|
|
settings = self.paint_settings(context)
|
|
|
|
brush = settings.brush
|
|
|
|
tex_slot = brush.texture_slot
|
|
|
|
tex_slot_mask = brush.mask_texture_slot
|
|
|
|
|
|
|
|
if self.is_popover:
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(settings, "show_brush", text="")
|
|
|
|
row.label(text="Display Cursor")
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.active = brush.brush_capabilities.has_overlay and settings.show_brush
|
|
|
|
|
|
|
|
col.prop(brush, "cursor_color_add", text="Cursor Color")
|
|
|
|
if mode == 'SCULPT' and brush.sculpt_capabilities.has_secondary_color:
|
|
|
|
col.prop(brush, "cursor_color_subtract", text="Inverse Cursor Color")
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "cursor_overlay_alpha", text="Falloff Opacity")
|
|
|
|
row.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
|
|
|
row.prop(
|
|
|
|
brush, "use_cursor_overlay", text="", toggle=True,
|
|
|
|
icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
|
|
|
|
)
|
|
|
|
|
|
|
|
if mode in ['PAINT_2D', 'PAINT_TEXTURE', 'PAINT_VERTEX', 'SCULPT']:
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "texture_overlay_alpha", text="Texture Opacity")
|
|
|
|
row.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
|
|
|
if tex_slot.map_mode != 'STENCIL':
|
|
|
|
row.prop(
|
|
|
|
brush, "use_primary_overlay", text="", toggle=True,
|
|
|
|
icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
|
|
|
|
)
|
|
|
|
|
|
|
|
if mode in ['PAINT_TEXTURE', 'PAINT_2D']:
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(brush, "mask_overlay_alpha", text="Mask Texture Opacity")
|
|
|
|
row.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
|
|
|
if tex_slot_mask.map_mode != 'STENCIL':
|
|
|
|
row.prop(
|
|
|
|
brush, "use_secondary_overlay", text="", toggle=True,
|
|
|
|
icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class VIEW3D_MT_tools_projectpaint_clone(Menu):
|
|
|
|
bl_label = "Clone Layer"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
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_layer_clone_index"
|
|
|
|
props.value = i
|
|
|
|
|
|
|
|
|
|
|
|
def brush_settings(layout, context, brush, popover=False):
|
2019-12-16 14:29:03 +11:00
|
|
|
""" Draw simple brush settings for Sculpt,
|
|
|
|
Texture/Vertex/Weight Paint modes, or skip certain settings for the popover """
|
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
|
|
|
|
|
|
|
mode = UnifiedPaintPanel.get_brush_mode(context)
|
|
|
|
|
|
|
|
### Draw simple settings unique to each paint mode. ###
|
|
|
|
brush_shared_settings(layout, context, brush, popover)
|
|
|
|
|
|
|
|
# Sculpt Mode #
|
|
|
|
if mode == 'SCULPT':
|
|
|
|
capabilities = brush.sculpt_capabilities
|
|
|
|
|
|
|
|
# normal_radius_factor
|
|
|
|
layout.prop(brush, "normal_radius_factor", slider=True)
|
2020-03-01 19:57:44 +01:00
|
|
|
layout.prop(brush, "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
|
|
|
|
|
|
|
# auto_smooth_factor and use_inverse_smooth_pressure
|
|
|
|
if capabilities.has_auto_smooth:
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"auto_smooth_factor",
|
|
|
|
pressure_name="use_inverse_smooth_pressure",
|
|
|
|
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
|
|
|
|
|
|
|
# topology_rake_factor
|
|
|
|
if (
|
|
|
|
capabilities.has_topology_rake and
|
|
|
|
context.sculpt_object.use_dynamic_topology_sculpting
|
|
|
|
):
|
|
|
|
layout.prop(brush, "topology_rake_factor", slider=True)
|
|
|
|
|
|
|
|
# normal_weight
|
|
|
|
if capabilities.has_normal_weight:
|
|
|
|
layout.prop(brush, "normal_weight", slider=True)
|
|
|
|
|
|
|
|
# crease_pinch_factor
|
|
|
|
if capabilities.has_pinch_factor:
|
|
|
|
text = "Pinch"
|
2019-12-16 13:43:45 +11:00
|
|
|
if brush.sculpt_tool in {'BLOB', 'SNAKE_HOOK'}:
|
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
|
|
|
text = "Magnify"
|
|
|
|
layout.prop(brush, "crease_pinch_factor", slider=True, text=text)
|
|
|
|
|
|
|
|
# rake_factor
|
|
|
|
if capabilities.has_rake_factor:
|
|
|
|
layout.prop(brush, "rake_factor", slider=True)
|
|
|
|
|
|
|
|
# plane_offset, use_offset_pressure, use_plane_trim, plane_trim
|
|
|
|
if capabilities.has_plane_offset:
|
|
|
|
layout.separator()
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"plane_offset",
|
|
|
|
pressure_name="use_offset_pressure",
|
|
|
|
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
|
|
|
|
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(heading="Plane Trim")
|
|
|
|
row.prop(brush, "use_plane_trim", text="")
|
|
|
|
sub = row.row()
|
|
|
|
sub.active = brush.use_plane_trim
|
|
|
|
sub.prop(brush, "plane_trim", slider=True, text="")
|
|
|
|
|
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.separator()
|
|
|
|
|
|
|
|
# height
|
|
|
|
if capabilities.has_height:
|
|
|
|
layout.prop(brush, "height", slider=True, text="Height")
|
|
|
|
|
|
|
|
# use_persistent, set_persistent_base
|
|
|
|
if capabilities.has_persistence:
|
|
|
|
ob = context.sculpt_object
|
2020-04-14 21:06:49 +02:00
|
|
|
layout.separator()
|
|
|
|
layout.prop(brush, "use_persistent")
|
|
|
|
layout.operator("sculpt.set_persistent_base")
|
|
|
|
layout.separator()
|
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 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
|
|
|
if capabilities.has_color:
|
2020-06-26 21:57:19 +02:00
|
|
|
ups = context.scene.tool_settings.unified_paint_settings
|
|
|
|
row = layout.row(align=True)
|
|
|
|
UnifiedPaintPanel.prop_unified_color(row, context, brush, "color", text="")
|
|
|
|
UnifiedPaintPanel.prop_unified_color(row, context, brush, "secondary_color", text="")
|
|
|
|
row.separator()
|
|
|
|
row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="", emboss=False)
|
|
|
|
row.prop(ups, "use_unified_color", text="", icon='BRUSHES_ALL')
|
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
|
|
|
layout.prop(brush, "blend", text="Blend Mode")
|
|
|
|
|
2020-02-11 20:04:41 +01:00
|
|
|
if brush.sculpt_tool == 'CLAY_STRIPS':
|
|
|
|
row = layout.row()
|
|
|
|
row.prop(brush, "tip_roundness")
|
|
|
|
|
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.sculpt_tool == 'ELASTIC_DEFORM':
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(brush, "elastic_deform_type")
|
|
|
|
layout.prop(brush, "elastic_deform_volume_preservation", slider=True)
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
if brush.sculpt_tool == 'POSE':
|
2020-01-07 16:46:56 +01:00
|
|
|
layout.separator()
|
2020-05-19 01:04:37 +02:00
|
|
|
layout.prop(brush, "pose_deform_type")
|
2020-03-27 18:14:14 +01:00
|
|
|
layout.prop(brush, "pose_origin_type")
|
2020-01-07 16:46:56 +01:00
|
|
|
layout.prop(brush, "pose_offset")
|
|
|
|
layout.prop(brush, "pose_smooth_iterations")
|
2020-06-23 13:30:21 +10:00
|
|
|
if brush.pose_deform_type == 'ROTATE_TWIST' and brush.pose_origin_type in {'TOPOLOGY', 'FACE_SETS'}:
|
2020-05-19 01:04:37 +02:00
|
|
|
layout.prop(brush, "pose_ik_segments")
|
2020-02-11 19:43:36 +01:00
|
|
|
layout.prop(brush, "use_pose_ik_anchored")
|
2020-06-23 16:10:47 +02:00
|
|
|
layout.prop(brush, "use_connected_only")
|
|
|
|
layout.prop(brush, "disconnected_distance_max")
|
|
|
|
|
|
|
|
|
2020-01-07 16:46:56 +01:00
|
|
|
layout.separator()
|
2020-02-28 14:40:40 +01:00
|
|
|
|
|
|
|
if brush.sculpt_tool == 'CLOTH':
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(brush, "cloth_sim_limit")
|
|
|
|
layout.prop(brush, "cloth_sim_falloff")
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(brush, "cloth_deform_type")
|
|
|
|
layout.prop(brush, "cloth_force_falloff_type")
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(brush, "cloth_mass")
|
|
|
|
layout.prop(brush, "cloth_damping")
|
|
|
|
layout.separator()
|
2020-03-05 08:05:21 +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
|
|
|
if brush.sculpt_tool == 'SCRAPE':
|
2019-12-16 23:16:21 +01:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(brush, "area_radius_factor", 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
|
|
|
row = layout.row()
|
2019-12-16 14:29:03 +11:00
|
|
|
row.prop(brush, "invert_to_scrape_fill", text="Invert to Fill")
|
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.sculpt_tool == 'FILL':
|
2019-12-16 23:16:21 +01:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(brush, "area_radius_factor", 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
|
|
|
row = layout.row()
|
2019-12-16 14:29:03 +11:00
|
|
|
row.prop(brush, "invert_to_scrape_fill", text="Invert to Scrape")
|
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.sculpt_tool == 'GRAB':
|
|
|
|
layout.prop(brush, "use_grab_active_vertex")
|
|
|
|
|
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
|
|
|
if brush.sculpt_tool == 'PAINT':
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(brush, "flow")
|
|
|
|
col.prop(brush, "wet_mix")
|
|
|
|
col.prop(brush, "wet_persistence")
|
|
|
|
col.prop(brush, "density")
|
|
|
|
col.prop(brush, "tip_roundness")
|
|
|
|
col.prop(brush, "tip_scale_x")
|
|
|
|
|
2020-07-11 00:19:45 +02:00
|
|
|
if brush.sculpt_tool == 'SMEAR':
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(brush, "smear_deform_type")
|
|
|
|
|
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.sculpt_tool == 'MULTIPLANE_SCRAPE':
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(brush, "multiplane_scrape_angle")
|
|
|
|
col.prop(brush, "use_multiplane_scrape_dynamic")
|
|
|
|
col.prop(brush, "show_multiplane_scrape_planes_preview")
|
|
|
|
|
2020-03-26 16:05:46 +01:00
|
|
|
if brush.sculpt_tool == 'SMOOTH':
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(brush, "smooth_deform_type")
|
|
|
|
if brush.smooth_deform_type == 'SURFACE':
|
|
|
|
col.prop(brush, "surface_smooth_shape_preservation")
|
|
|
|
col.prop(brush, "surface_smooth_current_vertex")
|
|
|
|
col.prop(brush, "surface_smooth_iterations")
|
|
|
|
|
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.sculpt_tool == 'MASK':
|
|
|
|
layout.row().prop(brush, "mask_tool", expand=True)
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
# 3D and 2D Texture Paint Mode.
|
2019-12-16 13:43:45 +11:00
|
|
|
elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
|
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
|
|
|
capabilities = brush.image_paint_capabilities
|
|
|
|
|
|
|
|
if brush.image_tool == 'FILL':
|
2019-12-16 14:29:03 +11:00
|
|
|
# For some reason fill threshold only appears to be implemented in 2D paint.
|
|
|
|
if brush.color_type == 'COLOR':
|
|
|
|
if mode == 'PAINT_2D':
|
|
|
|
layout.prop(brush, "fill_threshold", text="Fill Threshold", slider=True)
|
|
|
|
elif brush.color_type == '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
|
|
|
layout.row().prop(brush, "gradient_fill_mode", expand=True)
|
|
|
|
|
|
|
|
|
|
|
|
def brush_shared_settings(layout, context, brush, popover=False):
|
|
|
|
""" Draw simple brush settings that are shared between different paint modes. """
|
|
|
|
|
|
|
|
mode = UnifiedPaintPanel.get_brush_mode(context)
|
|
|
|
|
|
|
|
### Determine which settings to draw. ###
|
|
|
|
blend_mode = False
|
|
|
|
size = False
|
|
|
|
size_mode = False
|
|
|
|
strength = False
|
|
|
|
strength_pressure = False
|
|
|
|
weight = False
|
|
|
|
direction = False
|
|
|
|
|
|
|
|
# 3D and 2D Texture Paint #
|
2019-12-16 13:43:45 +11:00
|
|
|
if mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
|
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 not popover:
|
|
|
|
blend_mode = brush.image_paint_capabilities.has_color
|
|
|
|
size = brush.image_paint_capabilities.has_radius
|
|
|
|
strength = strength_pressure = True
|
|
|
|
|
|
|
|
# Sculpt #
|
|
|
|
if mode == 'SCULPT':
|
|
|
|
size_mode = True
|
|
|
|
if not popover:
|
|
|
|
size = True
|
|
|
|
strength = True
|
|
|
|
strength_pressure = brush.sculpt_capabilities.has_strength_pressure
|
|
|
|
direction = not brush.sculpt_capabilities.has_direction
|
|
|
|
|
|
|
|
# Vertex Paint #
|
|
|
|
if mode == 'PAINT_VERTEX':
|
|
|
|
if not popover:
|
|
|
|
blend_mode = True
|
|
|
|
size = True
|
|
|
|
strength = True
|
|
|
|
strength_pressure = True
|
|
|
|
|
|
|
|
# Weight Paint #
|
|
|
|
if mode == 'PAINT_WEIGHT':
|
|
|
|
if not popover:
|
|
|
|
size = True
|
|
|
|
weight = brush.weight_paint_capabilities.has_weight
|
|
|
|
strength = strength_pressure = True
|
2019-12-16 14:29:03 +11:00
|
|
|
# Only draw blend mode for the Draw tool, because for other tools it is pointless. D5928#137944
|
|
|
|
if brush.weight_tool == 'DRAW':
|
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
|
|
|
blend_mode = True
|
|
|
|
|
|
|
|
# UV Sculpt #
|
|
|
|
if mode == 'UV_SCULPT':
|
|
|
|
size = True
|
2019-12-16 13:43:45 +11:00
|
|
|
strength = 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
|
|
|
|
|
|
|
### Draw settings. ###
|
|
|
|
ups = context.scene.tool_settings.unified_paint_settings
|
|
|
|
|
|
|
|
if blend_mode:
|
|
|
|
layout.prop(brush, "blend", text="Blend")
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
if weight:
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"weight",
|
|
|
|
unified_name="use_unified_weight",
|
|
|
|
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
|
|
|
|
|
|
|
size_owner = ups if ups.use_unified_size else brush
|
|
|
|
size_prop = "size"
|
|
|
|
if size_mode and (size_owner.use_locked_size == 'SCENE'):
|
|
|
|
size_prop = "unprojected_radius"
|
|
|
|
if size or size_mode:
|
|
|
|
if size:
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
size_prop,
|
|
|
|
unified_name="use_unified_size",
|
|
|
|
pressure_name="use_pressure_size",
|
|
|
|
text="Radius",
|
|
|
|
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
|
|
|
if size_mode:
|
|
|
|
layout.row().prop(size_owner, "use_locked_size", expand=True)
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
if strength:
|
|
|
|
pressure_name = "use_pressure_strength" if strength_pressure else None
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"strength",
|
|
|
|
unified_name="use_unified_strength",
|
|
|
|
pressure_name=pressure_name,
|
|
|
|
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
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
if direction:
|
|
|
|
layout.row().prop(brush, "direction", expand=True)
|
|
|
|
|
|
|
|
|
|
|
|
def brush_settings_advanced(layout, context, brush, popover=False):
|
|
|
|
"""Draw advanced brush settings for Sculpt, Texture/Vertex/Weight Paint modes."""
|
|
|
|
|
|
|
|
mode = UnifiedPaintPanel.get_brush_mode(context)
|
|
|
|
|
|
|
|
# In the popover we want to combine advanced brush settings with non-advanced brush settings.
|
|
|
|
if popover:
|
|
|
|
brush_settings(layout, context, brush, popover=True)
|
|
|
|
layout.separator()
|
|
|
|
layout.label(text="Advanced:")
|
|
|
|
|
|
|
|
# These options are shared across many modes.
|
|
|
|
use_accumulate = False
|
|
|
|
use_frontface = False
|
|
|
|
|
|
|
|
if mode == 'SCULPT':
|
|
|
|
capabilities = brush.sculpt_capabilities
|
|
|
|
use_accumulate = capabilities.has_accumulate
|
|
|
|
use_frontface = 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
|
|
|
col = layout.column(heading="Auto-Masking", align=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
|
|
|
# topology automasking
|
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.prop(brush, "use_automasking_topology", text="Topology")
|
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-05 14:53:23 +01:00
|
|
|
# face masks automasking
|
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.prop(brush, "use_automasking_face_sets", text="Face Sets")
|
|
|
|
|
2020-04-02 16:41:32 +02:00
|
|
|
# boundary edges/face sets automasking
|
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.prop(brush, "use_automasking_boundary_edges", text="Mesh Boundary")
|
2020-05-13 04:11:10 +02:00
|
|
|
col.prop(brush, "use_automasking_boundary_face_sets", text="Face Sets Boundary")
|
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.prop(brush, "automasking_boundary_edges_propagation_steps")
|
2020-03-09 21:14:47 +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
|
|
|
layout.separator()
|
2020-03-05 14:53:23 +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
|
|
|
# sculpt plane settings
|
|
|
|
if capabilities.has_sculpt_plane:
|
|
|
|
layout.prop(brush, "sculpt_plane")
|
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="Use Original", align=True)
|
|
|
|
col.prop(brush, "use_original_normal", text="Normal")
|
|
|
|
col.prop(brush, "use_original_plane", text="Plane")
|
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.separator()
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
# 3D and 2D Texture Paint.
|
2019-12-16 13:43:45 +11:00
|
|
|
elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
|
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
|
|
|
capabilities = brush.image_paint_capabilities
|
|
|
|
use_accumulate = capabilities.has_accumulate
|
|
|
|
|
|
|
|
if mode == 'PAINT_2D':
|
|
|
|
layout.prop(brush, "use_paint_antialiasing")
|
|
|
|
else:
|
|
|
|
layout.prop(brush, "use_alpha")
|
|
|
|
|
|
|
|
# Tool specific settings
|
|
|
|
if brush.image_tool == 'SOFTEN':
|
|
|
|
layout.separator()
|
|
|
|
layout.row().prop(brush, "direction", expand=True)
|
|
|
|
layout.prop(brush, "sharp_threshold")
|
|
|
|
if mode == 'PAINT_2D':
|
|
|
|
layout.prop(brush, "blur_kernel_radius")
|
|
|
|
layout.prop(brush, "blur_mode")
|
|
|
|
|
|
|
|
elif brush.image_tool == 'MASK':
|
|
|
|
layout.prop(brush, "weight", text="Mask Value", slider=True)
|
|
|
|
|
|
|
|
elif brush.image_tool == 'CLONE':
|
|
|
|
if mode == 'PAINT_2D':
|
|
|
|
layout.prop(brush, "clone_image", text="Image")
|
|
|
|
layout.prop(brush, "clone_alpha", text="Alpha")
|
|
|
|
|
|
|
|
# Vertex Paint #
|
|
|
|
elif mode == 'PAINT_VERTEX':
|
|
|
|
layout.prop(brush, "use_alpha")
|
|
|
|
if brush.vertex_tool != 'SMEAR':
|
|
|
|
use_accumulate = True
|
|
|
|
use_frontface = True
|
|
|
|
|
|
|
|
# Weight Paint
|
|
|
|
elif mode == 'PAINT_WEIGHT':
|
|
|
|
if brush.weight_tool != 'SMEAR':
|
|
|
|
use_accumulate = True
|
|
|
|
use_frontface = True
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
# Draw shared 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
|
|
|
if use_accumulate:
|
|
|
|
layout.prop(brush, "use_accumulate")
|
|
|
|
|
|
|
|
if use_frontface:
|
|
|
|
layout.prop(brush, "use_frontface", text="Front Faces Only")
|
|
|
|
|
|
|
|
|
|
|
|
def draw_color_settings(context, layout, brush, color_type=False):
|
|
|
|
"""Draw color wheel and gradient settings."""
|
|
|
|
ups = context.scene.tool_settings.unified_paint_settings
|
|
|
|
|
|
|
|
if color_type:
|
|
|
|
row = layout.row()
|
|
|
|
row.use_property_split = False
|
|
|
|
row.prop(brush, "color_type", expand=True)
|
|
|
|
|
|
|
|
# Color wheel
|
|
|
|
if brush.color_type == 'COLOR':
|
|
|
|
UnifiedPaintPanel.prop_unified_color_picker(layout, context, brush, "color", value_slider=True)
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
UnifiedPaintPanel.prop_unified_color(row, context, brush, "color", text="")
|
|
|
|
UnifiedPaintPanel.prop_unified_color(row, context, brush, "secondary_color", text="")
|
|
|
|
row.separator()
|
|
|
|
row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="", emboss=False)
|
2020-04-13 15:47:41 +02:00
|
|
|
row.prop(ups, "use_unified_color", text="", icon='BRUSHES_ALL')
|
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
|
|
|
# Gradient
|
|
|
|
elif brush.color_type == 'GRADIENT':
|
|
|
|
layout.template_color_ramp(brush, "gradient", expand=True)
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
if brush.image_tool == 'DRAW':
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
col,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"secondary_color",
|
|
|
|
unified_name="use_unified_color",
|
|
|
|
text="Background Color",
|
2019-12-23 17:28:21 +01:00
|
|
|
header=True,
|
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
|
|
|
|
|
|
|
col.prop(brush, "gradient_stroke_mode", text="Gradient Mapping")
|
|
|
|
if brush.gradient_stroke_mode in {'SPACING_REPEAT', 'SPACING_CLAMP'}:
|
|
|
|
col.prop(brush, "grad_spacing")
|
2015-06-03 11:33:33 +02:00
|
|
|
|
2012-05-15 04:50:47 +00:00
|
|
|
|
|
|
|
# Used in both the View3D toolbar and texture properties
|
2013-01-16 12:57:35 +00:00
|
|
|
def brush_texture_settings(layout, brush, sculpt):
|
2012-05-15 04:50:47 +00:00
|
|
|
tex_slot = brush.texture_slot
|
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
2012-05-15 04:50:47 +00:00
|
|
|
|
|
|
|
# map_mode
|
2013-01-16 12:57:35 +00:00
|
|
|
if sculpt:
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.prop(tex_slot, "map_mode", text="Mapping")
|
2012-05-15 04:50:47 +00:00
|
|
|
else:
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.prop(tex_slot, "tex_paint_map_mode", text="Mapping")
|
|
|
|
|
|
|
|
layout.separator()
|
2013-04-07 01:38:03 +00:00
|
|
|
|
2013-04-05 13:00:16 +00:00
|
|
|
if tex_slot.map_mode == 'STENCIL':
|
2013-04-30 10:32:02 +00:00
|
|
|
if brush.texture and brush.texture.type == 'IMAGE':
|
|
|
|
layout.operator("brush.stencil_fit_image_aspect")
|
|
|
|
layout.operator("brush.stencil_reset_transform")
|
2013-02-10 08:54:10 +00:00
|
|
|
|
2013-01-16 12:57:35 +00:00
|
|
|
# angle and texture_angle_source
|
2014-12-30 18:06:59 +01:00
|
|
|
if tex_slot.has_texture_angle:
|
2014-02-12 17:57:25 +02:00
|
|
|
col = layout.column()
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(tex_slot, "angle", text="Angle")
|
2014-12-30 18:06:59 +01:00
|
|
|
if tex_slot.has_texture_angle_source:
|
2014-12-26 23:51:27 +01:00
|
|
|
col.prop(tex_slot, "use_rake", text="Rake")
|
2015-01-29 15:35:06 +11:00
|
|
|
|
2014-12-30 18:06:59 +01:00
|
|
|
if brush.brush_capabilities.has_random_texture_angle and tex_slot.has_random_texture_angle:
|
2014-02-12 17:57:25 +02:00
|
|
|
if sculpt:
|
|
|
|
if brush.sculpt_capabilities.has_random_texture_angle:
|
2014-12-26 23:51:27 +01:00
|
|
|
col.prop(tex_slot, "use_random", text="Random")
|
|
|
|
if tex_slot.use_random:
|
2018-12-23 21:58:59 +01:00
|
|
|
col.prop(tex_slot, "random_angle", text="Random Angle")
|
2014-02-12 17:57:25 +02:00
|
|
|
else:
|
2014-12-26 23:51:27 +01:00
|
|
|
col.prop(tex_slot, "use_random", text="Random")
|
|
|
|
if tex_slot.use_random:
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(tex_slot, "random_angle", text="Random Angle")
|
2012-05-15 04:50:47 +00:00
|
|
|
|
|
|
|
# scale and offset
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.prop(tex_slot, "offset")
|
|
|
|
layout.prop(tex_slot, "scale")
|
2013-02-10 08:54:10 +00:00
|
|
|
|
2013-01-16 12:57:35 +00:00
|
|
|
if sculpt:
|
|
|
|
# texture_sample_bias
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.prop(brush, "texture_sample_bias", slider=True, text="Sample Bias")
|
2013-03-25 01:00:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
def brush_mask_texture_settings(layout, brush):
|
|
|
|
mask_tex_slot = brush.mask_texture_slot
|
|
|
|
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
|
|
|
|
# map_mode
|
2018-10-31 17:23:43 +01:00
|
|
|
layout.row().prop(mask_tex_slot, "mask_map_mode", text="Mask Mapping")
|
Paint refactoring commit, non-disruptive (in theory :p)
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
2013-04-12 17:21:31 +00:00
|
|
|
|
2013-04-23 11:34:18 +00:00
|
|
|
if mask_tex_slot.map_mode == 'STENCIL':
|
2013-04-30 10:32:02 +00:00
|
|
|
if brush.mask_texture and brush.mask_texture.type == 'IMAGE':
|
|
|
|
layout.operator("brush.stencil_fit_image_aspect").mask = True
|
2013-05-02 17:55:17 +00:00
|
|
|
layout.operator("brush.stencil_reset_transform").mask = True
|
2013-04-23 11:34:18 +00:00
|
|
|
|
2013-10-09 14:57:48 +00:00
|
|
|
col = layout.column()
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(brush, "use_pressure_masking", text="Pressure Masking")
|
2014-12-26 23:51:27 +01:00
|
|
|
# angle and texture_angle_source
|
2014-12-30 18:06:59 +01:00
|
|
|
if mask_tex_slot.has_texture_angle:
|
2014-12-26 23:51:27 +01:00
|
|
|
col = layout.column()
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(mask_tex_slot, "angle", text="Angle")
|
2014-12-30 18:06:59 +01:00
|
|
|
if mask_tex_slot.has_texture_angle_source:
|
2014-12-26 23:51:27 +01:00
|
|
|
col.prop(mask_tex_slot, "use_rake", text="Rake")
|
2015-01-29 15:35:06 +11:00
|
|
|
|
2014-12-30 18:06:59 +01:00
|
|
|
if brush.brush_capabilities.has_random_texture_angle and mask_tex_slot.has_random_texture_angle:
|
2014-12-26 23:51:27 +01:00
|
|
|
col.prop(mask_tex_slot, "use_random", text="Random")
|
|
|
|
if mask_tex_slot.use_random:
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(mask_tex_slot, "random_angle", text="Random Angle")
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
# scale and offset
|
2018-10-31 17:23:43 +01:00
|
|
|
col.prop(mask_tex_slot, "offset")
|
|
|
|
col.prop(mask_tex_slot, "scale")
|
2019-12-16 14:29:03 +11:00
|
|
|
|
|
|
|
|
2019-01-02 14:36:56 +11:00
|
|
|
def brush_basic_texpaint_settings(layout, context, brush, *, compact=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
|
|
|
"""Draw Tool Settings header for Vertex Paint and 2D and 3D Texture Paint modes."""
|
2019-01-02 14:36:56 +11:00
|
|
|
capabilities = brush.image_paint_capabilities
|
|
|
|
|
2019-01-10 10:10:21 +11:00
|
|
|
if capabilities.has_color:
|
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
|
|
|
UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
|
2019-01-02 14:36:56 +11:00
|
|
|
layout.prop(brush, "blend", text="" if compact else "Blend")
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"size",
|
|
|
|
pressure_name="use_pressure_size",
|
2019-12-23 17:28:21 +01:00
|
|
|
unified_name="use_unified_size",
|
2019-12-16 14:29:03 +11:00
|
|
|
slider=True,
|
|
|
|
text="Radius",
|
2019-12-23 17:28:21 +01:00
|
|
|
header=True
|
2019-12-16 14:29:03 +11:00
|
|
|
)
|
|
|
|
UnifiedPaintPanel.prop_unified(
|
|
|
|
layout,
|
|
|
|
context,
|
|
|
|
brush,
|
|
|
|
"strength",
|
|
|
|
pressure_name="use_pressure_strength",
|
2019-12-23 17:28:21 +01:00
|
|
|
unified_name="use_unified_strength",
|
|
|
|
header=True
|
2019-12-16 14:29:03 +11:00
|
|
|
)
|
2019-01-02 14:36:56 +11:00
|
|
|
|
2019-01-02 17:23:57 +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
|
|
|
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
|
2020-03-09 16:27:24 +01:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
settings = tool_settings.gpencil_paint
|
2019-01-02 14:36:56 +11: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
|
|
|
tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False)
|
2020-02-05 11:08:15 +01:00
|
|
|
if gp_settings is None:
|
|
|
|
return
|
2019-01-02 14:36:56 +11:00
|
|
|
|
|
|
|
# Brush details
|
|
|
|
if brush.gpencil_tool == 'ERASE':
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "size", text="Radius")
|
|
|
|
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
|
|
|
|
|
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 = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "eraser_mode", expand=True)
|
2019-01-02 14:36:56 +11:00
|
|
|
if gp_settings.eraser_mode == 'SOFT':
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "pen_strength", slider=True)
|
|
|
|
row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "eraser_strength_factor")
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "eraser_thickness_factor")
|
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 = layout.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
row.prop(settings, "show_brush", text="Display Cursor")
|
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
|
|
|
|
|
|
|
# FIXME: tools must use their own UI drawing!
|
2019-01-02 14:36:56 +11:00
|
|
|
elif brush.gpencil_tool == 'FILL':
|
2019-03-17 19:47:31 +01:00
|
|
|
row = layout.row(align=True)
|
2019-01-11 17:22:13 +01:00
|
|
|
row.prop(gp_settings, "fill_leak", text="Leak Size")
|
2019-03-17 19:47:31 +01:00
|
|
|
row = layout.row(align=True)
|
2019-01-11 17:22:13 +01:00
|
|
|
row.prop(brush, "size", text="Thickness")
|
2019-03-17 19:47:31 +01:00
|
|
|
row = layout.row(align=True)
|
2019-01-11 17:22:13 +01:00
|
|
|
row.prop(gp_settings, "fill_simplify_level", text="Simplify")
|
2019-12-16 13:43:45 +11:00
|
|
|
|
2020-03-12 20:29:04 +01:00
|
|
|
else: # brush.gpencil_tool == 'DRAW/TINT':
|
2019-01-02 14:36:56 +11:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "size", text="Radius")
|
|
|
|
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
|
2020-05-07 15:02:21 +02:00
|
|
|
|
|
|
|
if gp_settings.use_pressure and context.area.type == 'PROPERTIES':
|
|
|
|
col = layout.column()
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True,
|
|
|
|
use_negative_slope=True)
|
|
|
|
|
2019-01-02 14:36:56 +11:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "pen_strength", slider=True)
|
|
|
|
row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
|
2020-05-07 15:02:21 +02:00
|
|
|
|
|
|
|
if gp_settings.use_strength_pressure and context.area.type == 'PROPERTIES':
|
|
|
|
col = layout.column()
|
|
|
|
col.template_curve_mapping(gp_settings, "curve_strength", brush=True,
|
|
|
|
use_negative_slope=True)
|
|
|
|
|
2020-03-12 20:29:04 +01:00
|
|
|
if brush.gpencil_tool == 'TINT':
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "vertex_mode", text="Mode")
|
2019-10-12 10:22:09 +11:00
|
|
|
|
2019-10-24 00:41:45 +11:00
|
|
|
# FIXME: tools must use their own UI drawing!
|
|
|
|
if tool.idname in {
|
|
|
|
"builtin.arc",
|
|
|
|
"builtin.curve",
|
|
|
|
"builtin.line",
|
|
|
|
"builtin.box",
|
|
|
|
"builtin.circle",
|
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
|
|
|
"builtin.polyline"
|
2019-10-24 00:41:45 +11:00
|
|
|
}:
|
2019-12-12 13:43:37 +11:00
|
|
|
settings = context.tool_settings.gpencil_sculpt
|
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 compact:
|
2019-10-11 12:26:57 +01:00
|
|
|
row = layout.row(align=True)
|
2020-04-22 16:39:44 +02:00
|
|
|
row.prop(settings, "use_thickness_curve", text="", icon='SPHERECURVE')
|
2019-10-11 12:26:57 +01:00
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.active = settings.use_thickness_curve
|
|
|
|
sub.popover(
|
|
|
|
panel="TOPBAR_PT_gpencil_primitive",
|
|
|
|
text="Thickness Profile",
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(settings, "use_thickness_curve", text="Use Thickness Profile")
|
|
|
|
sub = row.row(align=True)
|
|
|
|
if settings.use_thickness_curve:
|
|
|
|
# Curve
|
|
|
|
layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True)
|
2019-01-02 14:36:56 +11:00
|
|
|
|
|
|
|
|
|
|
|
def brush_basic_gpencil_sculpt_settings(layout, context, brush, *, compact=False):
|
2020-03-09 16:27:24 +01:00
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
tool = brush.gpencil_sculpt_tool
|
2019-01-02 14:36:56 +11:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "size", slider=True)
|
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.enabled = tool not in {'GRAB', 'CLONE'}
|
2020-03-09 16:27:24 +01:00
|
|
|
sub.prop(gp_settings, "use_pressure", text="")
|
2019-01-02 14:36:56 +11:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "strength", slider=True)
|
|
|
|
row.prop(brush, "use_pressure_strength", text="")
|
|
|
|
|
|
|
|
if compact:
|
|
|
|
if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
|
|
|
|
row.separator()
|
2020-03-09 16:27:24 +01:00
|
|
|
row.prop(gp_settings, "direction", expand=True, text="")
|
2019-01-02 14:36:56 +11:00
|
|
|
else:
|
|
|
|
use_property_split_prev = layout.use_property_split
|
|
|
|
layout.use_property_split = False
|
|
|
|
if tool in {'THICKNESS', 'STRENGTH'}:
|
2020-03-09 16:27:24 +01:00
|
|
|
layout.row().prop(gp_settings, "direction", expand=True)
|
2019-01-02 14:36:56 +11:00
|
|
|
elif tool == 'PINCH':
|
|
|
|
row = layout.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
row.prop_enum(gp_settings, "direction", value='ADD', text="Pinch")
|
|
|
|
row.prop_enum(gp_settings, "direction", value='SUBTRACT', text="Inflate")
|
2019-01-02 14:36:56 +11:00
|
|
|
elif tool == 'TWIST':
|
|
|
|
row = layout.row(align=True)
|
2020-03-09 16:27:24 +01:00
|
|
|
row.prop_enum(gp_settings, "direction", value='ADD', text="CCW")
|
|
|
|
row.prop_enum(gp_settings, "direction", value='SUBTRACT', text="CW")
|
2019-01-02 14:36:56 +11:00
|
|
|
layout.use_property_split = use_property_split_prev
|
|
|
|
|
|
|
|
|
2019-04-19 08:26:18 +02:00
|
|
|
def brush_basic_gpencil_weight_settings(layout, _context, brush, *, compact=False):
|
2020-03-09 16:27:24 +01:00
|
|
|
gp_settings = brush.gpencil_settings
|
2019-01-02 14:36:56 +11:00
|
|
|
layout.prop(brush, "size", slider=True)
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "strength", slider=True)
|
|
|
|
row.prop(brush, "use_pressure_strength", text="")
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2019-01-02 15:31:56 +11:00
|
|
|
layout.prop(brush, "weight", slider=True)
|
2019-01-02 14:36:56 +11:00
|
|
|
|
2018-12-20 13:01:40 +11:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
def brush_basic_gpencil_vertex_settings(layout, _context, brush, *, compact=False):
|
|
|
|
gp_settings = brush.gpencil_settings
|
|
|
|
|
|
|
|
# Brush details
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(brush, "size", text="Radius")
|
|
|
|
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
|
|
|
if brush.gpencil_vertex_tool in {'DRAW', 'BLUR', 'SMEAR'}:
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "pen_strength", slider=True)
|
|
|
|
row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
|
|
|
|
|
2020-03-12 20:29:04 +01:00
|
|
|
if brush.gpencil_vertex_tool in {'DRAW', 'REPLACE'}:
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(gp_settings, "vertex_mode", text="Mode")
|
|
|
|
|
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
|
|
|
VIEW3D_MT_tools_projectpaint_clone,
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|