2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
from bpy.types import (
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
AssetShelf,
|
2018-08-22 09:15:05 +10:00
|
|
|
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,
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
BrushAssetShelf,
|
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,
|
|
|
|
|
)
|
|
|
|
|
|
2022-08-22 14:30:32 +02:00
|
|
|
from bpy.app.translations import (
|
|
|
|
|
contexts as i18n_contexts,
|
2024-07-26 14:59:13 +02:00
|
|
|
pgettext_iface as iface_,
|
2022-08-22 14:30:32 +02:00
|
|
|
)
|
2013-02-10 08:54:10 +00:00
|
|
|
|
2022-08-23 22:55:05 +10:00
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
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
|
2024-09-11 13:30:40 +02:00
|
|
|
show_maskedit = sima.show_maskedit
|
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")
|
2024-04-24 17:55:37 +02:00
|
|
|
layout.prop(sima, "show_region_asset_shelf")
|
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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2024-09-11 13:30:40 +02:00
|
|
|
if show_uvedit or show_maskedit:
|
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-10-01 20:19:44 +10:00
|
|
|
layout.operator("image.view_center_cursor", text="Center View to Cursor")
|
|
|
|
|
|
2024-04-26 21:35:49 +02:00
|
|
|
layout.menu("IMAGE_MT_view_zoom")
|
|
|
|
|
|
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()
|
|
|
|
|
|
2024-04-26 21:35:49 +02:00
|
|
|
if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'):
|
|
|
|
|
layout.prop(tool_settings, "show_uv_local_view", text="Show Same Material")
|
|
|
|
|
|
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):
|
2024-04-26 21:35:49 +02:00
|
|
|
bl_label = "Zoom"
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2024-04-27 14:54:14 +10:00
|
|
|
def draw(self, context):
|
2018-08-22 09:15:05 +10:00
|
|
|
layout = self.layout
|
2024-04-26 21:35:49 +02:00
|
|
|
from math import isclose
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2024-04-27 14:54:14 +10:00
|
|
|
current_zoom = context.space_data.zoom_percentage
|
2018-08-22 09:15:05 +10:00
|
|
|
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
|
|
|
|
|
|
2024-04-27 14:54:14 +10:00
|
|
|
for (a, b) in ratios:
|
|
|
|
|
ratio = a / b
|
|
|
|
|
percent = ratio * 100.0
|
2018-08-22 09:15:05 +10:00
|
|
|
layout.operator(
|
|
|
|
|
"image.view_zoom_ratio",
|
2024-04-27 16:02:36 +10:00
|
|
|
text="{:g}% ({:d}:{:d})".format(percent, a, b),
|
2018-08-22 09:15:05 +10:00
|
|
|
translate=False,
|
2024-04-27 14:54:14 +10:00
|
|
|
icon='LAYER_ACTIVE' if isclose(percent, current_zoom, abs_tol=0.5) else 'NONE',
|
|
|
|
|
).ratio = ratio
|
2018-08-22 09:15:05 +10:00
|
|
|
|
2024-04-26 21:35:49 +02:00
|
|
|
layout.separator()
|
|
|
|
|
layout.operator("image.view_zoom_in")
|
|
|
|
|
layout.operator("image.view_zoom_out")
|
|
|
|
|
layout.operator("image.view_all", text="Zoom to Fit").fit_view = True
|
|
|
|
|
layout.operator("image.view_zoom_border", text="Zoom Region...")
|
|
|
|
|
|
2018-08-22 09:15:05 +10:00
|
|
|
|
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")
|
2024-05-13 16:27:23 +02:00
|
|
|
layout.operator_menu_enum("uv.select_lasso", "mode", text="Lasso Select")
|
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_more", text="More")
|
2024-05-13 16:27:23 +02:00
|
|
|
layout.operator("uv.select_less", text="Less")
|
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
|
|
|
|
2024-05-13 16:27:23 +02:00
|
|
|
layout.operator_menu_enum("uv.select_similar", "type", text="Select Similar")
|
2020-07-10 16:07:31 -04:00
|
|
|
layout.menu("IMAGE_MT_select_linked")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2012-08-09 22:43:10 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
2024-05-13 16:27:23 +02:00
|
|
|
layout.operator("uv.select_pinned", text="Select Pinned")
|
2012-08-09 22:43:10 +00:00
|
|
|
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
|
|
|
|
2020-07-10 16:07:31 -04:00
|
|
|
class IMAGE_MT_select_linked(Menu):
|
|
|
|
|
bl_label = "Select Linked"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.operator("uv.select_linked", text="Linked")
|
2020-07-11 22:03:27 +10:00
|
|
|
layout.operator("uv.shortest_path_select", text="Shortest Path")
|
2020-07-10 16:07:31 -04: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):
|
2023-04-14 03:48:17 +02:00
|
|
|
import sys
|
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
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
|
|
|
|
2024-09-12 16:37:08 +02:00
|
|
|
layout.operator("image.new", text="New...", text_ctxt=i18n_contexts.id_image, icon='FILE_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
|
|
|
|
2024-03-12 17:34:03 +11:00
|
|
|
has_image_clipboard = False
|
2024-10-29 18:07:51 +11:00
|
|
|
if (sys.platform[:3] == "win") or (sys.platform == "darwin"):
|
2024-03-12 17:34:03 +11:00
|
|
|
has_image_clipboard = True
|
|
|
|
|
else:
|
|
|
|
|
from _bpy import _ghost_backend
|
|
|
|
|
if _ghost_backend() == 'WAYLAND':
|
|
|
|
|
has_image_clipboard = True
|
|
|
|
|
del _ghost_backend
|
|
|
|
|
|
|
|
|
|
if has_image_clipboard:
|
2023-04-14 03:48:17 +02:00
|
|
|
layout.operator("image.clipboard_copy", text="Copy")
|
|
|
|
|
layout.operator("image.clipboard_paste", text="Paste")
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
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")
|
2024-01-31 23:36:28 +01:00
|
|
|
layout.menu("IMAGE_MT_image_transform")
|
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
|
|
|
|
2021-04-16 15:39:08 +02:00
|
|
|
if ima and context.area.ui_type == 'IMAGE_EDITOR':
|
2020-03-09 16:27:24 +01:00
|
|
|
layout.separator()
|
|
|
|
|
layout.operator("palette.extract_from_image", text="Extract Palette")
|
|
|
|
|
|
2021-04-16 15:39:08 +02:00
|
|
|
|
2024-01-31 23:36:28 +01:00
|
|
|
class IMAGE_MT_image_transform(Menu):
|
|
|
|
|
bl_label = "Transform"
|
2021-02-04 18:03:42 +01:00
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
2024-01-31 23:36:28 +01:00
|
|
|
layout.operator("image.flip", text="Flip Horizontally").use_flip_x = True
|
|
|
|
|
layout.operator("image.flip", text="Flip Vertically").use_flip_y = True
|
|
|
|
|
layout.separator()
|
|
|
|
|
layout.operator("image.rotate_orthogonal", text="Rotate 90\u00B0 Clockwise").degrees = '90'
|
|
|
|
|
layout.operator("image.rotate_orthogonal", text="Rotate 90\u00B0 Counter-Clockwise").degrees = '270'
|
|
|
|
|
layout.operator("image.rotate_orthogonal", text="Rotate 180\u00B0").degrees = '180'
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2021-07-06 12:05:27 +10: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()
|
|
|
|
|
|
2025-03-21 01:57:32 +01:00
|
|
|
layout.operator("image.invert", text="Invert Red Channel", icon='RGB_RED').invert_r = True
|
|
|
|
|
layout.operator("image.invert", text="Invert Green Channel", icon='RGB_GREEN').invert_g = True
|
|
|
|
|
layout.operator("image.invert", text="Invert Blue Channel", icon='RGB_BLUE').invert_b = True
|
2018-11-07 18:16:04 +01:00
|
|
|
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")
|
|
|
|
|
|
2022-08-25 17:59:39 +12:00
|
|
|
layout.separator()
|
|
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
layout.operator("transform.vert_slide")
|
|
|
|
|
layout.operator("transform.edge_slide")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
2022-08-25 17:59:39 +12:00
|
|
|
layout.operator("uv.randomize_uv_transform")
|
|
|
|
|
|
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'
|
2022-07-19 19:24:20 +02:00
|
|
|
layout.operator("uv.snap_cursor", text="Cursor to Origin").target = 'ORIGIN'
|
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
|
|
|
|
2020-07-07 16:06:05 +10:00
|
|
|
class IMAGE_MT_uvs_align(Menu):
|
|
|
|
|
bl_label = "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
|
|
|
|
2020-07-07 16:06:05 +10:00
|
|
|
layout.operator_enum("uv.align", "axis")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_MT_uvs_merge(Menu):
|
|
|
|
|
bl_label = "Merge"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.operator("uv.weld", text="At Center")
|
|
|
|
|
# Mainly to match the mesh menu.
|
|
|
|
|
layout.operator("uv.snap_selected", text="At Cursor").target = 'CURSOR'
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.operator("uv.remove_doubles", text="By Distance")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_MT_uvs_split(Menu):
|
|
|
|
|
bl_label = "Split"
|
|
|
|
|
|
|
|
|
|
def draw(self, _context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
layout.operator("uv.select_split", text="Selection")
|
2009-06-16 01:22:56 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2020-09-09 19:47:02 -04:00
|
|
|
class IMAGE_MT_uvs_unwrap(Menu):
|
|
|
|
|
bl_label = "Unwrap"
|
|
|
|
|
|
2021-03-06 18:21:17 +11:00
|
|
|
def draw(self, _context):
|
2020-09-09 19:47:02 -04:00
|
|
|
layout = self.layout
|
|
|
|
|
|
2025-01-08 11:31:44 +11:00
|
|
|
# It would be nice to do: `layout.operator_enum("uv.unwrap", "method")`
|
|
|
|
|
# However the menu items don't have an "Unwrap" prefix, so inline the operators.
|
|
|
|
|
layout.operator("uv.unwrap", text="Unwrap Angle Based").method = 'ANGLE_BASED'
|
|
|
|
|
layout.operator("uv.unwrap", text="Unwrap Conformal").method = 'CONFORMAL'
|
|
|
|
|
layout.operator("uv.unwrap", text="Unwrap Minimum Stretch").method = 'MINIMUM_STRETCH'
|
2020-09-09 19:47:02 -04:00
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
|
|
|
|
layout.operator("uv.smart_project")
|
|
|
|
|
layout.operator("uv.lightmap_pack")
|
|
|
|
|
layout.operator("uv.follow_active_quads")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
|
|
|
|
layout.operator("uv.cube_project")
|
|
|
|
|
layout.operator("uv.cylinder_project")
|
|
|
|
|
layout.operator("uv.sphere_project")
|
|
|
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
|
2022-09-13 16:43:06 +12:00
|
|
|
layout.prop_menu_enum(uv, "pixel_round_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
|
|
|
|
2020-07-07 16:06:05 +10:00
|
|
|
layout.menu("IMAGE_MT_uvs_merge")
|
|
|
|
|
layout.menu("IMAGE_MT_uvs_split")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
2025-05-07 15:47:43 +10:00
|
|
|
layout.operator("uv.rip_move")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(uv, "use_live_unwrap")
|
2020-09-09 19:47:02 -04:00
|
|
|
layout.menu("IMAGE_MT_uvs_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
|
2023-07-04 02:46:23 +02:00
|
|
|
layout.operator("uv.pin", text="Invert Pins").invert = 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
|
|
|
|
2025-01-21 01:57:56 +01:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.operator("uv.pack_islands")
|
2023-05-12 14:47:53 +12:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
2019-03-19 13:13:32 +01:00
|
|
|
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")
|
2025-04-29 06:10:07 +02:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2019-03-19 13:13:32 +01:00
|
|
|
layout.operator("uv.stitch")
|
2025-04-29 06:10:07 +02:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
2020-07-07 16:06:05 +10:00
|
|
|
layout.menu("IMAGE_MT_uvs_align")
|
2022-09-07 13:22:45 +12:00
|
|
|
layout.operator("uv.align_rotation")
|
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
|
|
|
|
2022-11-13 12:27:28 +13:00
|
|
|
layout.operator("uv.copy")
|
|
|
|
|
layout.operator("uv.paste")
|
|
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
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):
|
2023-09-25 16:25:55 +02:00
|
|
|
bl_label = "UV"
|
2018-06-05 09:12:19 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
|
|
# UV Edit Mode
|
|
|
|
|
if sima.show_uvedit:
|
2024-03-12 10:04:07 -03:00
|
|
|
ts = context.tool_settings
|
|
|
|
|
if ts.use_uv_select_sync:
|
|
|
|
|
is_vert_mode, is_edge_mode, _ = ts.mesh_select_mode
|
|
|
|
|
else:
|
|
|
|
|
uv_select_mode = ts.uv_select_mode
|
|
|
|
|
is_vert_mode = uv_select_mode == 'VERTEX'
|
|
|
|
|
is_edge_mode = uv_select_mode == 'EDGE'
|
|
|
|
|
# is_face_mode = uv_select_mode == 'FACE'
|
|
|
|
|
# is_island_mode = uv_select_mode == 'ISLAND'
|
|
|
|
|
|
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
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
layout.separator()
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
if is_vert_mode or is_edge_mode:
|
|
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
if is_vert_mode:
|
|
|
|
|
layout.operator("transform.vert_slide")
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
if is_edge_mode:
|
|
|
|
|
layout.operator("transform.edge_slide")
|
2024-03-12 10:04:07 -03:00
|
|
|
|
2024-03-13 12:16:02 -03:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
|
|
|
|
layout.separator()
|
2018-06-05 09:12:19 +02:00
|
|
|
|
2019-03-19 13:14:35 +01:00
|
|
|
# Remove
|
2020-09-03 22:27:39 -04:00
|
|
|
layout.menu("IMAGE_MT_uvs_merge")
|
2025-04-29 06:10:07 +02:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2019-03-19 13:14:35 +01:00
|
|
|
layout.operator("uv.stitch")
|
2025-04-29 06:10:07 +02:00
|
|
|
layout.operator_context = 'EXEC_REGION_WIN'
|
2020-09-03 22:27:39 -04:00
|
|
|
layout.menu("IMAGE_MT_uvs_split")
|
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()
|
|
|
|
|
|
2022-09-23 14:33:46 +10:00
|
|
|
sima = context.space_data
|
|
|
|
|
|
|
|
|
|
pie.prop_enum(sima, "pivot_point", value='CENTER')
|
|
|
|
|
pie.prop_enum(sima, "pivot_point", value='CURSOR')
|
|
|
|
|
pie.prop_enum(sima, "pivot_point", value='INDIVIDUAL_ORIGINS')
|
|
|
|
|
pie.prop_enum(sima, "pivot_point", value='MEDIAN')
|
2018-09-26 17:32:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
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'
|
2022-07-19 19:24:20 +02:00
|
|
|
pie.operator(
|
|
|
|
|
"uv.snap_cursor",
|
|
|
|
|
text="Cursor to Origin",
|
|
|
|
|
icon='PIVOT_CURSOR',
|
|
|
|
|
).target = 'ORIGIN'
|
2018-09-26 17:32:11 +02:00
|
|
|
|
|
|
|
|
|
UI: Introduce View pie in more editors
#### Motivation
The View pie menu is a convenient way to access operators such as `Frame Selected` and `Frame All` which are usually mapped to `PERIOD` or `HOME` keys on the right side of most keyboard, making it hard hard to reach with the left hand.
The motivation for this patch comes from working with a 75% keyboard (no numpad). Most laptops face a similar problem.
#### Implementation
The View pie menu has been added to the following editors and sub-modes where applicable:
* Node Editor
* Video Sequencer
* Dopesheet
* Graph
* NLA
* Image
* Clip
* Outliner
More options could definitely be added to this menu for convenience, as long as it maintains the common options in the same place (Frame Selected on the left, Frame All on the right).
For positioning I went with the following layout:
{F11791186, size=full}
I've added `Zoom 1:1`to the Image Editor and the VSE Preview since there is no way to reset the zoom on keyboards without numpad (unless Emulate Numpad is turned on).
The Outliner uses `Show Active` and `Show Hierarchy` which are the closest ones to the equivalent in other editors. Should `Show Active` be renamed to `Frame Selected`?
The shortcut assigned is the same as the 3D Viewport (`ACCENT_GRAVE`).
#### Screenshots
Node Editor
{F11778387, size=full}
Dopesheet
{F11778400, size=full}
Graph
{F11778403, size=full}
Image Editor (Paint and View)
{F11791113, size=full}
Image Editor (Mask)
{F11791114, size=full}
UV Editor
{F11791119, size=full}
Clip Editor (Tracking)
{F11791137, size=full}
Clip Editor (Mask)
{F11791140, size=full}
Clip Editor (Graph)
{F11791151, size=full}
View operators are not yet implemented in Clip Editor Dopesheet mode (left a note about this in the menu poll).
Reviewed By: #user_interface, campbellbarton
Differential Revision: https://developer.blender.org/D13169
2021-11-10 02:17:24 +01:00
|
|
|
class IMAGE_MT_view_pie(Menu):
|
|
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
show_uvedit = sima.show_uvedit
|
|
|
|
|
show_maskedit = sima.show_maskedit
|
|
|
|
|
|
|
|
|
|
pie = layout.menu_pie()
|
|
|
|
|
pie.operator("image.view_all")
|
|
|
|
|
|
|
|
|
|
if show_uvedit or show_maskedit:
|
|
|
|
|
pie.operator("image.view_selected", text="Frame Selected", icon='ZOOM_SELECTED')
|
|
|
|
|
pie.operator("image.view_center_cursor", text="Center View to Cursor")
|
|
|
|
|
else:
|
|
|
|
|
# Add spaces so items stay in the same position through all modes.
|
|
|
|
|
pie.separator()
|
|
|
|
|
pie.separator()
|
|
|
|
|
|
|
|
|
|
pie.operator("image.view_zoom_ratio", text="Zoom 1:1").ratio = 1
|
|
|
|
|
pie.operator("image.view_all", text="Frame All Fit").fit_view = True
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
self.draw_tool_settings(context)
|
|
|
|
|
|
|
|
|
|
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':
|
2024-09-16 12:20:25 +02:00
|
|
|
if (tool is not None) and tool.use_brushes:
|
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-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):
|
2024-09-16 12:20:25 +02:00
|
|
|
if tool and tool.use_brushes:
|
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,
|
2022-12-15 17:24:23 +11: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,
|
2022-12-15 17:24:23 +11: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):
|
2024-09-16 12:20:25 +02:00
|
|
|
if (tool is None) or (not tool.use_brushes):
|
2019-04-18 21:13:22 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
|
|
paint = context.tool_settings.image_paint
|
|
|
|
|
brush = paint.brush
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
|
|
|
|
|
BrushAssetShelf.draw_popup_selector(layout, context, brush)
|
|
|
|
|
|
2019-04-18 21:13:22 +02:00
|
|
|
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
|
|
|
|
|
|
2024-09-03 22:56:48 +02:00
|
|
|
if show_uvedit:
|
2019-04-30 15:03:07 +10:00
|
|
|
layout.prop(sima, "pivot_point", icon_only=True)
|
|
|
|
|
|
|
|
|
|
if show_uvedit:
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
|
|
|
|
# Snap.
|
2024-07-26 14:59:13 +02:00
|
|
|
snap_uv_elements = tool_settings.snap_uv_element
|
|
|
|
|
if len(snap_uv_elements) == 1:
|
|
|
|
|
text = ""
|
|
|
|
|
elem = next(iter(snap_uv_elements))
|
|
|
|
|
act_snap_icon = tool_settings.bl_rna.properties["snap_uv_element"].enum_items[elem].icon
|
|
|
|
|
else:
|
|
|
|
|
text = iface_("Mix", i18n_contexts.id_image)
|
2023-12-13 13:53:36 -03:00
|
|
|
act_snap_icon = 'NONE'
|
2019-06-27 12:24:03 -03:00
|
|
|
|
2019-04-30 15:03:07 +10:00
|
|
|
row = layout.row(align=True)
|
2022-03-10 18:33:04 -03:00
|
|
|
row.prop(tool_settings, "use_snap_uv", text="")
|
2019-06-27 12:24:03 -03:00
|
|
|
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.popover(
|
|
|
|
|
panel="IMAGE_PT_snapping",
|
2023-12-13 13:53:36 -03:00
|
|
|
icon=act_snap_icon,
|
2024-07-26 14:59:13 +02:00
|
|
|
text=text,
|
2019-06-27 12:24:03 -03:00
|
|
|
)
|
2019-04-30 15:03:07 +10:00
|
|
|
|
|
|
|
|
# Proportional Editing
|
|
|
|
|
row = layout.row(align=True)
|
2020-07-16 18:53:41 +10:00
|
|
|
row.prop(
|
|
|
|
|
tool_settings,
|
|
|
|
|
"use_proportional_edit",
|
|
|
|
|
icon_only=True,
|
|
|
|
|
icon='PROP_CON' if tool_settings.use_proportional_connected else 'PROP_ON',
|
|
|
|
|
)
|
2019-04-30 15:03:07 +10:00
|
|
|
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
|
2020-10-07 16:29:15 +02:00
|
|
|
overlay = sima.overlay
|
2009-10-31 19:31:45 +00:00
|
|
|
ima = sima.image
|
|
|
|
|
iuser = sima.image_user
|
2018-12-17 17:20:24 +11:00
|
|
|
tool_settings = context.tool_settings
|
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
|
|
|
|
2021-09-28 14:44:36 +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:
|
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()
|
2025-04-30 13:55:52 +10:00
|
|
|
|
2025-05-06 02:59:40 +00:00
|
|
|
# Currently this only works for edge-select & face-select modes.
|
2025-04-30 13:55:52 +10:00
|
|
|
row = layout.row()
|
2025-05-06 02:59:40 +00:00
|
|
|
if tool_settings.mesh_select_mode[0]:
|
2025-04-30 13:55:52 +10:00
|
|
|
row.active = False
|
|
|
|
|
row.prop(tool_settings, "uv_sticky_select_mode", icon_only=True)
|
2018-06-28 17:54:59 +02:00
|
|
|
else:
|
2022-03-03 17:32:07 +05:30
|
|
|
row = layout.row(align=True)
|
|
|
|
|
uv_select_mode = tool_settings.uv_select_mode[:]
|
2022-03-04 11:03:36 +11:00
|
|
|
row.operator("uv.select_mode", text="", icon='UV_VERTEXSEL',
|
2022-03-03 17:32:07 +05:30
|
|
|
depress=(uv_select_mode == 'VERTEX')).type = 'VERTEX'
|
2022-03-04 11:03:36 +11:00
|
|
|
row.operator("uv.select_mode", text="", icon='UV_EDGESEL',
|
2022-03-03 17:32:07 +05:30
|
|
|
depress=(uv_select_mode == 'EDGE')).type = 'EDGE'
|
2022-03-04 11:03:36 +11:00
|
|
|
row.operator("uv.select_mode", text="", icon='UV_FACESEL',
|
2022-03-03 17:32:07 +05:30
|
|
|
depress=(uv_select_mode == 'FACE')).type = 'FACE'
|
2022-03-04 11:03:36 +11:00
|
|
|
row.operator("uv.select_mode", text="", icon='UV_ISLANDSEL',
|
2022-03-03 17:32:07 +05:30
|
|
|
depress=(uv_select_mode == 'ISLAND')).type = 'ISLAND'
|
2022-03-04 11:03:36 +11:00
|
|
|
|
2022-02-16 13:46:00 +11:00
|
|
|
layout.prop(tool_settings, "uv_sticky_select_mode", icon_only=True)
|
2018-06-28 17:54:59 +02:00
|
|
|
|
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()
|
|
|
|
|
|
2021-09-28 14:44:36 +10:00
|
|
|
IMAGE_HT_header.draw_xform_template(layout, context)
|
2019-04-30 15:03:07 +10:00
|
|
|
|
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:
|
2024-09-03 22:56:48 +02:00
|
|
|
layout.template_ID(sima, "mask", new="mask.new")
|
|
|
|
|
layout.prop(sima, "pivot_point", icon_only=True)
|
|
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.prop(tool_settings, "use_proportional_edit_mask", text="", icon_only=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.active = tool_settings.use_proportional_edit_mask
|
|
|
|
|
sub.prop_with_popover(
|
|
|
|
|
tool_settings,
|
|
|
|
|
"proportional_edit_falloff",
|
|
|
|
|
text="",
|
|
|
|
|
icon_only=True,
|
|
|
|
|
panel="IMAGE_PT_proportional_edit",
|
|
|
|
|
)
|
2012-08-06 12:12:45 +00:00
|
|
|
|
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()
|
|
|
|
|
|
2022-05-05 00:16:15 +02:00
|
|
|
# Gizmo toggle & popover.
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.prop(sima, "show_gizmo", icon='GIZMO', text="")
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.active = sima.show_gizmo
|
|
|
|
|
sub.popover(panel="IMAGE_PT_gizmo_display", text="")
|
|
|
|
|
|
2020-10-07 16:29:15 +02:00
|
|
|
# Overlay toggle & popover
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.prop(overlay, "show_overlays", icon='OVERLAY', text="")
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.active = overlay.show_overlays
|
|
|
|
|
sub.popover(panel="IMAGE_PT_overlay", text="")
|
|
|
|
|
|
2018-06-11 16:57:35 +02:00
|
|
|
if show_uvedit:
|
|
|
|
|
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()
|
2024-03-14 10:38:16 +11:00
|
|
|
row.popover(panel="IMAGE_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
|
|
|
|
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):
|
2023-09-25 16:25:55 +02:00
|
|
|
bl_label = "Mask"
|
2019-06-27 18:27:47 +02:00
|
|
|
|
|
|
|
|
@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,
|
2025-01-21 15:12:59 +01:00
|
|
|
MASK_PT_animation,
|
2017-10-21 12:41:42 +11:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2025-01-21 15:12:59 +01:00
|
|
|
class IMAGE_PT_mask_animation(MASK_PT_animation, Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'UI'
|
|
|
|
|
bl_category = "Mask"
|
|
|
|
|
|
|
|
|
|
|
2021-06-15 10:50:48 +10:00
|
|
|
class IMAGE_PT_mask_display(MASK_PT_display, Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2021-08-08 16:09:23 -04:00
|
|
|
bl_region_type = 'HEADER'
|
2021-06-15 10:50:48 +10: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()
|
2024-03-28 10:08:56 -03:00
|
|
|
col.label(text="Snap Target")
|
2019-06-27 12:24:03 -03:00
|
|
|
col.prop(tool_settings, "snap_uv_element", expand=True)
|
|
|
|
|
|
2024-07-26 14:59:13 +02:00
|
|
|
col.label(text="Snap Base")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.active = bool(tool_settings.snap_uv_element.difference({'INCREMENT', 'GRID'}))
|
|
|
|
|
row.prop(tool_settings, "snap_target", expand=True)
|
2019-06-27 12:24:03 -03:00
|
|
|
|
2021-09-29 17:47:32 +10:00
|
|
|
col.separator()
|
|
|
|
|
|
2019-06-27 12:24:03 -03:00
|
|
|
col.label(text="Affect")
|
|
|
|
|
row = col.row(align=True)
|
I18n: extract and disambiguate a few messages
Extract
- Add to Quick Favorites tooltip.
- "Mask", the name of a newly created mask (DATA_).
- "New" in the context of the new mask ID button.
- A few strings using BLI_STR_UTF8_ defines were not extracted.
Take the special characters out of the translation macros.
- "External" menu items from the filebrowser's Files context
menu (right-click on a file). These items were already extracted,
but not translated.
Improve
- Separate formatted error message "%s is not compatible with
["the specified", "any"] 'refresh' options" into two messages.
Disambiguate
- Use Action context for new F-modifiers' names. This is already used
for the "type" operator prop.
- Translate ImportHelper's default confirmation text using the
Operator context, as it uses the operator name which is extracted
with this context.
- "Scale" can be a noun, the scale of something, or a verb, to scale
something. The latter mostly uses the Operator context, so apply
this context to verbs, and the default contexts to nouns.
- "Scale Influence" can mean "Influence on Scale" (tracking
stabilization) and "to Scale the Influence" (dynamic paint canvas).
- "Object Line Art" as type of Line Art to add, as opposed to the
active object's Line Art settings.
- Float to Integer node: use NodeTree context for the node label, as
this is already extracted and used for the enum.
Do not translate
- Sequencer labels containing only a string formatting field.
Some issues reported by Gabriel Gazzán and Ye Gui.
Pull Request: https://projects.blender.org/blender/blender/pulls/122283
2024-05-27 19:33:35 +02:00
|
|
|
row.prop(
|
|
|
|
|
tool_settings,
|
|
|
|
|
"use_snap_translate",
|
|
|
|
|
text="Move",
|
|
|
|
|
text_ctxt=i18n_contexts.operator_default,
|
2025-01-14 12:46:40 +11:00
|
|
|
toggle=True,
|
|
|
|
|
)
|
I18n: extract and disambiguate a few messages
Extract
- Add to Quick Favorites tooltip.
- "Mask", the name of a newly created mask (DATA_).
- "New" in the context of the new mask ID button.
- A few strings using BLI_STR_UTF8_ defines were not extracted.
Take the special characters out of the translation macros.
- "External" menu items from the filebrowser's Files context
menu (right-click on a file). These items were already extracted,
but not translated.
Improve
- Separate formatted error message "%s is not compatible with
["the specified", "any"] 'refresh' options" into two messages.
Disambiguate
- Use Action context for new F-modifiers' names. This is already used
for the "type" operator prop.
- Translate ImportHelper's default confirmation text using the
Operator context, as it uses the operator name which is extracted
with this context.
- "Scale" can be a noun, the scale of something, or a verb, to scale
something. The latter mostly uses the Operator context, so apply
this context to verbs, and the default contexts to nouns.
- "Scale Influence" can mean "Influence on Scale" (tracking
stabilization) and "to Scale the Influence" (dynamic paint canvas).
- "Object Line Art" as type of Line Art to add, as opposed to the
active object's Line Art settings.
- Float to Integer node: use NodeTree context for the node label, as
this is already extracted and used for the enum.
Do not translate
- Sequencer labels containing only a string formatting field.
Some issues reported by Gabriel Gazzán and Ye Gui.
Pull Request: https://projects.blender.org/blender/blender/pulls/122283
2024-05-27 19:33:35 +02:00
|
|
|
row.prop(tool_settings, "use_snap_rotate", text="Rotate", text_ctxt=i18n_contexts.operator_default, toggle=True)
|
|
|
|
|
row.prop(tool_settings, "use_snap_scale", text="Scale", text_ctxt=i18n_contexts.operator_default, toggle=True)
|
2024-03-09 16:50:06 +11:00
|
|
|
col.label(text="Rotation Increment")
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
row.prop(tool_settings, "snap_angle_increment_2d", text="")
|
|
|
|
|
row.prop(tool_settings, "snap_angle_increment_2d_precision", text="")
|
2019-06-27 12:24:03 -03:00
|
|
|
|
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)
|
2023-05-04 16:39:22 +02:00
|
|
|
col.prop(tool_settings, "proportional_size")
|
2019-10-29 10:28:41 -03:00
|
|
|
|
|
|
|
|
|
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")
|
2020-09-15 13:33:56 +02:00
|
|
|
row = col.row()
|
|
|
|
|
row.active = ima.source != 'TILED'
|
|
|
|
|
row.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-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):
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
bl_label = "Brush Asset"
|
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"
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 12
|
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
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
if brush:
|
Fix #134292: Clone brush cannot access local blendfile images
With the brush assets project, brushes were moved from being local to
the working blendfile to being linked from asset libraries. This breaks
the Image Paint 'Clone' brush, as it has a brush property that links to
other Image datablocks.
To support this functionality, this commit adds the corresponding
properties into the `ImagePaintSettings` struct so that it is stored
locally with the images that will be used by the tool, inside the main
blendfile.
The source image property is shared with the 3D version of the 'Clone'
brush instead of adding a separate field to preserve old behavior.
Notably, this has the following limitations:
* If clone brush assets have been made and shared with external packs,
they would not work out of the box with linked image assets.
* Despite these settings being stored on the scene, they are populated
inside the tool window under "Brush Settings" which is potentially
misleading. However, this is already the case for the 3D version of
the brush, so further UI refinement will happen outside of this PR.
* Users will be unable to use separate images simultaneously for the
Image editor and the 3D viewport, unlike in pre-4.3 versions. This
can be adjusted in the future if it is a critical workflow.
Because the intended design and functionality of this tool is currently
questionable, this commit opts to make these changes instead of doing
further design to support both accessing data on the brush and on the
scene.
Pull Request: https://projects.blender.org/blender/blender/pulls/134474
2025-02-19 22:00:39 +01:00
|
|
|
brush_settings_advanced(layout.column(), context, settings, 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
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
if not brush:
|
|
|
|
|
return False
|
2019-03-19 18:17:50 +01:00
|
|
|
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
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
if brush:
|
|
|
|
|
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"
|
2023-06-09 06:26:28 +02:00
|
|
|
bl_label = "Cursor"
|
2019-03-19 19:03:51 +01:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 15
|
2019-03-19 19:03:51 +01:00
|
|
|
|
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
|
2021-03-02 14:57:51 +01:00
|
|
|
tex_slot = brush.texture_slot
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
|
col = layout.column()
|
2021-03-02 14:57:51 +01:00
|
|
|
col.template_ID_preview(tex_slot, "texture", new="texture.new", rows=3, cols=8)
|
2013-10-09 14:57:48 +00:00
|
|
|
|
|
|
|
|
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"
|
2020-08-14 12:58:24 -04:00
|
|
|
bl_ui_units_x = 12
|
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
|
|
|
|
2024-11-26 15:38:58 +11:00
|
|
|
# Only a popover.
|
|
|
|
|
class IMAGE_PT_uv_sculpt_curve(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR' # dummy.
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
|
2023-09-05 10:49:20 +10:00
|
|
|
bl_context = ".uv_sculpt" # Dot on purpose (access from top-bar).
|
2019-05-01 18:10:34 +10:00
|
|
|
bl_label = "Falloff"
|
|
|
|
|
|
2024-04-26 17:10:04 +02:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
props = context.scene.tool_settings.uv_sculpt
|
2025-01-21 12:41:05 +01:00
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(props, "curve_preset", expand=True)
|
|
|
|
|
|
2024-04-26 17:10:04 +02:00
|
|
|
if props.curve_preset == 'CUSTOM':
|
2025-01-21 12:41:05 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
col.template_curve_mapping(props, "strength_curve")
|
2024-04-26 17:10:04 +02:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2024-11-26 15:38:58 +11:00
|
|
|
# Only a popover.
|
|
|
|
|
class IMAGE_PT_uv_sculpt_options(Panel):
|
|
|
|
|
bl_space_type = 'TOPBAR' # dummy.
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
|
2023-09-05 10:49:20 +10:00
|
|
|
bl_context = ".uv_sculpt" # Dot on purpose (access from top-bar).
|
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 = "Options"
|
2019-05-01 18:10:34 +10:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
tool_settings = context.tool_settings
|
|
|
|
|
|
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
2019-12-14 18:48:18 +01:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(tool_settings, "uv_sculpt_lock_borders")
|
|
|
|
|
col.prop(tool_settings, "uv_sculpt_all_islands")
|
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
|
2024-02-06 12:22:48 +01:00
|
|
|
|
2014-02-13 19:49:26 +02:00
|
|
|
layout.template_vectorscope(sima, "scopes")
|
2024-02-06 12:22:48 +01:00
|
|
|
row = layout.split(factor=0.75)
|
|
|
|
|
row.prop(sima.scopes, "vectorscope_alpha")
|
|
|
|
|
row.prop(sima.scopes, "vectorscope_mode", text="")
|
2014-02-13 19:49:26 +02:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2020-09-18 14:37:33 -05:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2019-03-11 16:37:57 +01:00
|
|
|
|
|
|
|
|
col = layout.column()
|
2020-09-18 14:37:33 -05:00
|
|
|
col.prop(sima, "cursor_location", text="Location")
|
2019-03-11 16:37:57 +01:00
|
|
|
|
|
|
|
|
|
2022-05-05 00:16:15 +02:00
|
|
|
class IMAGE_PT_gizmo_display(Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Gizmos"
|
|
|
|
|
bl_ui_units_x = 8
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
view = context.space_data
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.label(text="Viewport Gizmos")
|
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
|
|
col.active = view.show_gizmo
|
|
|
|
|
colsub = col.column()
|
|
|
|
|
colsub.prop(view, "show_gizmo_navigate", text="Navigate")
|
|
|
|
|
|
|
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
class IMAGE_PT_overlay(Panel):
|
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
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2022-04-08 21:40:05 -07:00
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Overlays"
|
2025-05-21 15:57:31 +02:00
|
|
|
bl_ui_units_x = 14
|
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
|
|
|
|
|
|
|
|
def draw(self, context):
|
2022-04-08 21:40:05 -07:00
|
|
|
pass
|
2020-09-18 14:37:33 -05: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
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
class IMAGE_PT_overlay_guides(Panel):
|
2021-09-29 17:47:32 +10:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
2022-04-08 21:40:05 -07:00
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Guides"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
2021-09-29 17:47:32 +10:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
return sima.show_uvedit
|
2021-09-29 17:47:32 +10:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
2022-04-08 21:40:05 -07:00
|
|
|
overlay = sima.overlay
|
2021-09-29 17:47:32 +10:00
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
layout.active = overlay.show_overlays
|
2021-09-29 17:47:32 +10:00
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
row = layout.row()
|
2022-10-12 11:26:14 +13:00
|
|
|
row.prop(overlay, "show_grid_background", text="Grid")
|
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
|
|
|
|
2022-04-08 21:40:05 -07:00
|
|
|
if overlay.show_grid_background:
|
2022-10-12 11:26:14 +13:00
|
|
|
sub = row.row()
|
|
|
|
|
sub.prop(uvedit, "show_grid_over_image", text="Over Image")
|
2022-09-23 14:33:46 +10:00
|
|
|
sub.active = sima.image is not None
|
2022-09-22 13:16:34 +12:00
|
|
|
|
2022-10-12 11:26:14 +13:00
|
|
|
layout.row().prop(uvedit, "grid_shape_source", expand=True)
|
2020-10-07 16:29:15 +02:00
|
|
|
|
2022-10-12 11:26:14 +13:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2022-04-08 21:40:05 -07:00
|
|
|
|
|
|
|
|
row = layout.row()
|
2022-10-12 11:26:14 +13:00
|
|
|
row.prop(uvedit, "custom_grid_subdivisions", text="Fixed Subdivisions")
|
|
|
|
|
row.active = uvedit.grid_shape_source == 'FIXED'
|
|
|
|
|
|
|
|
|
|
layout.prop(uvedit, "tile_grid_shape", text="Tiles")
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
|
2024-02-20 11:03:37 +01:00
|
|
|
class IMAGE_PT_overlay_uv_stretch(Panel):
|
2020-10-07 16:29:15 +02:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
2024-02-20 11:03:37 +01:00
|
|
|
bl_label = "UV Stretch"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
return (sima and (sima.show_uvedit))
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
overlay = sima.overlay
|
|
|
|
|
|
|
|
|
|
layout.active = overlay.show_overlays
|
|
|
|
|
|
2024-02-20 11:03:37 +01:00
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.row().prop(uvedit, "show_stretch", text="")
|
|
|
|
|
subrow = row.row()
|
2020-10-07 16:29:15 +02:00
|
|
|
subrow.active = uvedit.show_stretch
|
|
|
|
|
subrow.prop(uvedit, "display_stretch_type", text="")
|
2024-02-20 11:03:37 +01:00
|
|
|
subrow.prop(uvedit, "stretch_opacity", text="Opacity")
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_overlay_uv_edit_geometry(Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Geometry"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
return (sima and (sima.show_uvedit))
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
overlay = sima.overlay
|
|
|
|
|
|
|
|
|
|
layout.active = overlay.show_overlays
|
|
|
|
|
|
|
|
|
|
# Edges
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(uvedit, "uv_opacity")
|
|
|
|
|
col.prop(uvedit, "edge_display_type", text="")
|
|
|
|
|
col.prop(uvedit, "show_modified_edges", text="Modified Edges")
|
|
|
|
|
|
|
|
|
|
# Faces
|
|
|
|
|
row = col.row()
|
|
|
|
|
row.active = not uvedit.show_stretch
|
|
|
|
|
row.prop(uvedit, "show_faces", text="Faces")
|
|
|
|
|
|
|
|
|
|
|
Overlay: Allow drawing UVs in Image Editor in any mode
**Problem**
When using Texture Paint mode, the Image Editor will show a UV Wireframe
to display the active object's UVs. In every other mode, this wireframe
is absent. This is currently a big problem for Sculpt Mode since the
Experimental Texture Paint system is a part of that mode, meaning that
the user can't see their UVs while they paint in Sculpt Mode. This is
also troublesome for users that would like to quickly view an object's
UVs without using Texture Paint Mode.
**Solution**
Since it's useful to be able to view an object's UVs at all times, the
Image Editor should display UV Wireframes in all Object Modes regardless
of the Image Editor's mode. This is the best solution since it means
that future Blender features, that would benefit from having a preview
of an object's UV Wireframes, will automatically have that option since
UV Wireframes are supported in all modes. Also, if a user doesn't want
to see UV Wireframes for any reason, it can be disabled with an Overlay
option.
Additionally, when multiple objects are selected, each object should
have its UV Wireframe drawn in the Image Editor. The selected objects
that aren't active should have less opaque wireframes to indicate which
wireframe belongs to the active object. This is the best approach for
having multiple objects selected since it allows the user to quickly
view the UV layout for all selected objects to troubleshoot UV problems,
like texture mapping. This is especially helpful when using a material
for multiple different objects.
An alternative solution would be to only show the UV Wireframe for the
active object, but this would be undesirable because it would make
troubleshooting UV positions tedious when working with multiple objects
since the user would need to select objects individually.
Co-authored-by: T0MIS0N <50230774+T0MIS0N@users.noreply.github.com>
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/135102
2025-04-04 21:30:05 +02:00
|
|
|
class IMAGE_PT_overlay_uv_display(Panel):
|
2020-10-07 16:29:15 +02:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Geometry"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
sima = context.space_data
|
2025-06-02 23:42:01 +02:00
|
|
|
return (sima and sima.mode in {'UV', 'PAINT'} and not (sima.show_uvedit or sima.show_render))
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
overlay = sima.overlay
|
|
|
|
|
|
|
|
|
|
layout.active = overlay.show_overlays
|
Overlay: Allow drawing UVs in Image Editor in any mode
**Problem**
When using Texture Paint mode, the Image Editor will show a UV Wireframe
to display the active object's UVs. In every other mode, this wireframe
is absent. This is currently a big problem for Sculpt Mode since the
Experimental Texture Paint system is a part of that mode, meaning that
the user can't see their UVs while they paint in Sculpt Mode. This is
also troublesome for users that would like to quickly view an object's
UVs without using Texture Paint Mode.
**Solution**
Since it's useful to be able to view an object's UVs at all times, the
Image Editor should display UV Wireframes in all Object Modes regardless
of the Image Editor's mode. This is the best solution since it means
that future Blender features, that would benefit from having a preview
of an object's UV Wireframes, will automatically have that option since
UV Wireframes are supported in all modes. Also, if a user doesn't want
to see UV Wireframes for any reason, it can be disabled with an Overlay
option.
Additionally, when multiple objects are selected, each object should
have its UV Wireframe drawn in the Image Editor. The selected objects
that aren't active should have less opaque wireframes to indicate which
wireframe belongs to the active object. This is the best approach for
having multiple objects selected since it allows the user to quickly
view the UV layout for all selected objects to troubleshoot UV problems,
like texture mapping. This is especially helpful when using a material
for multiple different objects.
An alternative solution would be to only show the UV Wireframe for the
active object, but this would be undesirable because it would make
troubleshooting UV positions tedious when working with multiple objects
since the user would need to select objects individually.
Co-authored-by: T0MIS0N <50230774+T0MIS0N@users.noreply.github.com>
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/135102
2025-04-04 21:30:05 +02:00
|
|
|
layout.prop(uvedit, "show_uv")
|
|
|
|
|
layout.prop(uvedit, "uv_face_opacity")
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_PT_overlay_image(Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Image"
|
2023-09-29 14:32:54 +10:00
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
2020-10-07 16:29:15 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
uvedit = sima.uv_editor
|
|
|
|
|
overlay = sima.overlay
|
|
|
|
|
|
|
|
|
|
layout.active = overlay.show_overlays
|
|
|
|
|
layout.prop(uvedit, "show_metadata")
|
|
|
|
|
|
|
|
|
|
|
2025-05-21 15:57:31 +02:00
|
|
|
class IMAGE_PT_overlay_render_guides(Panel):
|
|
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
|
|
|
|
bl_region_type = 'HEADER'
|
|
|
|
|
bl_label = "Guides"
|
|
|
|
|
bl_parent_id = "IMAGE_PT_overlay"
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
sima = context.space_data
|
2025-05-23 03:58:31 +00:00
|
|
|
return (
|
|
|
|
|
(sima.mode in {'MASK', 'VIEW'}) and
|
|
|
|
|
(image := sima.image) is not None and
|
|
|
|
|
(image.source == 'VIEWER') and
|
|
|
|
|
(image.type == 'COMPOSITING')
|
|
|
|
|
)
|
2025-05-21 15:57:31 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
sima = context.space_data
|
|
|
|
|
overlay = sima.overlay
|
|
|
|
|
|
|
|
|
|
layout.active = overlay.show_overlays
|
|
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
layout.prop(overlay, "show_text_info")
|
|
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
|
row.prop(overlay, "show_render_size")
|
|
|
|
|
subrow = row.row()
|
|
|
|
|
subrow.active = overlay.show_render_size
|
|
|
|
|
subrow.prop(overlay, "passepartout_alpha", text="Passepartout")
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
class ImageAssetShelf(BrushAssetShelf):
|
2025-01-21 23:50:17 +11:00
|
|
|
bl_space_type = 'IMAGE_EDITOR'
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMAGE_AST_brush_paint(ImageAssetShelf, AssetShelf):
|
|
|
|
|
mode_prop = "use_paint_image"
|
2024-09-20 18:08:53 +02:00
|
|
|
brush_type_prop = "image_brush_type"
|
|
|
|
|
tool_prop = "image_tool"
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2024-07-16 19:23:22 +02:00
|
|
|
return context.space_data and context.space_data.mode == 'PAINT'
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
|
|
|
|
|
|
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,
|
2020-07-10 16:07:31 -04:00
|
|
|
IMAGE_MT_select_linked,
|
2017-03-18 20:03:24 +11:00
|
|
|
IMAGE_MT_image,
|
2024-01-31 23:36:28 +01:00
|
|
|
IMAGE_MT_image_transform,
|
2017-03-18 20:03:24 +11:00
|
|
|
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,
|
2020-07-07 16:06:05 +10:00
|
|
|
IMAGE_MT_uvs_align,
|
|
|
|
|
IMAGE_MT_uvs_merge,
|
|
|
|
|
IMAGE_MT_uvs_split,
|
2020-09-09 19:47:02 -04:00
|
|
|
IMAGE_MT_uvs_unwrap,
|
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,
|
UI: Introduce View pie in more editors
#### Motivation
The View pie menu is a convenient way to access operators such as `Frame Selected` and `Frame All` which are usually mapped to `PERIOD` or `HOME` keys on the right side of most keyboard, making it hard hard to reach with the left hand.
The motivation for this patch comes from working with a 75% keyboard (no numpad). Most laptops face a similar problem.
#### Implementation
The View pie menu has been added to the following editors and sub-modes where applicable:
* Node Editor
* Video Sequencer
* Dopesheet
* Graph
* NLA
* Image
* Clip
* Outliner
More options could definitely be added to this menu for convenience, as long as it maintains the common options in the same place (Frame Selected on the left, Frame All on the right).
For positioning I went with the following layout:
{F11791186, size=full}
I've added `Zoom 1:1`to the Image Editor and the VSE Preview since there is no way to reset the zoom on keyboards without numpad (unless Emulate Numpad is turned on).
The Outliner uses `Show Active` and `Show Hierarchy` which are the closest ones to the equivalent in other editors. Should `Show Active` be renamed to `Frame Selected`?
The shortcut assigned is the same as the 3D Viewport (`ACCENT_GRAVE`).
#### Screenshots
Node Editor
{F11778387, size=full}
Dopesheet
{F11778400, size=full}
Graph
{F11778403, size=full}
Image Editor (Paint and View)
{F11791113, size=full}
Image Editor (Mask)
{F11791114, size=full}
UV Editor
{F11791119, size=full}
Clip Editor (Tracking)
{F11791137, size=full}
Clip Editor (Mask)
{F11791140, size=full}
Clip Editor (Graph)
{F11791151, size=full}
View operators are not yet implemented in Clip Editor Dopesheet mode (left a note about this in the menu poll).
Reviewed By: #user_interface, campbellbarton
Differential Revision: https://developer.blender.org/D13169
2021-11-10 02:17:24 +01:00
|
|
|
IMAGE_MT_view_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,
|
2021-06-15 10:50:48 +10:00
|
|
|
IMAGE_PT_mask_display,
|
2017-03-20 02:34:32 +11:00
|
|
|
IMAGE_PT_active_mask_spline,
|
|
|
|
|
IMAGE_PT_active_mask_point,
|
2025-01-21 15:12:59 +01:00
|
|
|
IMAGE_PT_mask_animation,
|
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,
|
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_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,
|
2022-05-05 00:16:15 +02:00
|
|
|
IMAGE_PT_gizmo_display,
|
2020-10-07 16:29:15 +02:00
|
|
|
IMAGE_PT_overlay,
|
2022-04-08 21:40:05 -07:00
|
|
|
IMAGE_PT_overlay_guides,
|
2024-02-20 11:03:37 +01:00
|
|
|
IMAGE_PT_overlay_uv_stretch,
|
2020-10-07 16:29:15 +02:00
|
|
|
IMAGE_PT_overlay_uv_edit_geometry,
|
Overlay: Allow drawing UVs in Image Editor in any mode
**Problem**
When using Texture Paint mode, the Image Editor will show a UV Wireframe
to display the active object's UVs. In every other mode, this wireframe
is absent. This is currently a big problem for Sculpt Mode since the
Experimental Texture Paint system is a part of that mode, meaning that
the user can't see their UVs while they paint in Sculpt Mode. This is
also troublesome for users that would like to quickly view an object's
UVs without using Texture Paint Mode.
**Solution**
Since it's useful to be able to view an object's UVs at all times, the
Image Editor should display UV Wireframes in all Object Modes regardless
of the Image Editor's mode. This is the best solution since it means
that future Blender features, that would benefit from having a preview
of an object's UV Wireframes, will automatically have that option since
UV Wireframes are supported in all modes. Also, if a user doesn't want
to see UV Wireframes for any reason, it can be disabled with an Overlay
option.
Additionally, when multiple objects are selected, each object should
have its UV Wireframe drawn in the Image Editor. The selected objects
that aren't active should have less opaque wireframes to indicate which
wireframe belongs to the active object. This is the best approach for
having multiple objects selected since it allows the user to quickly
view the UV layout for all selected objects to troubleshoot UV problems,
like texture mapping. This is especially helpful when using a material
for multiple different objects.
An alternative solution would be to only show the UV Wireframe for the
active object, but this would be undesirable because it would make
troubleshooting UV positions tedious when working with multiple objects
since the user would need to select objects individually.
Co-authored-by: T0MIS0N <50230774+T0MIS0N@users.noreply.github.com>
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/135102
2025-04-04 21:30:05 +02:00
|
|
|
IMAGE_PT_overlay_uv_display,
|
2020-10-07 16:29:15 +02:00
|
|
|
IMAGE_PT_overlay_image,
|
2025-05-21 15:57:31 +02:00
|
|
|
IMAGE_PT_overlay_render_guides,
|
Sculpt/Paint: New asset based brush management workflow
This is the main merge commit of the brush assets project. The previous
commits did some preparing changes, more tweaks are in the following commits.
Also, a lot of the more general work was already merged into the main branch
over the last two years.
With the new design, quite some things can be removed/replaced:
- There's a unified "Brush" tool now, brush based tools and all special
handling is removed.
- Old tool and brush icons are unsed now, and their initialization code
removed here. That means they draw as blank now, and the icon files can be
removed in a follow up.
- Creation of default brushes is unnecessary since brushes are now bundled in
the Essentials asset library. Icons/previews are handled as standard asset
previews.
- Grease pencil eraser options are replaced by a general default eraser brush
that can be set by the user.
More changes are planned still, see task list issue below.
Main Authors: Bastien Montagne, Brecht Van Lommel, Hans Goudey, Julian Eisel
Additionally involved on the design: Dalai Felinto, Julien Kaspar
Blog Post: https://code.blender.org/2024/07/brush-assets-is-out/
Tasks:
https://projects.blender.org/blender/blender/issues/116337
Reviewed incrementally as part of the brush assets project, see:
https://projects.blender.org/blender/blender/pulls/106303
2024-07-08 13:09:57 +02:00
|
|
|
IMAGE_AST_brush_paint,
|
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)
|