Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r--release/scripts/startup/bl_ui/space_image.py98
1 files changed, 52 insertions, 46 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 466ba40b688..b27895fa04b 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -364,10 +364,6 @@ class IMAGE_MT_uvs(Menu):
layout.separator()
- layout.prop(tool_settings, "use_uv_sculpt")
-
- layout.separator()
-
layout.prop(uv, "use_live_unwrap")
layout.operator("uv.unwrap")
@@ -555,8 +551,9 @@ class IMAGE_HT_tool_header(Header):
if tool_mode == 'PAINT':
if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".paint_common_2d", category="")
- elif context.uv_sculpt_object is not None:
- layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".uv_sculpt", category="")
+ elif tool_mode == 'UV':
+ if (tool is not None) and tool.has_datablock:
+ layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".uv_sculpt", category="")
def draw_mode_settings(self, context):
layout = self.layout
@@ -573,10 +570,10 @@ class IMAGE_HT_tool_header(Header):
class _draw_tool_settings_context_mode:
@staticmethod
- def VIEW(context, layout, _tool):
- tool_settings = context.tool_settings
- if tool_settings.use_uv_sculpt:
+ def UV(context, layout, tool):
+ if tool and tool.has_datablock:
if context.mode == 'EDIT_MESH':
+ tool_settings = context.tool_settings
uv_sculpt = tool_settings.uv_sculpt
brush = uv_sculpt.brush
if brush:
@@ -1378,54 +1375,33 @@ class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel):
row.prop(ipaint, "tile_y", text="Y", toggle=True)
-class IMAGE_PT_uv_sculpt_curve(Panel):
+class IMAGE_PT_uv_sculpt_brush(Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
bl_category = "Tool"
- bl_label = "UV Sculpt Curve"
- bl_options = {'DEFAULT_CLOSED'}
+ bl_label = "Brush"
@classmethod
def poll(cls, context):
- return (context.uv_sculpt_object is not None)
+ sima = context.space_data
+ # TODO(campbell): nicer way to check if we're in uv sculpt mode.
+ if sima and sima.show_uvedit:
+ from .space_toolsystem_common import ToolSelectPanelHelper
+ tool = ToolSelectPanelHelper.tool_active_from_context(context)
+ if tool.has_datablock:
+ return True
+ return False
def draw(self, context):
+ from .properties_paint_common import UnifiedPaintPanel
layout = self.layout
tool_settings = context.tool_settings
uvsculpt = tool_settings.uv_sculpt
- brush = uvsculpt.brush
-
- if brush is not None:
- layout.template_curve_mapping(brush, "curve")
- row = layout.row(align=True)
- row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
- row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
- row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
- row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
- row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
- row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
-
-
-class IMAGE_PT_uv_sculpt(Panel):
- bl_space_type = 'IMAGE_EDITOR'
- bl_region_type = 'UI'
- bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
- bl_category = "Tool"
- bl_label = "UV Sculpt"
-
- @classmethod
- def poll(cls, context):
- return (context.uv_sculpt_object is not None)
-
- def draw(self, context):
- from .properties_paint_common import UnifiedPaintPanel
- layout = self.layout
+ layout.template_ID(uvsculpt, "brush")
- tool_settings = context.tool_settings
- uvsculpt = tool_settings.uv_sculpt
brush = uvsculpt.brush
if not self.is_popover:
@@ -1444,13 +1420,43 @@ class IMAGE_PT_uv_sculpt(Panel):
col.prop(tool_settings, "uv_sculpt_lock_borders")
col.prop(tool_settings, "uv_sculpt_all_islands")
- col.prop(tool_settings, "uv_sculpt_tool")
- if tool_settings.uv_sculpt_tool == 'RELAX':
- col.prop(tool_settings, "uv_relax_method")
+ if brush:
+ if brush.uv_sculpt_tool == 'RELAX':
+ col.prop(tool_settings, "uv_relax_method")
col.prop(uvsculpt, "show_brush")
+class IMAGE_PT_uv_sculpt_curve(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'UI'
+ bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
+ bl_category = "Tool"
+ bl_label = "Falloff"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ poll = IMAGE_PT_uv_sculpt_brush.poll
+
+ def draw(self, context):
+ layout = self.layout
+
+ tool_settings = context.tool_settings
+ uvsculpt = tool_settings.uv_sculpt
+ brush = uvsculpt.brush
+
+ if brush is not None:
+ layout.template_curve_mapping(brush, "curve")
+
+ row = layout.row(align=True)
+ row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
+ row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
+ row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
+ row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
+ row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
+ row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
+
+
+
class ImageScopesPanel:
@classmethod
def poll(cls, context):
@@ -1646,7 +1652,7 @@ classes = (
IMAGE_PT_tools_brush_display_show_brush,
IMAGE_PT_tools_brush_display_custom_icon,
IMAGE_PT_tools_imagepaint_symmetry,
- IMAGE_PT_uv_sculpt,
+ IMAGE_PT_uv_sculpt_brush,
IMAGE_PT_uv_sculpt_curve,
IMAGE_PT_view_histogram,
IMAGE_PT_view_waveform,