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/startup/bl_ui/space_image.py | |
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/startup/bl_ui/space_image.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 13 |
1 files changed, 2 insertions, 11 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 |