Cleanup: pep8

This commit is contained in:
Campbell Barton 2018-06-28 08:27:03 +02:00
parent a18a6a1441
commit d8d245917d
5 changed files with 78 additions and 84 deletions

View File

@ -58,14 +58,14 @@ class CLIP_HT_header(Header):
sc = context.space_data
clip = sc.clip
CLIP_MT_tracking_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
CLIP_MT_tracking_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
row = layout.row()
row.template_ID(sc, "clip", open="clip.open")
layout.separator_spacer()
layout.separator_spacer()
if clip:
tracking = clip.tracking
@ -120,13 +120,13 @@ class CLIP_HT_header(Header):
CLIP_MT_masking_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
layout.separator_spacer()
row = layout.row()
row.template_ID(sc, "clip", open="clip.open")
layout.separator_spacer()
layout.separator_spacer()
if clip:
row = layout.row()
row.template_ID(sc, "mask", new="mask.new")

View File

@ -480,10 +480,10 @@ class IMAGE_HT_header(Header):
layout.prop(sima, "mode", text="")
MASK_MT_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
MASK_MT_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
layout.template_ID(sima, "image", new="image.new", open="image.open")
if not show_render:
layout.prop(sima, "use_image_pin", text="")
@ -492,8 +492,8 @@ class IMAGE_HT_header(Header):
row = layout.row()
row.template_ID(sima, "mask", new="mask.new")
layout.separator_spacer()
layout.separator_spacer()
# uv editing
if show_uvedit:
uvedit = sima.uv_editor
@ -506,7 +506,6 @@ class IMAGE_HT_header(Header):
layout.prop(toolsettings, "uv_select_mode", text="", expand=True)
layout.prop(uvedit, "sticky_select_mode", icon_only=True)
if show_uvedit or show_maskedit or mode == 'PAINT':
layout.prop(sima, "use_realtime_update", icon_only=True, icon='LOCKED')

View File

@ -57,16 +57,16 @@ class NODE_HT_header(Header):
ob = context.object
if snode.shader_type == 'OBJECT' and ob:
NODE_MT_editor_menus.draw_collapsible(context, layout)
# No shader nodes for Eevee lamps
if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LAMP'):
row = layout.row()
row.prop(snode_id, "use_nodes")
layout.separator_spacer()
NODE_MT_editor_menus.draw_collapsible(context, layout)
# No shader nodes for Eevee lamps
if snode_id and not (context.engine == 'BLENDER_EEVEE' and ob.type == 'LAMP'):
row = layout.row()
row.prop(snode_id, "use_nodes")
layout.separator_spacer()
row = layout.row()
# disable material slot buttons when pinned, cannot find correct slot within id_from (#36589)
row.enabled = not snode.pin
@ -77,54 +77,54 @@ class NODE_HT_header(Header):
if id_from and ob.type != 'LAMP':
row.template_ID(id_from, "active_material", new="material.new")
if snode.shader_type == 'WORLD':
if snode.shader_type == 'WORLD':
NODE_MT_editor_menus.draw_collapsible(context, layout)
if snode_id:
row = layout.row()
row = layout.row()
row.prop(snode_id, "use_nodes")
layout.separator_spacer()
row = layout.row()
row.enabled = not snode.pin
row.template_ID(scene, "world", new="world.new")
layout.separator_spacer()
row = layout.row()
row.enabled = not snode.pin
row.template_ID(scene, "world", new="world.new")
if snode.shader_type == 'LINESTYLE':
view_layer = context.view_layer
lineset = view_layer.freestyle_settings.linesets.active
if lineset is not None:
if lineset is not None:
NODE_MT_editor_menus.draw_collapsible(context, layout)
if snode_id:
row = layout.row()
row = layout.row()
row.prop(snode_id, "use_nodes")
layout.separator_spacer()
row = layout.row()
row.enabled = not snode.pin
row.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
layout.separator_spacer()
row = layout.row()
row.enabled = not snode.pin
row.template_ID(lineset, "linestyle", new="scene.freestyle_linestyle_new")
elif snode.tree_type == 'TextureNodeTree':
layout.prop(snode, "texture_type", text="", expand=True)
NODE_MT_editor_menus.draw_collapsible(context, layout)
if snode_id:
layout.prop(snode_id, "use_nodes")
layout.separator_spacer()
NODE_MT_editor_menus.draw_collapsible(context, layout)
if snode_id:
layout.prop(snode_id, "use_nodes")
layout.separator_spacer()
if id_from:
if snode.texture_type == 'BRUSH':
layout.template_ID(id_from, "texture", new="texture.new")
else:
layout.template_ID(id_from, "active_texture", new="texture.new")
elif snode.tree_type == 'CompositorNodeTree':
elif snode.tree_type == 'CompositorNodeTree':
NODE_MT_editor_menus.draw_collapsible(context, layout)
@ -141,9 +141,9 @@ class NODE_HT_header(Header):
# Custom node tree is edited as independent ID block
NODE_MT_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
layout.template_ID(snode, "node_tree", new="node.new_node_tree")
layout.separator_spacer()
layout.template_ID(snode, "node_tree", new="node.new_node_tree")
layout.separator_spacer()
layout.prop(snode, "pin", text="")

