Cleanup: pep8

This commit is contained in:
Campbell Barton 2020-12-16 18:02:40 +11:00
parent f34ca933a8
commit e671c548e6
14 changed files with 35 additions and 17 deletions

View File

@ -22,6 +22,7 @@ from bpy_extras.asset_utils import (
SpaceAssetInfo,
)
class ASSET_OT_tag_add(bpy.types.Operator):
"""Add a new keyword tag to the active asset"""

View File

@ -18,6 +18,7 @@
import bpy
def geometry_node_group_empty_new(context):
group = bpy.data.node_groups.new("Geometry Nodes", 'GeometryNodeTree')
group.inputs.new('NodeSocketGeometry', "Geometry")
@ -33,6 +34,7 @@ def geometry_node_group_empty_new(context):
return group
def geometry_modifier_poll(context) -> bool:
ob = context.object
@ -42,6 +44,7 @@ def geometry_modifier_poll(context) -> bool:
return True
class NewGeometryNodesModifier(bpy.types.Operator):
"""Create a new modifier with a new geometry node group"""

View File

@ -573,6 +573,7 @@ class QuickLiquid(Operator):
return {'FINISHED'}
classes = (
QuickExplode,
QuickFur,

View File

@ -893,6 +893,7 @@ class GreasePencilLayerDisplayPanel:
row = layout.row(align=True)
row.prop(gpl, "use_solo_mode", text="Show Only on Keyframed")
class GreasePencilFlipTintColors(Operator):
bl_label = "Flip Colors"
bl_idname = "gpencil.tint_flip"

View File

@ -550,7 +550,6 @@ def brush_settings(layout, context, brush, popover=False):
if context.preferences.experimental.use_sculpt_tools_tilt and capabilities.has_tilt:
layout.prop(brush, "tilt_strength_factor", slider=True)
row = layout.row(align=True)
row.prop(brush, "hardness", slider=True)
row.prop(brush, "invert_hardness_pressure", text="")

View File

@ -267,7 +267,11 @@ class FILEBROWSER_PT_bookmarks_system(Panel):
@classmethod
def poll(cls, context):
return not context.preferences.filepaths.hide_system_bookmarks and panel_poll_is_upper_region(context.region) and not panel_poll_is_asset_browsing(context)
return (
not context.preferences.filepaths.hide_system_bookmarks and
panel_poll_is_upper_region(context.region) and
not panel_poll_is_asset_browsing(context)
)
def draw(self, context):
layout = self.layout
@ -301,7 +305,10 @@ class FILEBROWSER_PT_bookmarks_favorites(Panel):
@classmethod
def poll(cls, context):
return panel_poll_is_upper_region(context.region) and not panel_poll_is_asset_browsing(context)
return (
panel_poll_is_upper_region(context.region) and
not panel_poll_is_asset_browsing(context)
)
def draw(self, context):
layout = self.layout
@ -338,7 +345,11 @@ class FILEBROWSER_PT_bookmarks_recents(Panel):
@classmethod
def poll(cls, context):
return not context.preferences.filepaths.hide_recent_locations and panel_poll_is_upper_region(context.region) and not panel_poll_is_asset_browsing(context)
return (
not context.preferences.filepaths.hide_recent_locations and
panel_poll_is_upper_region(context.region) and
not panel_poll_is_asset_browsing(context)
)
def draw(self, context):
layout = self.layout
@ -362,7 +373,11 @@ class FILEBROWSER_PT_advanced_filter(Panel):
@classmethod
def poll(cls, context):
# only useful in append/link (library) context currently...
return context.space_data.params.use_library_browsing and panel_poll_is_upper_region(context.region) and not panel_poll_is_asset_browsing(context)
return (
context.space_data.params.use_library_browsing and
panel_poll_is_upper_region(context.region) and
not panel_poll_is_asset_browsing(context)
)
def draw(self, context):
layout = self.layout

View File

@ -1465,7 +1465,7 @@ class IMAGE_PT_overlay(Panel):
bl_ui_units_x = 13
def draw(self, context):
pass
pass
class IMAGE_PT_overlay_uv_edit(Panel):
@ -1496,7 +1496,6 @@ class IMAGE_PT_overlay_uv_edit(Panel):
subrow.prop(uvedit, "display_stretch_type", text="")
class IMAGE_PT_overlay_uv_edit_geometry(Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'HEADER'
@ -1529,7 +1528,6 @@ class IMAGE_PT_overlay_uv_edit_geometry(Panel):
row.prop(uvedit, "show_faces", text="Faces")
class IMAGE_PT_overlay_texture_paint(Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'HEADER'

View File

@ -168,7 +168,6 @@ class NODE_HT_header(Header):
else:
row.template_ID(snode, "node_tree", new="node.new_geometry_nodes_modifier")
else:
# Custom node tree is edited as independent ID block
NODE_MT_editor_menus.draw_collapsible(context, layout)

View File

@ -61,8 +61,10 @@ class PROPERTIES_PT_navigation_bar(Panel):
layout.scale_x = 1.4
layout.scale_y = 1.4
if view.search_filter:
layout.prop_tabs_enum(view, "context", data_highlight=view,
property_highlight="tab_search_results", icon_only=True)
layout.prop_tabs_enum(
view, "context", data_highlight=view,
property_highlight="tab_search_results", icon_only=True,
)
else:
layout.prop_tabs_enum(view, "context", icon_only=True)

View File

@ -156,7 +156,6 @@ class SEQUENCER_HT_header(Header):
if tool_settings.use_proportional_edit:
row.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
row = layout.row(align=True)
row.prop(st, "show_strip_overlay", text="", icon='OVERLAY')
sub = row.row(align=True)
@ -213,7 +212,6 @@ class SEQUENCER_PT_preview_overlay(Panel):
st = context.space_data
return st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'} and st.display_mode == 'IMAGE'
def draw(self, context):
ed = context.scene.sequence_editor
st = context.space_data
@ -224,7 +222,7 @@ class SEQUENCER_PT_preview_overlay(Panel):
layout.prop(st, "show_safe_areas", text="Safe Areas")
layout.prop(st, "show_metadata", text="Metadata")
layout.prop(st, "show_annotation", text="Annotations")
class SEQUENCER_PT_sequencer_overlay(Panel):
bl_space_type = 'SEQUENCE_EDITOR'
@ -237,7 +235,6 @@ class SEQUENCER_PT_sequencer_overlay(Panel):
st = context.space_data
return st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}
def draw(self, context):
st = context.space_data
layout = self.layout
@ -258,7 +255,6 @@ class SEQUENCER_PT_sequencer_overlay(Panel):
layout.prop_menu_enum(st, "waveform_display_type")
class SEQUENCER_MT_view_cache(Menu):
bl_label = "Cache"

View File

@ -297,6 +297,7 @@ class TIME_PT_keyframing_settings(TimelinePanelButtons, Panel):
col.label(text="New Keyframe Type")
col.prop(tool_settings, "keyframe_type", text="")
class TIME_PT_auto_keyframing(TimelinePanelButtons, Panel):
bl_label = "Auto Keyframing"
bl_options = {'HIDE_HEADER'}

View File

@ -211,7 +211,7 @@ class USERPREF_PT_interface_display(InterfacePanel, CenterAlignMixIn, Panel):
col.separator()
col = layout.column(heading="Tooltips", align=True)
col.prop(view, "show_tooltips", text = "User Tooltips")
col.prop(view, "show_tooltips", text="User Tooltips")
sub = col.column()
sub.active = view.show_tooltips
sub.prop(view, "show_tooltips_python")

View File

@ -5306,6 +5306,7 @@ class VIEW3D_MT_sculpt_mask_edit_pie(Menu):
op.filter_type = 'CONTRAST_DECREASE'
op.auto_iteration_count = False
class VIEW3D_MT_sculpt_automasking_pie(Menu):
bl_label = "Automasking"

View File

@ -966,6 +966,7 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
row.active = mesh.use_mirror_vertex_group_x
row.prop(mesh, "use_mirror_topology")
class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
bl_space_type = 'TOPBAR'
bl_region_type = 'HEADER'