Cleanup: pep8, unused vars, line length

This commit is contained in:
2019-12-16 14:29:03 +11:00
parent 31ac2e292e
commit 165afb3ad0
17 changed files with 334 additions and 87 deletions

View File

@@ -231,7 +231,7 @@ class IMAGE_MT_image(Menu):
if ima and not show_render:
if ima.packed_file:
if len(ima.filepath):
if ima.filepath:
layout.separator()
layout.operator("image.unpack", text="Unpack")
else:
@@ -590,8 +590,22 @@ class _draw_tool_settings_context_mode:
brush = uv_sculpt.brush
if brush:
# NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281
UnifiedPaintPanel.prop_unified(layout, context, brush, "size", pressure_name="use_pressure_size", slider=True)
UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", pressure_name="use_pressure_strength", slider=True)
UnifiedPaintPanel.prop_unified(
layout,
context,
brush,
"size",
pressure_name="use_pressure_size",
slider=True,
)
UnifiedPaintPanel.prop_unified(
layout,
context,
brush,
"strength",
pressure_name="use_pressure_strength",
slider=True,
)
@staticmethod
def PAINT(context, layout, tool):
@@ -738,7 +752,6 @@ class MASK_MT_editor_menus(Menu):
show_uvedit = sima.show_uvedit
show_maskedit = sima.show_maskedit
show_paint = sima.show_paint
layout.menu("IMAGE_MT_view")
@@ -1037,7 +1050,7 @@ class IMAGE_PT_render_slots(Panel):
class IMAGE_UL_udim_tiles(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index):
tile = item
layout.prop(tile, "label", text="", emboss=False)
@@ -1079,6 +1092,7 @@ class IMAGE_PT_paint_select(Panel, ImagePaintPanel, BrushSelectPanel):
bl_context = ".paint_common_2d"
bl_category = "Tool"
class IMAGE_PT_paint_settings(Panel, ImagePaintPanel):
bl_context = ".paint_common_2d"
bl_category = "Tool"
@@ -1226,6 +1240,7 @@ class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel):
row.prop(ipaint, "tile_x", text="X", toggle=True)
row.prop(ipaint, "tile_y", text="Y", toggle=True)
class UVSculptPanel(UnifiedPaintPanel):
@classmethod
def poll(cls, context):
@@ -1255,7 +1270,9 @@ class IMAGE_PT_uv_sculpt_brush_settings(Panel, ImagePaintPanel, UVSculptPanel):
if brush:
if brush.uv_sculpt_tool == 'RELAX':
# Although this settings is stored in the scene, it is only used by a single tool, so it doesn't make sense from a user perspective to move it to the Options panel.
# Although this settings is stored in the scene,
# it is only used by a single tool,
# so it doesn't make sense from a user perspective to move it to the Options panel.
layout.prop(tool_settings, "uv_relax_method")
@@ -1266,6 +1283,7 @@ class IMAGE_PT_uv_sculpt_curve(Panel, FalloffPanel, ImagePaintPanel, UVSculptPan
bl_label = "Falloff"
bl_options = {'DEFAULT_CLOSED'}
class IMAGE_PT_uv_sculpt_options(Panel, ImagePaintPanel, UVSculptPanel):
bl_context = ".uv_sculpt" # dot on purpose (access from topbar)
bl_category = "Tool"