View File

@ -83,9 +83,9 @@ class SEQUENCER_HT_header(Header):
SEQUENCER_MT_editor_menus.draw_collapsible(context, layout)
layout.separator_spacer()
layout.template_running_jobs()
layout.separator_spacer()
layout.template_running_jobs()
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.prop(st, "display_mode", expand=True, text="")
@ -93,8 +93,8 @@ class SEQUENCER_HT_header(Header):
if st.view_type == 'SEQUENCER':
layout.separator()
layout.prop(st, "show_backdrop")
layout.operator("sequencer.refresh_all")
layout.operator("sequencer.refresh_all")
else:
if st.view_type == 'SEQUENCER_PREVIEW':
layout.separator()
@ -131,12 +131,11 @@ class SEQUENCER_HT_header(Header):
props.animation = True
props.sequencer = True
if st.view_type == 'SEQUENCER':
row = layout.row(align=True)
row.operator("sequencer.copy", text="", icon='COPYDOWN')
row.operator("sequencer.paste", text="", icon='PASTEDOWN')
if st.view_type == 'SEQUENCER':
row = layout.row(align=True)
row.operator("sequencer.copy", text="", icon='COPYDOWN')
row.operator("sequencer.paste", text="", icon='PASTEDOWN')
class SEQUENCER_MT_editor_menus(Menu):

View File

@ -46,17 +46,15 @@ class TEXT_HT_header(Header):
row.prop(st, "show_word_wrap", text="")
row.prop(st, "show_syntax_highlight", text="")
layout.separator_spacer()
layout.separator_spacer()
row = layout.row(align=True)
row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open")
layout.separator_spacer()
row = layout.row(align=True)
row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open")
if text:
osl = text.name.endswith(".osl") or text.name.endswith(".oso")
layout.separator_spacer()
if text:
osl = text.name.endswith(".osl") or text.name.endswith(".oso")
row = layout.row()
if text.filepath:
@ -70,18 +68,16 @@ class TEXT_HT_header(Header):
row.label(text="Text: External"
if text.library
else "Text: Internal")
if osl:
row = layout.row()
row.operator("node.shader_script_update")
else:
row = layout.row()
row.active = text.name.endswith(".py")
row.prop(text, "use_module")
row = layout.row()
row.operator("text.run_script")
if osl:
row = layout.row()
row.operator("node.shader_script_update")
else:
row = layout.row()
row.active = text.name.endswith(".py")
row.prop(text, "use_module")
row = layout.row()
row.operator("text.run_script")
class TEXT_MT_editor_menus(Menu):