2009-11-01 15:21:20 +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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2018-08-22 09:15:05 +10:00
|
|
|
|
|
|
|
from bpy.types import (
|
|
|
|
Header,
|
|
|
|
Menu,
|
|
|
|
Panel,
|
|
|
|
UIList,
|
|
|
|
)
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_paint_common import (
|
2018-07-31 21:06:08 +10:00
|
|
|
UnifiedPaintPanel,
|
|
|
|
brush_texture_settings,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_basic_texpaint_settings,
|
|
|
|
brush_settings,
|
|
|
|
brush_settings_advanced,
|
|
|
|
draw_color_settings,
|
|
|
|
ClonePanel,
|
|
|
|
BrushSelectPanel,
|
|
|
|
TextureMaskPanel,
|
|
|
|
ColorPalettePanel,
|
|
|
|
StrokePanel,
|
|
|
|
SmoothStrokePanel,
|
|
|
|
FalloffPanel,
|
|
|
|
DisplayPanel,
|
2018-07-31 21:06:08 +10:00
|
|
|
)
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_grease_pencil_common import (
|
2018-08-22 16:59:04 +02:00
|
|
|
AnnotationDataPanel,
|
2018-07-31 21:06:08 +10:00
|
|
|
)
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.space_toolsystem_common import (
|
2019-05-15 12:20:13 +10:00
|
|
|
ToolActivePanelHelper,
|
|
|
|
)
|
|
|
|
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2013-02-10 08:54:10 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class ImagePaintPanel:
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2012-01-18 00:41:39 +00:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
class BrushButtonsPanel(UnifiedPaintPanel):
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2010-08-09 01:37:09 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings.image_paint
|
2018-12-17 17:26:47 +11:00
|
|
|
return tool_settings.brush
|
2010-08-09 01:37:09 +00:00
|
|
|
|
2014-02-22 11:14:15 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_active_tool(Panel, ToolActivePanelHelper):
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
|
|
|
bl_category = "Tool"
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_view(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "View"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
Add the option to show also the UVs of other selected objects in image
space / uv edit. The code was already there, and the option as a rna
bool, but no ui to set it. Matt figured that the View menu in image
space next to other uv stuff, which only shows when UVs are edited, is
the right place.
Works so that when entering editmode for an object to edit UVs, when
have also other objects selected and this option on, also the UVs of
those other objects are shown in the image view.
Liquidape asked this on IRC, and we thought the feat doesn't exist, so I
looked out of curiosity in the code as was thinking it would be easy to
add. Was surprised to find it there already :)
First time that did anything with 2.5, was sure fun enough to search
thru the code to figure out how things work. Adding this ui thing proved
to be exactly as trivial and nice as it should, and the things under the
hood seemed nice, yay!
2010-05-06 23:47:25 +00:00
|
|
|
uv = sima.uv_editor
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
paint = tool_settings.image_paint
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
show_uvedit = sima.show_uvedit
|
2013-04-12 10:19:31 +00:00
|
|
|
show_render = sima.show_render
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-18 12:16:03 +02:00
|
|
|
layout.prop(sima, "show_region_toolbar")
|
|
|
|
layout.prop(sima, "show_region_ui")
|
2019-05-23 11:40:15 +02:00
|
|
|
layout.prop(sima, "show_region_tool_header")
|
2019-04-18 13:49:21 +02:00
|
|
|
layout.prop(sima, "show_region_hud")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(sima, "use_realtime_update")
|
2015-04-20 19:57:57 +02:00
|
|
|
layout.prop(uv, "show_metadata")
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'):
|
|
|
|
layout.prop(uv, "show_texpaint")
|
2018-12-17 17:20:24 +11:00
|
|
|
layout.prop(tool_settings, "show_uv_local_view", text="Show Same Material")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("image.view_zoom_in")
|
|
|
|
layout.operator("image.view_zoom_out")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.menu("IMAGE_MT_view_zoom")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if show_uvedit:
|
2019-06-02 20:30:55 +02:00
|
|
|
layout.operator("image.view_selected", text="Frame Selected")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2020-05-12 15:44:59 +02:00
|
|
|
layout.operator("image.view_all")
|
2019-06-02 20:30:55 +02:00
|
|
|
layout.operator("image.view_all", text="Frame All Fit").fit_view = True
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2019-10-01 20:19:44 +10:00
|
|
|
layout.operator("image.view_center_cursor", text="Center View to Cursor")
|
|
|
|
|
2009-12-03 16:28:50 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2013-04-12 10:19:31 +00:00
|
|
|
if show_render:
|
2016-04-20 15:02:03 +02:00
|
|
|
layout.operator("image.render_border")
|
|
|
|
layout.operator("image.clear_render_border")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2013-04-12 10:19:31 +00:00
|
|
|
layout.operator("image.cycle_render_slot", text="Render Slot Cycle Next")
|
|
|
|
layout.operator("image.cycle_render_slot", text="Render Slot Cycle Previous").reverse = True
|
|
|
|
layout.separator()
|
|
|
|
|
2018-05-24 18:35:19 +02:00
|
|
|
layout.menu("INFO_MT_area")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
class IMAGE_MT_view_zoom(Menu):
|
|
|
|
bl_label = "Fractional Zoom"
|
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2018-08-22 09:15:05 +10:00
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
|
|
|
|
|
|
|
for i, (a, b) in enumerate(ratios):
|
|
|
|
if i in {3, 4}: # Draw separators around Zoom 1:1.
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator(
|
|
|
|
"image.view_zoom_ratio",
|
2019-08-20 17:26:46 +02:00
|
|
|
text=iface_("Zoom %d:%d") % (a, b),
|
2018-08-22 09:15:05 +10:00
|
|
|
translate=False,
|
|
|
|
).ratio = a / b
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_select(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Select"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-07-03 15:44:56 +02:00
|
|
|
layout.operator("uv.select_all", text="All").action = 'SELECT'
|
|
|
|
layout.operator("uv.select_all", text="None").action = 'DESELECT'
|
|
|
|
layout.operator("uv.select_all", text="Invert").action = 'INVERT'
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-10-05 10:27:04 +10:00
|
|
|
layout.operator("uv.select_box").pinned = False
|
|
|
|
layout.operator("uv.select_box", text="Box Select Pinned").pinned = True
|
2018-12-14 19:24:14 -02:00
|
|
|
layout.operator("uv.select_circle")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-07-03 15:44:56 +02:00
|
|
|
layout.operator("uv.select_less", text="Less")
|
|
|
|
layout.operator("uv.select_more", text="More")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("uv.select_pinned")
|
2019-04-29 15:59:02 +10:00
|
|
|
layout.operator("uv.select_linked")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2012-08-09 22:43:10 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("uv.select_split")
|
2019-08-08 01:25:54 +10:00
|
|
|
layout.operator("uv.select_overlap")
|
2012-08-09 22:43:10 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_image(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Image"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-09-01 00:33:39 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
|
|
|
show_render = sima.show_render
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-07-09 23:27:06 +02:00
|
|
|
layout.operator("image.new", text="New")
|
2018-11-07 18:16:04 +01:00
|
|
|
layout.operator("image.open", text="Open...", icon='FILE_FOLDER')
|
2014-06-28 19:13:54 +02:00
|
|
|
|
2018-07-09 23:27:06 +02:00
|
|
|
layout.operator("image.read_viewlayers")
|
2014-08-25 00:15:43 +02:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if ima:
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.separator()
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if not show_render:
|
2018-07-09 23:27:06 +02:00
|
|
|
layout.operator("image.replace", text="Replace...")
|
|
|
|
layout.operator("image.reload", text="Reload")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-08-28 18:01:53 +02:00
|
|
|
layout.operator("image.external_edit", text="Edit Externally")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-07-09 23:27:06 +02:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-07-09 23:27:06 +02:00
|
|
|
if ima:
|
2018-11-07 18:16:04 +01:00
|
|
|
layout.operator("image.save", text="Save", icon='FILE_TICK')
|
2018-07-09 23:27:06 +02:00
|
|
|
layout.operator("image.save_as", text="Save As...")
|
|
|
|
layout.operator("image.save_as", text="Save a Copy...").copy = True
|
|
|
|
|
|
|
|
if ima and ima.source == 'SEQUENCE':
|
|
|
|
layout.operator("image.save_sequence")
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2019-05-16 16:01:11 +02:00
|
|
|
layout.operator("image.save_all_modified", text="Save All Images")
|
2018-07-09 23:27:06 +02:00
|
|
|
|
|
|
|
if ima:
|
2011-02-23 12:02:43 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.menu("IMAGE_MT_image_invert")
|
2019-10-02 00:24:21 +10:00
|
|
|
layout.operator("image.resize", text="Resize")
|
2011-02-23 12:02:43 +00:00
|
|
|
|
2018-03-04 22:45:22 +01:00
|
|
|
if ima and not show_render:
|
|
|
|
if ima.packed_file:
|
2019-12-16 14:29:03 +11:00
|
|
|
if ima.filepath:
|
2018-03-04 22:45:22 +01:00
|
|
|
layout.separator()
|
2019-05-17 15:10:34 +02:00
|
|
|
layout.operator("image.unpack", text="Unpack")
|
2018-03-04 22:45:22 +01:00
|
|
|
else:
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("image.pack", text="Pack")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2020-03-09 16:27:24 +01:00
|
|
|
if ima:
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("palette.extract_from_image", text="Extract Palette")
|
|
|
|
layout.operator("gpencil.image_to_grease_pencil", text="Generate Grease Pencil")
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_image_invert(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Invert"
|
2011-02-23 12:02:43 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2011-02-23 12:02:43 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2018-11-07 18:16:04 +01:00
|
|
|
props = layout.operator("image.invert", text="Invert Image Colors", icon='IMAGE_RGB')
|
2011-10-23 00:53:50 +00:00
|
|
|
props.invert_r = True
|
|
|
|
props.invert_g = True
|
|
|
|
props.invert_b = True
|
2011-02-23 12:02:43 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2018-11-07 18:16:04 +01:00
|
|
|
layout.operator("image.invert", text="Invert Red Channel", icon='COLOR_RED').invert_r = True
|
|
|
|
layout.operator("image.invert", text="Invert Green Channel", icon='COLOR_GREEN').invert_g = True
|
|
|
|
layout.operator("image.invert", text="Invert Blue Channel", icon='COLOR_BLUE').invert_b = True
|
|
|
|
layout.operator("image.invert", text="Invert Alpha Channel", icon='IMAGE_ALPHA').invert_a = True
|
2011-02-23 12:02:43 +00:00
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_showhide(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Show/Hide Faces"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("uv.reveal")
|
2012-01-14 06:30:27 +00:00
|
|
|
layout.operator("uv.hide", text="Hide Selected").unselected = False
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("uv.hide", text="Hide Unselected").unselected = True
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_transform(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Transform"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-12-10 10:36:32 +00:00
|
|
|
layout.operator("transform.translate")
|
|
|
|
layout.operator("transform.rotate")
|
|
|
|
layout.operator("transform.resize")
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2011-07-21 21:34:08 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("transform.shear")
|
|
|
|
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_snap(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Snap"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-11-26 23:20:31 +00:00
|
|
|
layout = self.layout
|
2012-07-29 12:07:06 +00:00
|
|
|
|
2009-11-26 23:20:31 +00:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS'
|
|
|
|
layout.operator("uv.snap_selected", text="Selected to Cursor").target = 'CURSOR'
|
2013-07-21 16:45:38 +00:00
|
|
|
layout.operator("uv.snap_selected", text="Selected to Cursor (Offset)").target = 'CURSOR_OFFSET'
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("uv.snap_selected", text="Selected to Adjacent Unselected").target = 'ADJACENT_UNSELECTED'
|
2009-11-26 23:20:31 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("uv.snap_cursor", text="Cursor to Pixels").target = 'PIXELS'
|
|
|
|
layout.operator("uv.snap_cursor", text="Cursor to Selected").target = 'SELECTED'
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-28 23:37:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_mirror(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Mirror"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2012-07-29 12:07:06 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.operator("mesh.faces_mirror_uv")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True
|
|
|
|
layout.operator("transform.mirror", text="Y Axis").constraint_axis[1] = True
|
2009-09-10 14:20:21 +00:00
|
|
|
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_weldalign(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Weld/Align"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.operator("uv.weld") # W, 1.
|
2012-11-13 18:29:29 +00:00
|
|
|
layout.operator("uv.remove_doubles")
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.operator_enum("uv.align", "axis") # W, 2/3/4.
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs(Menu):
|
2018-10-04 08:54:48 +10:00
|
|
|
bl_label = "UV"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
|
|
|
uv = sima.uv_editor
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.menu("IMAGE_MT_uvs_transform")
|
|
|
|
layout.menu("IMAGE_MT_uvs_mirror")
|
|
|
|
layout.menu("IMAGE_MT_uvs_snap")
|
|
|
|
|
2019-01-22 15:38:56 +01:00
|
|
|
layout.prop_menu_enum(uv, "pixel_snap_mode")
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(uv, "lock_bounds")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(uv, "use_live_unwrap")
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("uv.unwrap")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.operator("uv.pin").clear = False
|
|
|
|
layout.operator("uv.pin", text="Unpin").clear = True
|
2018-08-22 09:15:05 +10:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2015-05-14 12:48:47 +02:00
|
|
|
layout.operator("uv.mark_seam").clear = False
|
|
|
|
layout.operator("uv.mark_seam", text="Clear Seam").clear = True
|
2012-01-17 16:31:13 +00:00
|
|
|
layout.operator("uv.seams_from_islands")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.operator("uv.pack_islands")
|
|
|
|
layout.operator("uv.average_islands_scale")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.operator("uv.minimize_stretch")
|
|
|
|
layout.operator("uv.stitch")
|
|
|
|
layout.menu("IMAGE_MT_uvs_weldalign")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.menu("IMAGE_MT_uvs_showhide")
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.separator()
|
|
|
|
|
2020-04-21 14:18:58 +02:00
|
|
|
layout.operator("uv.reset")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_MT_uvs_select_mode(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "UV Select Mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# Do smart things depending on whether uv_select_sync is on.
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
if tool_settings.use_uv_select_sync:
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
|
|
|
|
props.value = "(True, False, False)"
|
|
|
|
props.data_path = "tool_settings.mesh_select_mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
|
|
|
|
props.value = "(False, True, False)"
|
|
|
|
props.data_path = "tool_settings.mesh_select_mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
|
|
|
|
props.value = "(False, False, True)"
|
|
|
|
props.data_path = "tool_settings.mesh_select_mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
|
|
|
else:
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
|
|
|
|
props.value = 'VERTEX'
|
|
|
|
props.data_path = "tool_settings.uv_select_mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
|
|
|
|
props.value = 'EDGE'
|
|
|
|
props.data_path = "tool_settings.uv_select_mode"
|
2010-10-05 15:29:06 +00:00
|
|
|
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
|
|
|
|
props.value = 'FACE'
|
|
|
|
props.data_path = "tool_settings.uv_select_mode"
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2012-01-01 13:09:58 +00:00
|
|
|
props = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
|
|
|
|
props.value = 'ISLAND'
|
|
|
|
props.data_path = "tool_settings.uv_select_mode"
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-03-12 10:59:57 +11:00
|
|
|
class IMAGE_MT_uvs_context_menu(Menu):
|
2018-06-05 09:12:19 +02:00
|
|
|
bl_label = "UV Context Menu"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
# UV Edit Mode
|
|
|
|
if sima.show_uvedit:
|
2019-03-19 13:14:35 +01:00
|
|
|
# Add
|
2018-06-05 09:12:19 +02:00
|
|
|
layout.operator("uv.unwrap")
|
|
|
|
layout.operator("uv.follow_active_quads")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
# Modify
|
2018-06-05 09:12:19 +02:00
|
|
|
layout.operator("uv.pin").clear = False
|
|
|
|
layout.operator("uv.pin", text="Unpin").clear = True
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
layout.menu("IMAGE_MT_uvs_snap")
|
2018-06-05 09:12:19 +02:00
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
layout.operator("transform.mirror", text="Mirror X").constraint_axis[0] = True
|
|
|
|
layout.operator("transform.mirror", text="Mirror Y").constraint_axis[1] = True
|
2018-06-05 09:12:19 +02:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
layout.operator_enum("uv.align", "axis") # W, 2/3/4.
|
2018-06-05 09:12:19 +02:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
# Remove
|
|
|
|
layout.operator("uv.remove_doubles", text="Remove Double UVs")
|
|
|
|
layout.operator("uv.stitch")
|
|
|
|
layout.operator("uv.weld")
|
2018-06-05 09:12:19 +02:00
|
|
|
|
|
|
|
|
2018-09-26 17:32:11 +02:00
|
|
|
class IMAGE_MT_pivot_pie(Menu):
|
|
|
|
bl_label = "Pivot Point"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
pie = layout.menu_pie()
|
|
|
|
|
|
|
|
pie.prop_enum(context.space_data, "pivot_point", value='CENTER')
|
|
|
|
pie.prop_enum(context.space_data, "pivot_point", value='CURSOR')
|
|
|
|
pie.prop_enum(context.space_data, "pivot_point", value='INDIVIDUAL_ORIGINS')
|
|
|
|
pie.prop_enum(context.space_data, "pivot_point", value='MEDIAN')
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_MT_uvs_snap_pie(Menu):
|
|
|
|
bl_label = "Snap"
|
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw(self, _context):
|
2018-09-26 17:32:11 +02:00
|
|
|
layout = self.layout
|
|
|
|
pie = layout.menu_pie()
|
|
|
|
|
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
|
|
|
|
2019-05-22 00:27:01 +10:00
|
|
|
pie.operator(
|
|
|
|
"uv.snap_selected",
|
|
|
|
text="Selected to Pixels",
|
|
|
|
icon='RESTRICT_SELECT_OFF',
|
|
|
|
).target = 'PIXELS'
|
|
|
|
pie.operator(
|
|
|
|
"uv.snap_cursor",
|
|
|
|
text="Cursor to Pixels",
|
|
|
|
icon='PIVOT_CURSOR',
|
|
|
|
).target = 'PIXELS'
|
|
|
|
pie.operator(
|
|
|
|
"uv.snap_cursor",
|
|
|
|
text="Cursor to Selected",
|
|
|
|
icon='PIVOT_CURSOR',
|
|
|
|
).target = 'SELECTED'
|
|
|
|
pie.operator(
|
|
|
|
"uv.snap_selected",
|
|
|
|
text="Selected to Cursor",
|
|
|
|
icon='RESTRICT_SELECT_OFF',
|
|
|
|
).target = 'CURSOR'
|
|
|
|
pie.operator(
|
|
|
|
"uv.snap_selected",
|
|
|
|
text="Selected to Cursor (Offset)",
|
|
|
|
icon='RESTRICT_SELECT_OFF',
|
|
|
|
).target = 'CURSOR_OFFSET'
|
|
|
|
pie.operator(
|
|
|
|
"uv.snap_selected",
|
|
|
|
text="Selected to Adjacent Unselected",
|
|
|
|
icon='RESTRICT_SELECT_OFF',
|
|
|
|
).target = 'ADJACENT_UNSELECTED'
|
2018-09-26 17:32:11 +02:00
|
|
|
|
|
|
|
|
2019-04-18 21:13:22 +02:00
|
|
|
class IMAGE_HT_tool_header(Header):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2019-05-22 00:27:01 +10:00
|
|
|
bl_region_type = 'TOOL_HEADER'
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2019-04-21 04:49:19 +10:00
|
|
|
layout.template_header()
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
self.draw_tool_settings(context)
|
|
|
|
|
|
|
|
layout.separator_spacer()
|
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
IMAGE_HT_header.draw_xform_template(layout, context)
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
layout.separator_spacer()
|
|
|
|
|
|
|
|
self.draw_mode_settings(context)
|
|
|
|
|
|
|
|
def draw_tool_settings(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
# Active Tool
|
|
|
|
# -----------
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
2019-04-18 21:13:22 +02:00
|
|
|
tool = ToolSelectPanelHelper.draw_active_tool_header(context, layout)
|
|
|
|
tool_mode = context.mode if tool is None else tool.mode
|
|
|
|
|
|
|
|
# Object Mode Options
|
|
|
|
# -------------------
|
|
|
|
|
|
|
|
# Example of how tool_settings can be accessed as pop-overs.
|
|
|
|
|
|
|
|
# TODO(campbell): editing options should be after active tool options
|
|
|
|
# (obviously separated for from the users POV)
|
|
|
|
draw_fn = getattr(_draw_tool_settings_context_mode, tool_mode, None)
|
|
|
|
if draw_fn is not None:
|
|
|
|
draw_fn(context, layout, tool)
|
|
|
|
|
|
|
|
if tool_mode == 'PAINT':
|
|
|
|
if (tool is not None) and tool.has_datablock:
|
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.popover("IMAGE_PT_paint_settings_advanced")
|
|
|
|
layout.popover("IMAGE_PT_paint_stroke")
|
|
|
|
layout.popover("IMAGE_PT_paint_curve")
|
|
|
|
layout.popover("IMAGE_PT_tools_brush_display")
|
|
|
|
layout.popover("IMAGE_PT_tools_brush_texture")
|
|
|
|
layout.popover("IMAGE_PT_tools_mask_texture")
|
2019-05-01 18:10:34 +10:00
|
|
|
elif tool_mode == 'UV':
|
|
|
|
if (tool is not None) and tool.has_datablock:
|
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.popover("IMAGE_PT_uv_sculpt_curve")
|
|
|
|
layout.popover("IMAGE_PT_uv_sculpt_options")
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
def draw_mode_settings(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
# Active Tool
|
|
|
|
# -----------
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
2019-04-18 21:13:22 +02:00
|
|
|
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
|
|
|
tool_mode = context.mode if tool is None else tool.mode
|
|
|
|
|
|
|
|
if tool_mode == 'PAINT':
|
2019-05-01 14:54:07 +10:00
|
|
|
layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".imagepaint_2d", category="")
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
class _draw_tool_settings_context_mode:
|
|
|
|
@staticmethod
|
2019-05-01 18:10:34 +10:00
|
|
|
def UV(context, layout, tool):
|
|
|
|
if tool and tool.has_datablock:
|
2019-04-18 21:13:22 +02:00
|
|
|
if context.mode == 'EDIT_MESH':
|
2019-05-01 18:10:34 +10:00
|
|
|
tool_settings = context.tool_settings
|
2019-04-18 21:13:22 +02:00
|
|
|
uv_sculpt = tool_settings.uv_sculpt
|
|
|
|
brush = uv_sculpt.brush
|
|
|
|
if brush:
|
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,
|
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",
|
2019-12-16 14:29:03 +11:00
|
|
|
slider=True,
|
2019-12-23 17:28:21 +01:00
|
|
|
header=True
|
2019-12-16 14:29:03 +11:00
|
|
|
)
|
2019-04-18 21:13:22 +02:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def PAINT(context, layout, tool):
|
|
|
|
if (tool is None) or (not tool.has_datablock):
|
|
|
|
return
|
|
|
|
|
|
|
|
paint = context.tool_settings.image_paint
|
|
|
|
layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
|
|
|
|
|
|
|
|
brush = paint.brush
|
|
|
|
if brush is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
brush_basic_texpaint_settings(layout, context, brush, compact=True)
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
@staticmethod
|
|
|
|
def draw_xform_template(layout, context):
|
|
|
|
sima = context.space_data
|
|
|
|
show_uvedit = sima.show_uvedit
|
|
|
|
show_maskedit = sima.show_maskedit
|
|
|
|
|
|
|
|
if show_uvedit or show_maskedit:
|
|
|
|
layout.prop(sima, "pivot_point", icon_only=True)
|
|
|
|
|
|
|
|
if show_uvedit:
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
|
|
# Snap.
|
2019-06-27 12:24:03 -03:00
|
|
|
snap_uv_element = tool_settings.snap_uv_element
|
|
|
|
act_snap_uv_element = tool_settings.bl_rna.properties['snap_uv_element'].enum_items[snap_uv_element]
|
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(tool_settings, "use_snap", text="")
|
2019-06-27 12:24:03 -03:00
|
|
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.popover(
|
|
|
|
panel="IMAGE_PT_snapping",
|
|
|
|
icon=act_snap_uv_element.icon,
|
|
|
|
text="",
|
|
|
|
)
|
2019-04-30 15:03:07 +10:00
|
|
|
|
|
|
|
# Proportional Editing
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(tool_settings, "use_proportional_edit", icon_only=True)
|
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.active = tool_settings.use_proportional_edit
|
2019-10-29 10:28:41 -03:00
|
|
|
sub.prop_with_popover(
|
|
|
|
tool_settings,
|
|
|
|
"proportional_edit_falloff",
|
|
|
|
text="",
|
|
|
|
icon_only=True,
|
|
|
|
panel="IMAGE_PT_proportional_edit",
|
|
|
|
)
|
2019-04-30 15:03:07 +10:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
|
|
|
iuser = sima.image_user
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
2019-04-30 15:03:07 +10:00
|
|
|
show_region_tool_header = sima.show_region_tool_header
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-04-01 12:53:38 +00:00
|
|
|
show_render = sima.show_render
|
2009-10-31 19:31:45 +00:00
|
|
|
show_uvedit = sima.show_uvedit
|
2012-08-01 10:50:39 +00:00
|
|
|
show_maskedit = sima.show_maskedit
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
if not show_region_tool_header:
|
2019-04-21 04:49:19 +10:00
|
|
|
layout.template_header()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-12-05 14:35:45 +11:00
|
|
|
if sima.mode != 'UV':
|
|
|
|
layout.prop(sima, "ui_mode", text="")
|
2018-05-01 18:47:26 +02:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# UV editing.
|
2018-06-28 17:54:59 +02:00
|
|
|
if show_uvedit:
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
layout.prop(tool_settings, "use_uv_select_sync", text="")
|
2018-06-28 17:54:59 +02:00
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
if tool_settings.use_uv_select_sync:
|
2018-06-28 17:54:59 +02:00
|
|
|
layout.template_edit_mode_selection()
|
|
|
|
else:
|
2018-12-17 17:20:24 +11:00
|
|
|
layout.prop(tool_settings, "uv_select_mode", text="", expand=True)
|
2018-06-28 17:54:59 +02:00
|
|
|
layout.prop(uvedit, "sticky_select_mode", icon_only=True)
|
|
|
|
|
2020-04-09 22:55:47 +10:00
|
|
|
IMAGE_MT_editor_menus.draw_collapsible(context, layout)
|
2018-06-28 08:27:03 +02:00
|
|
|
|
|
|
|
layout.separator_spacer()
|
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
if not show_region_tool_header:
|
|
|
|
IMAGE_HT_header.draw_xform_template(layout, context)
|
|
|
|
|
2013-10-10 23:33:59 +00:00
|
|
|
layout.template_ID(sima, "image", new="image.new", open="image.open")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-08-06 12:12:45 +00:00
|
|
|
if show_maskedit:
|
|
|
|
row = layout.row()
|
|
|
|
row.template_ID(sima, "mask", new="mask.new")
|
|
|
|
|
2018-07-02 14:46:36 +02:00
|
|
|
if not show_render:
|
2019-05-24 14:46:37 +02:00
|
|
|
layout.prop(sima, "use_image_pin", text="", emboss=False)
|
2018-06-11 16:57:35 +02:00
|
|
|
|
2018-10-08 19:10:10 +02:00
|
|
|
layout.separator_spacer()
|
|
|
|
|
2018-06-11 16:57:35 +02:00
|
|
|
if show_uvedit:
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
|
|
|
mesh = context.edit_object.data
|
|
|
|
layout.prop_search(mesh.uv_layers, "active", mesh, "uv_layers", text="")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if ima:
|
2015-04-06 10:40:12 -03:00
|
|
|
if ima.is_stereo_3d:
|
|
|
|
row = layout.row()
|
|
|
|
row.prop(sima, "show_stereo_3d", text="")
|
2019-06-27 18:27:47 +02:00
|
|
|
if show_maskedit:
|
|
|
|
row = layout.row()
|
|
|
|
row.popover(panel='CLIP_PT_mask_display')
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# layers.
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_image_layers(ima, iuser)
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# draw options.
|
|
|
|
row = layout.row()
|
2018-09-03 18:58:41 +02:00
|
|
|
row.prop(sima, "display_channels", icon_only=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
if ima.type == 'COMPOSITE':
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("image.record_composite", icon='REC')
|
2011-03-07 13:23:45 +00:00
|
|
|
if ima.type == 'COMPOSITE' and ima.source in {'MOVIE', 'SEQUENCE'}:
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("image.play_composite", icon='PLAY')
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2020-04-09 22:55:47 +10:00
|
|
|
class IMAGE_MT_editor_menus(Menu):
|
|
|
|
bl_idname = "IMAGE_MT_editor_menus"
|
2014-01-27 18:38:53 +11:00
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
def draw(self, context):
|
2018-12-20 12:02:21 +11:00
|
|
|
layout = self.layout
|
2014-01-27 18:38:53 +11:00
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
|
|
|
|
|
|
|
show_uvedit = sima.show_uvedit
|
|
|
|
show_maskedit = sima.show_maskedit
|
|
|
|
|
|
|
|
layout.menu("IMAGE_MT_view")
|
|
|
|
|
|
|
|
if show_uvedit:
|
|
|
|
layout.menu("IMAGE_MT_select")
|
|
|
|
if show_maskedit:
|
|
|
|
layout.menu("MASK_MT_select")
|
|
|
|
|
|
|
|
if ima and ima.is_dirty:
|
|
|
|
layout.menu("IMAGE_MT_image", text="Image*")
|
|
|
|
else:
|
|
|
|
layout.menu("IMAGE_MT_image", text="Image")
|
|
|
|
|
|
|
|
if show_uvedit:
|
|
|
|
layout.menu("IMAGE_MT_uvs")
|
|
|
|
if show_maskedit:
|
2018-10-22 18:08:19 +11:00
|
|
|
layout.menu("MASK_MT_add")
|
2014-01-27 18:38:53 +11:00
|
|
|
layout.menu("MASK_MT_mask")
|
|
|
|
|
|
|
|
|
2019-06-27 18:27:47 +02:00
|
|
|
class IMAGE_MT_mask_context_menu(Menu):
|
|
|
|
bl_label = "Mask Context Menu"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
2019-12-16 16:44:03 +11:00
|
|
|
return sima.show_maskedit
|
2019-06-27 18:27:47 +02:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2019-12-16 16:44:03 +11:00
|
|
|
from .properties_mask_common import draw_mask_context_menu
|
|
|
|
draw_mask_context_menu(layout, context)
|
2019-06-27 18:27:47 +02:00
|
|
|
|
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
# -----------------------------------------------------------------------------
|
|
|
|
# Mask (similar code in space_clip.py, keep in sync)
|
2018-08-22 09:15:05 +10:00
|
|
|
# note! - panel placement does _not_ fit well with image panels... need to fix.
|
2014-02-13 19:49:26 +02:00
|
|
|
|
2019-06-11 16:08:32 +10:00
|
|
|
from bl_ui.properties_mask_common import (
|
2017-10-21 12:41:42 +11:00
|
|
|
MASK_PT_mask,
|
|
|
|
MASK_PT_layers,
|
|
|
|
MASK_PT_spline,
|
|
|
|
MASK_PT_point,
|
|
|
|
MASK_PT_display,
|
|
|
|
)
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_mask(MASK_PT_mask, Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-06-27 18:27:47 +02:00
|
|
|
bl_category = "Mask"
|
2014-02-13 19:49:26 +02:00
|
|
|
|
2014-02-22 11:14:15 +11:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
class IMAGE_PT_mask_layers(MASK_PT_layers, Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-06-27 18:27:47 +02:00
|
|
|
bl_category = "Mask"
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_active_mask_spline(MASK_PT_spline, Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-06-27 18:27:47 +02:00
|
|
|
bl_category = "Mask"
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_active_mask_point(MASK_PT_point, Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-06-27 18:27:47 +02:00
|
|
|
bl_category = "Mask"
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
2017-12-07 14:44:10 +01:00
|
|
|
# --- end mask ---
|
|
|
|
|
2019-06-27 12:24:03 -03:00
|
|
|
class IMAGE_PT_snapping(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Snapping"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
col = layout.column()
|
|
|
|
col.label(text="Snapping")
|
|
|
|
col.prop(tool_settings, "snap_uv_element", expand=True)
|
|
|
|
|
|
|
|
if tool_settings.snap_uv_element != 'INCREMENT':
|
|
|
|
col.label(text="Target")
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(tool_settings, "snap_target", expand=True)
|
|
|
|
|
|
|
|
col.label(text="Affect")
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(tool_settings, "use_snap_translate", text="Move", toggle=True)
|
|
|
|
row.prop(tool_settings, "use_snap_rotate", text="Rotate", toggle=True)
|
|
|
|
row.prop(tool_settings, "use_snap_scale", text="Scale", toggle=True)
|
|
|
|
|
2017-12-07 14:44:10 +01:00
|
|
|
|
2019-10-29 10:28:41 -03:00
|
|
|
class IMAGE_PT_proportional_edit(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
bl_label = "Proportional Editing"
|
|
|
|
bl_ui_units_x = 8
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col.prop(tool_settings, "use_proportional_connected")
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.prop(tool_settings, "proportional_edit_falloff", expand=True)
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class IMAGE_PT_image_properties(Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2018-11-21 22:02:01 +01:00
|
|
|
bl_category = "Image"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Image"
|
2009-09-16 19:27:08 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
|
|
|
return (sima.image)
|
2009-09-16 19:27:08 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-09-16 19:27:08 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
|
|
|
iuser = sima.image_user
|
2009-09-16 19:27:08 +00:00
|
|
|
|
2015-06-13 14:04:39 -03:00
|
|
|
layout.template_image(sima, "image", iuser, multiview=True)
|
2009-09-16 19:27:08 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
class IMAGE_PT_view_display(Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_region_type = 'UI'
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Display"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "View"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-10-31 19:31:45 +00:00
|
|
|
sima = context.space_data
|
|
|
|
return (sima and (sima.image or sima.show_uvedit))
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
2015-04-06 17:06:37 +10:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
show_uvedit = sima.show_uvedit
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
col = layout.column()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if ima:
|
2011-09-21 15:18:38 +00:00
|
|
|
col.prop(ima, "display_aspect", text="Aspect Ratio")
|
2018-08-22 09:15:05 +10:00
|
|
|
col.prop(sima, "show_repeat", text="Repeat Image")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-08-06 12:12:45 +00:00
|
|
|
if show_uvedit:
|
2018-08-22 09:15:05 +10:00
|
|
|
col.prop(uvedit, "show_pixel_coords", text="Pixel Coordinates")
|
2010-03-30 05:52:05 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
class IMAGE_PT_view_display_uv_edit_overlays(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_region_type = 'UI'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_label = "Overlays"
|
|
|
|
bl_parent_id = 'IMAGE_PT_view_display'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "View"
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2011-08-22 09:01:49 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
return (sima and (sima.show_uvedit))
|
2009-11-21 00:05:43 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
2019-05-01 12:35:00 +10:00
|
|
|
layout.use_property_decorate = False
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
sima = context.space_data
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
2019-05-03 10:26:24 +02:00
|
|
|
col.prop(uvedit, "edge_display_type", text="Display As")
|
2018-08-22 09:15:05 +10:00
|
|
|
col.prop(uvedit, "show_faces", text="Faces")
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(uvedit, "show_smooth_edges", text="Smooth")
|
|
|
|
col.prop(uvedit, "show_modified_edges", text="Modified")
|
2020-04-16 18:10:21 +10:00
|
|
|
col.prop(uvedit, "uv_opacity")
|
2018-08-22 09:15:05 +10:00
|
|
|
|
|
|
|
|
2019-05-03 10:26:24 +02:00
|
|
|
class IMAGE_PT_view_display_uv_edit_overlays_stretch(Panel):
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-05-03 10:26:24 +02:00
|
|
|
bl_label = "Stretching"
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_parent_id = 'IMAGE_PT_view_display_uv_edit_overlays'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "View"
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
return (sima and (sima.show_uvedit))
|
|
|
|
|
2019-05-03 10:26:24 +02:00
|
|
|
def draw_header(self, context):
|
|
|
|
sima = context.space_data
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
self.layout.prop(uvedit, "show_stretch", text="")
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
2019-05-03 10:26:24 +02:00
|
|
|
layout.active = uvedit.show_stretch
|
|
|
|
layout.prop(uvedit, "display_stretch_type", text="Type")
|
2016-10-17 14:28:16 +02:00
|
|
|
|
2018-06-14 22:46:30 +02:00
|
|
|
|
|
|
|
class IMAGE_UL_render_slots(UIList):
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index):
|
2018-06-14 22:46:30 +02:00
|
|
|
slot = item
|
|
|
|
layout.prop(slot, "name", text="", emboss=False)
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_render_slots(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2018-11-21 22:02:01 +01:00
|
|
|
bl_category = "Image"
|
2018-06-14 22:46:30 +02:00
|
|
|
bl_label = "Render Slots"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
return (sima and sima.image and sima.show_render)
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
|
|
|
|
col = row.column()
|
2018-08-22 09:15:05 +10:00
|
|
|
col.template_list(
|
|
|
|
"IMAGE_UL_render_slots", "render_slots", ima,
|
2019-06-21 08:36:03 +10:00
|
|
|
"render_slots", ima.render_slots, "active_index", rows=3,
|
2018-08-22 09:15:05 +10:00
|
|
|
)
|
2018-06-14 22:46:30 +02:00
|
|
|
|
|
|
|
col = row.column(align=True)
|
2018-10-01 10:45:50 +02:00
|
|
|
col.operator("image.add_render_slot", icon='ADD', text="")
|
|
|
|
col.operator("image.remove_render_slot", icon='REMOVE', text="")
|
2018-06-14 22:46:30 +02:00
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.operator("image.clear_render_slot", icon='X', text="")
|
2014-10-09 11:15:47 +02:00
|
|
|
|
2009-11-21 00:05:43 +00:00
|
|
|
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
class IMAGE_UL_udim_tiles(UIList):
|
2019-12-16 14:29:03 +11:00
|
|
|
def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index):
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
tile = item
|
|
|
|
layout.prop(tile, "label", text="", emboss=False)
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_udim_tiles(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
|
|
|
bl_category = "Image"
|
|
|
|
bl_label = "UDIM Tiles"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
return (sima and sima.image and sima.image.source == 'TILED')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
ima = sima.image
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
col = row.column()
|
|
|
|
col.template_list("IMAGE_UL_udim_tiles", "", ima, "tiles", ima.tiles, "active_index", rows=4)
|
|
|
|
|
|
|
|
col = row.column()
|
|
|
|
sub = col.column(align=True)
|
|
|
|
sub.operator("image.tile_add", icon='ADD', text="")
|
|
|
|
sub.operator("image.tile_remove", icon='REMOVE', text="")
|
|
|
|
|
|
|
|
tile = ima.tiles.active
|
|
|
|
if tile:
|
|
|
|
col = layout.column(align=True)
|
|
|
|
col.operator("image.tile_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
|
|
|
class IMAGE_PT_paint_select(Panel, ImagePaintPanel, BrushSelectPanel):
|
|
|
|
bl_label = "Brushes"
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".paint_common_2d"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_settings(Panel, ImagePaintPanel):
|
|
|
|
bl_context = ".paint_common_2d"
|
|
|
|
bl_category = "Tool"
|
|
|
|
bl_label = "Brush Settings"
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2019-03-19 18:17:50 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
2014-07-21 12:02:05 +02:00
|
|
|
settings = context.tool_settings.image_paint
|
|
|
|
brush = settings.brush
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if brush:
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_settings(layout.column(), context, brush, popover=self.is_popover)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2016-02-01 00:47:10 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_settings_advanced(Panel, ImagePaintPanel):
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-12-16 16:31:58 +01:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Advanced"
|
2019-03-19 18:17:50 +01: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
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False # No animation.
|
2019-03-19 18:17:50 +01:00
|
|
|
|
|
|
|
settings = context.tool_settings.image_paint
|
|
|
|
brush = settings.brush
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
brush_settings_advanced(layout.column(), context, brush, self.is_popover)
|
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 IMAGE_PT_paint_color(Panel, ImagePaintPanel):
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Color Picker"
|
2019-03-19 18:17:50 +01:00
|
|
|
|
|
|
|
@classmethod
|
2019-04-19 07:36:07 +02:00
|
|
|
def poll(cls, context):
|
2019-03-19 18:17:50 +01:00
|
|
|
settings = context.tool_settings.image_paint
|
|
|
|
brush = settings.brush
|
|
|
|
capabilities = brush.image_paint_capabilities
|
|
|
|
|
|
|
|
return capabilities.has_color
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
settings = context.tool_settings.image_paint
|
|
|
|
brush = settings.brush
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
draw_color_settings(context, layout, brush, color_type=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 IMAGE_PT_paint_swatches(Panel, ImagePaintPanel, ColorPalettePanel):
|
|
|
|
bl_category = "Tool"
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
|
|
|
bl_label = "Color Palette"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2010-07-22 05:59:50 +00:00
|
|
|
|
2013-11-20 03:38:18 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_clone(Panel, ImagePaintPanel, ClonePanel):
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_context = ".paint_common_2d"
|
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
|
|
|
bl_label = "Clone from Image/UV Map"
|
2019-03-19 19:03:51 +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 IMAGE_PT_tools_brush_display(Panel, BrushButtonsPanel, DisplayPanel):
|
|
|
|
bl_context = ".paint_common_2d"
|
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brush Tip"
|
2019-03-19 19:03:51 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
|
|
|
|
bl_label = "Texture"
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2013-10-09 14:57:48 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings.image_paint
|
|
|
|
brush = tool_settings.brush
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
|
|
|
|
|
|
|
|
brush_texture_settings(col, brush, 0)
|
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_tools_mask_texture(Panel, BrushButtonsPanel, TextureMaskPanel):
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Texture Mask"
|
2013-04-30 06:07:42 +00:00
|
|
|
|
2013-03-25 01:00:16 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel, StrokePanel):
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_label = "Stroke"
|
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-03-30 11:40:09 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_stroke_smooth_stroke(Panel, BrushButtonsPanel, SmoothStrokePanel):
|
|
|
|
bl_context = ".paint_common_2d"
|
|
|
|
bl_label = "Stabilize Stroke"
|
2019-03-19 18:39:08 +01:00
|
|
|
bl_parent_id = "IMAGE_PT_paint_stroke"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2019-03-19 18:39:08 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2014-01-20 15:01:33 +01:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel, FalloffPanel):
|
2019-03-19 18:17:50 +01:00
|
|
|
bl_label = "Falloff"
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".paint_common_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
|
|
|
bl_parent_id = "IMAGE_PT_paint_settings"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-01-17 16:31:13 +00:00
|
|
|
|
2015-08-28 15:33:01 +10:00
|
|
|
class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel):
|
2018-10-25 11:13:22 +11:00
|
|
|
bl_context = ".imagepaint_2d"
|
2015-07-27 12:55:40 +02:00
|
|
|
bl_label = "Tiling"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
2015-07-27 12:55:40 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
ipaint = tool_settings.image_paint
|
2015-07-27 12:55:40 +02:00
|
|
|
|
|
|
|
col = layout.column(align=True)
|
|
|
|
row = col.row(align=True)
|
|
|
|
row.prop(ipaint, "tile_x", text="X", toggle=True)
|
|
|
|
row.prop(ipaint, "tile_y", text="Y", toggle=True)
|
2015-09-01 03:51:50 +10:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class UVSculptPanel(UnifiedPaintPanel):
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
return cls.get_brush_mode(context) == 'UV_SCULPT'
|
2015-07-27 12:55:40 +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 IMAGE_PT_uv_sculpt_brush_select(Panel, BrushSelectPanel, ImagePaintPanel, UVSculptPanel):
|
|
|
|
bl_context = ".uv_sculpt"
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "Tool"
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_label = "Brushes"
|
2012-01-17 16:31:13 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
|
|
|
|
class IMAGE_PT_uv_sculpt_brush_settings(Panel, ImagePaintPanel, UVSculptPanel):
|
|
|
|
bl_context = ".uv_sculpt"
|
|
|
|
bl_category = "Tool"
|
|
|
|
bl_label = "Brush Settings"
|
2012-01-17 16:31:13 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
|
|
|
uvsculpt = tool_settings.uv_sculpt
|
2012-01-17 16:31:13 +00:00
|
|
|
|
2012-01-17 18:32:14 +00:00
|
|
|
brush = uvsculpt.brush
|
2012-01-17 16:31:13 +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
|
|
|
brush_settings(layout.column(), context, brush)
|
2012-01-17 17:57:20 +00:00
|
|
|
|
2019-05-01 18:10:34 +10:00
|
|
|
if brush:
|
|
|
|
if brush.uv_sculpt_tool == 'RELAX':
|
2019-12-16 14:29:03 +11:00
|
|
|
# Although this settings is stored in the scene,
|
|
|
|
# it is only used by a single tool,
|
|
|
|
# so it doesn't make sense from a user perspective to move it to the Options panel.
|
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.prop(tool_settings, "uv_relax_method")
|
2014-09-25 15:34:59 +02:00
|
|
|
|
2012-01-17 16:31:13 +00:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_uv_sculpt_curve(Panel, FalloffPanel, ImagePaintPanel, UVSculptPanel):
|
2019-05-01 18:10:34 +10:00
|
|
|
bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
bl_parent_id = "IMAGE_PT_uv_sculpt_brush_settings"
|
2019-05-01 18:10:34 +10:00
|
|
|
bl_category = "Tool"
|
|
|
|
bl_label = "Falloff"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
class IMAGE_PT_uv_sculpt_options(Panel, ImagePaintPanel, UVSculptPanel):
|
|
|
|
bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
|
|
|
|
bl_category = "Tool"
|
|
|
|
bl_label = "Options"
|
2019-05-01 18:10:34 +10:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
uvsculpt = tool_settings.uv_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
|
|
|
col = layout.column()
|
|
|
|
col.prop(tool_settings, "uv_sculpt_lock_borders")
|
|
|
|
col.prop(tool_settings, "uv_sculpt_all_islands")
|
|
|
|
col.prop(uvsculpt, "show_brush", text="Display Cursor")
|
2019-05-01 18:10:34 +10:00
|
|
|
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class ImageScopesPanel:
|
2015-01-12 14:21:23 +01:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
if not (sima and sima.image):
|
|
|
|
return False
|
2018-08-22 09:15:05 +10:00
|
|
|
|
|
|
|
# scopes are not updated in paint modes, hide.
|
2015-04-14 10:29:11 +10:00
|
|
|
if sima.mode == 'PAINT':
|
2015-01-12 14:21:23 +01:00
|
|
|
return False
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
ob = context.active_object
|
2018-04-05 18:20:27 +02:00
|
|
|
if ob and ob.mode in {'TEXTURE_PAINT', 'EDIT'}:
|
2015-01-12 14:21:23 +01:00
|
|
|
return False
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
return True
|
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
class IMAGE_PT_view_histogram(ImageScopesPanel, Panel):
|
2012-07-25 13:44:07 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-01-24 14:36:52 +01:00
|
|
|
bl_category = "Scopes"
|
2014-02-13 19:49:26 +02:00
|
|
|
bl_label = "Histogram"
|
2012-07-25 13:44:07 +00:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
hist = sima.scopes.histogram
|
|
|
|
|
|
|
|
layout.template_histogram(sima.scopes, "histogram")
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(hist, "mode", expand=True)
|
|
|
|
row.prop(hist, "show_line", text="")
|
|
|
|
|
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
class IMAGE_PT_view_waveform(ImageScopesPanel, Panel):
|
2012-07-25 13:44:07 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-01-24 14:36:52 +01:00
|
|
|
bl_category = "Scopes"
|
2014-02-13 19:49:26 +02:00
|
|
|
bl_label = "Waveform"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2012-07-25 13:44:07 +00:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
layout.template_waveform(sima, "scopes")
|
2018-08-28 12:38:54 +10:00
|
|
|
row = layout.split(factor=0.75)
|
2014-02-13 19:49:26 +02:00
|
|
|
row.prop(sima.scopes, "waveform_alpha")
|
2014-09-03 12:44:34 +06:00
|
|
|
row.prop(sima.scopes, "waveform_mode", text="")
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
class IMAGE_PT_view_vectorscope(ImageScopesPanel, Panel):
|
2012-07-25 13:44:07 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-01-24 14:36:52 +01:00
|
|
|
bl_category = "Scopes"
|
2014-02-13 19:49:26 +02:00
|
|
|
bl_label = "Vectorscope"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2012-07-25 13:44:07 +00:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
sima = context.space_data
|
|
|
|
layout.template_vectorscope(sima, "scopes")
|
|
|
|
layout.prop(sima.scopes, "vectorscope_alpha")
|
|
|
|
|
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
class IMAGE_PT_sample_line(ImageScopesPanel, Panel):
|
2012-07-25 13:44:07 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-01-24 14:36:52 +01:00
|
|
|
bl_category = "Scopes"
|
2014-02-13 19:49:26 +02:00
|
|
|
bl_label = "Sample Line"
|
2012-07-25 13:44:07 +00:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
hist = sima.sample_histogram
|
|
|
|
|
|
|
|
layout.operator("image.sample_line")
|
|
|
|
layout.template_histogram(sima, "sample_histogram")
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(hist, "mode", expand=True)
|
|
|
|
row.prop(hist, "show_line", text="")
|
|
|
|
|
|
|
|
|
2015-01-12 14:21:23 +01:00
|
|
|
class IMAGE_PT_scope_sample(ImageScopesPanel, Panel):
|
2012-07-25 13:44:07 +00:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_region_type = 'UI'
|
2019-01-24 14:36:52 +01:00
|
|
|
bl_category = "Scopes"
|
2018-08-22 09:15:05 +10:00
|
|
|
bl_label = "Samples"
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2012-07-25 13:44:07 +00:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.use_property_split = True
|
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
col = flow.column()
|
|
|
|
col.prop(sima.scopes, "use_full_resolution")
|
|
|
|
|
|
|
|
col = flow.column()
|
|
|
|
col.active = not sima.scopes.use_full_resolution
|
|
|
|
col.prop(sima.scopes, "accuracy")
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
2019-03-11 16:37:57 +01:00
|
|
|
class IMAGE_PT_uv_cursor(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "View"
|
2019-03-12 08:08:48 +11:00
|
|
|
bl_label = "2D Cursor"
|
2019-03-11 16:37:57 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
|
2019-03-12 08:08:48 +11:00
|
|
|
return (sima and (sima.show_uvedit or sima.show_maskedit))
|
2019-03-11 16:37:57 +01:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(sima, "cursor_location", text="Cursor Location")
|
|
|
|
|
|
|
|
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
class IMAGE_PT_udim_grid(Panel):
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
|
|
|
bl_category = "View"
|
|
|
|
bl_label = "UDIM Grid"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
return sima.show_uvedit and sima.image is None
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
col.prop(uvedit, "tile_grid_shape", text="Grid Shape")
|
|
|
|
|
|
|
|
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
# Grease Pencil properties
|
2019-07-29 12:39:19 +02:00
|
|
|
class IMAGE_PT_annotation(AnnotationDataPanel, Panel):
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
bl_region_type = 'UI'
|
2019-05-01 12:35:00 +10:00
|
|
|
bl_category = "View"
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# NOTE: this is just a wrapper around the generic GP Panel.
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
# Grease Pencil drawing tools.
|
2018-07-31 21:06:08 +10:00
|
|
|
|
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_MT_view,
|
2018-08-22 09:15:05 +10:00
|
|
|
IMAGE_MT_view_zoom,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_MT_select,
|
2017-03-18 20:03:24 +11:00
|
|
|
IMAGE_MT_image,
|
|
|
|
IMAGE_MT_image_invert,
|
|
|
|
IMAGE_MT_uvs,
|
|
|
|
IMAGE_MT_uvs_showhide,
|
|
|
|
IMAGE_MT_uvs_transform,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_MT_uvs_snap,
|
|
|
|
IMAGE_MT_uvs_mirror,
|
2017-03-18 20:03:24 +11:00
|
|
|
IMAGE_MT_uvs_weldalign,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_MT_uvs_select_mode,
|
2019-03-12 10:59:57 +11:00
|
|
|
IMAGE_MT_uvs_context_menu,
|
2019-06-27 18:27:47 +02:00
|
|
|
IMAGE_MT_mask_context_menu,
|
2018-09-26 17:32:11 +02:00
|
|
|
IMAGE_MT_pivot_pie,
|
|
|
|
IMAGE_MT_uvs_snap_pie,
|
2019-04-18 21:13:22 +02:00
|
|
|
IMAGE_HT_tool_header,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_HT_header,
|
2020-04-09 22:55:47 +10:00
|
|
|
IMAGE_MT_editor_menus,
|
2019-05-01 12:35:00 +10:00
|
|
|
IMAGE_PT_active_tool,
|
2017-03-18 20:03:24 +11:00
|
|
|
IMAGE_PT_mask,
|
|
|
|
IMAGE_PT_mask_layers,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_active_mask_spline,
|
|
|
|
IMAGE_PT_active_mask_point,
|
2019-06-27 12:24:03 -03:00
|
|
|
IMAGE_PT_snapping,
|
2019-10-29 10:28:41 -03:00
|
|
|
IMAGE_PT_proportional_edit,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_image_properties,
|
2018-06-14 22:46:30 +02:00
|
|
|
IMAGE_UL_render_slots,
|
|
|
|
IMAGE_PT_render_slots,
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
IMAGE_UL_udim_tiles,
|
|
|
|
IMAGE_PT_udim_tiles,
|
2018-08-22 09:15:05 +10:00
|
|
|
IMAGE_PT_view_display,
|
|
|
|
IMAGE_PT_view_display_uv_edit_overlays,
|
2019-05-03 10:26:24 +02:00
|
|
|
IMAGE_PT_view_display_uv_edit_overlays_stretch,
|
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
|
|
|
IMAGE_PT_paint_select,
|
|
|
|
IMAGE_PT_paint_settings,
|
2019-03-19 18:17:50 +01:00
|
|
|
IMAGE_PT_paint_color,
|
|
|
|
IMAGE_PT_paint_swatches,
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
IMAGE_PT_paint_settings_advanced,
|
2019-03-19 18:17:50 +01:00
|
|
|
IMAGE_PT_paint_clone,
|
2017-03-18 20:03:24 +11:00
|
|
|
IMAGE_PT_tools_brush_texture,
|
|
|
|
IMAGE_PT_tools_mask_texture,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_paint_stroke,
|
2019-03-19 18:39:08 +01:00
|
|
|
IMAGE_PT_paint_stroke_smooth_stroke,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_paint_curve,
|
2019-03-19 18:17:50 +01:00
|
|
|
IMAGE_PT_tools_brush_display,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_tools_imagepaint_symmetry,
|
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
|
|
|
IMAGE_PT_uv_sculpt_brush_select,
|
|
|
|
IMAGE_PT_uv_sculpt_brush_settings,
|
|
|
|
IMAGE_PT_uv_sculpt_options,
|
2017-09-01 00:57:36 +10:00
|
|
|
IMAGE_PT_uv_sculpt_curve,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_view_histogram,
|
|
|
|
IMAGE_PT_view_waveform,
|
|
|
|
IMAGE_PT_view_vectorscope,
|
|
|
|
IMAGE_PT_sample_line,
|
|
|
|
IMAGE_PT_scope_sample,
|
2019-03-11 16:37:57 +01:00
|
|
|
IMAGE_PT_uv_cursor,
|
2019-07-29 12:39:19 +02:00
|
|
|
IMAGE_PT_annotation,
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
IMAGE_PT_udim_grid,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|