diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-05 10:10:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-05 10:10:27 +0300 |
commit | b69301d4aa1bec6de596042d48df2846723c7445 (patch) | |
tree | afab43bcc2c5118e6be9aaee1b0113c6c9a69e0f /release/scripts | |
parent | 8b05d38305c4af49848b41e307ceb3ed424f5fbc (diff) |
Context: add uv_sculpt_object
While this may be temporary, it avoids copy-pasting these
checks in Python code.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 13 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 8 |
2 files changed, 4 insertions, 17 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 22f85ad37ae..436cf4e4cad 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -1167,7 +1167,7 @@ class IMAGE_PT_uv_sculpt_curve(Panel): @classmethod def poll(cls, context): - return IMAGE_PT_uv_sculpt.poll(context) + return (context.uv_sculpt_object is not None) def draw(self, context): layout = self.layout @@ -1196,16 +1196,7 @@ class IMAGE_PT_uv_sculpt(Panel): @classmethod def poll(cls, context): - tool_settings = context.tool_settings - if tool_settings.use_uv_sculpt: - if context.mode == 'EDIT_MESH': - workspace = context.workspace - space_type = workspace.tools_space_type - if space_type == 'IMAGE_EDITOR': - mode = workspace.tools_mode - if mode == 'VIEW': - return True - return False + return (context.uv_sculpt_object is not None) def draw(self, context): from .properties_paint_common import UnifiedPaintPanel diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 2712d09c272..76fcb2b4cdb 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -163,12 +163,8 @@ class TOPBAR_HT_lower_bar(Header): elif tool_mode == 'GPENCIL_WEIGHT': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_weight", category="") elif tool_space_type == 'IMAGE_EDITOR': - if tool_mode == 'VIEW': - mode = context.mode - if mode == 'EDIT_MESH': - tool_settings = context.tool_settings - if tool_settings.use_uv_sculpt: - layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".uv_sculpt", category="") + if context.uv_sculpt_object is not None: + layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".uv_sculpt", category="") def draw_center(self, context): pass |