diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-16 05:43:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-16 05:43:45 +0300 |
commit | 80062e6305102c3c478ffce568d70f3cbbc1999e (patch) | |
tree | e3ae55117a9838d318d4a5da59c5c29f9ac68deb /release/scripts/startup/bl_ui | |
parent | 3b163483c478dc580e1352aebca7a264d21515f2 (diff) |
Cleanup: use static sets
Diffstat (limited to 'release/scripts/startup/bl_ui')
5 files changed, 19 insertions, 19 deletions
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 59c18d4f108..b97571e4547 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -184,7 +184,7 @@ class GreasePencilDisplayPanel: gp_settings = brush.gpencil_settings self.layout.prop(gp_settings, "use_cursor", text="") - elif context.mode in ('SCULPT_GPENCIL', 'WEIGHT_GPENCIL'): + elif context.mode in {'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: settings = context.tool_settings.gpencil_sculpt brush = settings.brush diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index e45988cdcd9..32df73f02fa 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -54,7 +54,7 @@ class UnifiedPaintPanel: return 'UV_SCULPT' return 'PAINT_2D' - if space_type in ('VIEW_3D', 'PROPERTIES'): + if space_type in {'VIEW_3D', 'PROPERTIES'}: if context.mode == 'PAINT_TEXTURE': if tool_settings.image_paint and tool_settings.image_paint.detect_data(): return context.mode @@ -87,7 +87,7 @@ class UnifiedPaintPanel: # Grease Pencil settings elif mode == 'PAINT_GPENCIL': return tool_settings.gpencil_paint - elif mode in ('SCULPT_GPENCIL', 'WEIGHT_GPENCIL'): + elif mode in {'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}: return tool_settings.gpencil_sculpt @staticmethod @@ -192,7 +192,7 @@ class ClonePanel(BrushPanel): settings = cls.paint_settings(context) mode = cls.get_brush_mode(context) - if mode in ('PAINT_TEXTURE', 'PAINT_2D'): + if mode in {'PAINT_TEXTURE', 'PAINT_2D'}: brush = settings.brush return brush.image_tool == 'CLONE' @@ -314,7 +314,7 @@ class StrokePanel(BrushPanel): if mode == 'SCULPT': col.row().prop(brush, "use_scene_spacing", text="Spacing Distance", expand=True) - if mode in ('PAINT_TEXTURE', 'PAINT_2D', 'SCULPT'): + if mode in {'PAINT_TEXTURE', 'PAINT_2D', 'SCULPT'}: if brush.image_paint_capabilities.has_space_attenuation or brush.sculpt_capabilities.has_space_attenuation: col.prop(brush, "use_space_attenuation") @@ -529,7 +529,7 @@ def brush_settings(layout, context, brush, popover=False): # crease_pinch_factor if capabilities.has_pinch_factor: text = "Pinch" - if brush.sculpt_tool in ('BLOB', 'SNAKE_HOOK'): + if brush.sculpt_tool in {'BLOB', 'SNAKE_HOOK'}: text = "Magnify" layout.prop(brush, "crease_pinch_factor", slider=True, text=text) @@ -578,7 +578,7 @@ def brush_settings(layout, context, brush, popover=False): if brush.sculpt_tool == 'POSE': row = layout.row() row.prop(brush, "pose_offset") - + if brush.sculpt_tool == 'SCRAPE': row = layout.row() row.prop(brush, "invert_to_scrape_fill", text = "Invert to Fill") @@ -600,7 +600,7 @@ def brush_settings(layout, context, brush, popover=False): layout.row().prop(brush, "mask_tool", expand=True) # 3D and 2D Texture Paint Mode # - elif mode in ('PAINT_TEXTURE', 'PAINT_2D'): + elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}: capabilities = brush.image_paint_capabilities if brush.image_tool == 'FILL': @@ -625,7 +625,7 @@ def brush_shared_settings(layout, context, brush, popover=False): direction = False # 3D and 2D Texture Paint # - if mode in ('PAINT_TEXTURE', 'PAINT_2D'): + if mode in {'PAINT_TEXTURE', 'PAINT_2D'}: if not popover: blend_mode = brush.image_paint_capabilities.has_color size = brush.image_paint_capabilities.has_radius @@ -660,7 +660,7 @@ def brush_shared_settings(layout, context, brush, popover=False): # UV Sculpt # if mode == 'UV_SCULPT': size = True - strength = True + strength = True ### Draw settings. ### ups = context.scene.tool_settings.unified_paint_settings @@ -723,7 +723,7 @@ def brush_settings_advanced(layout, context, brush, popover=False): layout.separator() # 3D and 2D Texture Paint # - elif mode in ('PAINT_TEXTURE', 'PAINT_2D'): + elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}: capabilities = brush.image_paint_capabilities use_accumulate = capabilities.has_accumulate @@ -935,7 +935,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False) row = layout.row(align=True) row.prop(gp_settings, "fill_draw_mode", text="Boundary") row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID') - + else: # brush.gpencil_tool == 'DRAW': row = layout.row(align=True) row.prop(brush, "size", text="Radius") diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index 65c41bae3f6..88705d84384 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -378,7 +378,7 @@ class ToolSelectPanelHelper: @staticmethod def _tool_active_from_context(context, space_type, mode=None, create=False): - if space_type in ('VIEW_3D', 'PROPERTIES'): + if space_type in {'VIEW_3D', 'PROPERTIES'}: if mode is None: mode = context.mode tool = context.workspace.tools.from_space_view3d_mode(mode, create=create) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index fe90cab6e6f..ca8b951b555 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -130,7 +130,7 @@ class VIEW3D_HT_tool_header(Header): elif tool_mode == 'SCULPT_GPENCIL': settings = context.tool_settings.gpencil_sculpt tool = settings.sculpt_tool - if tool in ('SMOOTH', 'RANDOMIZE', 'SMOOTH'): + if tool in {'SMOOTH', 'RANDOMIZE', 'SMOOTH'}: layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_options") layout.popover("VIEW3D_PT_tools_grease_pencil_sculpt_appearance") elif tool_mode == 'WEIGHT_GPENCIL': diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 6ace1466883..34239d97a69 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1208,7 +1208,7 @@ class VIEW3D_PT_imagepaint_options(View3DPaintPanel): @classmethod def poll(cls, context): # This is currently unused, since there aren't any Vertex Paint mode specific options. - return False + return False return (context.image_paint_object and context.tool_settings.image_paint) def draw(self, context): @@ -1337,7 +1337,7 @@ class GreasePencilPanel: @classmethod def poll(cls, context): - if context.space_data.type in ('VIEW_3D', 'PROPERTIES'): + if context.space_data.type in {'VIEW_3D', 'PROPERTIES'}: if context.gpencil_data is None: return False @@ -1518,7 +1518,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_post_processing(View3DPanel, Panel): @classmethod def poll(cls, context): brush = context.tool_settings.gpencil_paint.brush - return brush is not None and brush.gpencil_tool not in ('ERASE', 'FILL') + return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} def draw_header(self, context): if self.is_popover: return @@ -1572,7 +1572,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): @classmethod def poll(cls, context): brush = context.tool_settings.gpencil_paint.brush - return brush is not None and brush.gpencil_tool not in ('ERASE', 'FILL') + return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} def draw_header(self, context): if self.is_popover: return @@ -1846,7 +1846,7 @@ classes = ( VIEW3D_PT_tools_posemode_options, VIEW3D_PT_slots_projectpaint, - VIEW3D_PT_tools_brush_select, + VIEW3D_PT_tools_brush_select, VIEW3D_PT_tools_brush_settings, VIEW3D_PT_tools_brush_color, VIEW3D_PT_tools_brush_swatches, |