diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-05 06:07:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-05 06:13:30 +0300 |
commit | 143ece7199c20b231077273e4c16c7edd0bc4940 (patch) | |
tree | 046795b2e46defc6668fa1119a67716a537310a1 /release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | |
parent | c15439bcdc52f90570dd22fc0f61b94bdf56145d (diff) |
Tool System: initial support for UV-sculpt
This currently conflicts with the UV-sculpt toggle being manually set,
ideally this would work more like other paint modes in Blender.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_toolsystem_toolbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index b7dc8335a7b..01e9ac33491 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1190,6 +1190,15 @@ class _defs_weight_paint: class _defs_image_generic: + @staticmethod + def poll_uvedit(context): + ob = context.edit_object + if ob is not None: + data = ob.data + if data is not None: + return bool(getattr(data, "uv_layers", False)) + return False + @ToolDef.from_fn def cursor(): return dict( @@ -1282,6 +1291,18 @@ class _defs_image_uv_select: ) +class _defs_image_uv_sculpt: + + @staticmethod + def generate_from_brushes(context): + return generate_from_enum_ex( + context, + icon_prefix="brush.uv_sculpt.", + data=context.tool_settings, + attr="uv_sculpt_tool", + ) + + class _defs_gpencil_paint: @staticmethod def draw_color_selector(context, layout): @@ -1772,6 +1793,12 @@ class IMAGE_PT_tools_active(ToolSelectPanelHelper, Panel): *_tools_transform, None, *_tools_annotate, + None, + lambda context: ( + _defs_image_uv_sculpt.generate_from_brushes(context) + if _defs_image_generic.poll_uvedit(context) + else () + ), ], 'MASK': [ None, |