Cleanup: style
authorCampbell Barton <ideasman42@gmail.com>
Thu, 20 Dec 2018 02:01:40 +0000 (13:01 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 20 Dec 2018 02:11:04 +0000 (13:11 +1100)
16 files changed:
release/scripts/startup/bl_operators/view3d.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/properties_data_gpencil.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/properties_paint_common.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_toolsystem_common.py
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
release/scripts/startup/bl_ui/space_topbar.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py

index 58ddc50..9e27eda 100644 (file)
@@ -187,7 +187,7 @@ class VIEW3D_OT_select_or_deselect_all(Operator):
     def invoke(self, context, event):
         retval = bpy.ops.view3d.select(
             'INVOKE_DEFAULT',
-            True, # undo push
+            True,  # undo push
             extend=self.extend,
             deselect=self.deselect,
             toggle=self.toggle,
index bf968de..4461812 100644 (file)
@@ -1124,7 +1124,6 @@ class WM_OT_properties_edit(Operator):
 
         return value_eval
 
-
     def get_default_eval(self):
         try:
             default_eval = eval(self.default)
@@ -1135,7 +1134,6 @@ class WM_OT_properties_edit(Operator):
 
         return default_eval
 
-
     def execute(self, context):
         from rna_prop_ui import (
             rna_idprop_ui_prop_get,
@@ -1252,7 +1250,7 @@ class WM_OT_properties_edit(Operator):
 
         # default default value
         prop_type = type(self.get_value_eval())
-        if prop_type in {int,float}:
+        if prop_type in {int, float}:
             self.default = str(prop_type(0))
         else:
             self.default = ""
@@ -1315,7 +1313,7 @@ class WM_OT_properties_edit(Operator):
         layout.prop(self, "value")
 
         row = layout.row()
-        row.enabled = type(self.get_value_eval()) in {int,float}
+        row.enabled = type(self.get_value_eval()) in {int, float}
         row.prop(self, "default")
 
         row = layout.row(align=True)
@@ -2396,6 +2394,7 @@ class WM_OT_toolbar(Operator):
 
     if use_toolbar_release_hack:
         _key_held = None
+
         def invoke(self, context, event):
             WM_OT_toolbar._key_held = event.type
             return self.execute(context)
@@ -2520,7 +2519,7 @@ class WM_OT_studiolight_new(Operator):
             except:
                 traceback.print_exc()
 
-        finalpath = str(path_studiolights.joinpath(self.filename));
+        finalpath = str(path_studiolights.joinpath(self.filename))
         if pathlib.Path(finalpath + ".sl").is_file():
             if not self.ask_overide:
                 self.ask_overide = True
@@ -2678,7 +2677,7 @@ class WM_MT_splash(Menu):
         #sub = col.split(factor=0.35)
         #row = sub.row()
         #row.alignment = 'RIGHT'
-        #row.label(text="Language:")
+        # row.label(text="Language:")
         #userpref = context.user_preferences
         #sub.prop(userpref.system, "language", text="")
 
@@ -2808,6 +2807,7 @@ class WM_OT_drop_blend_file(Operator):
         col.operator("wm.link", text="Link...", icon='LINK_BLEND').filepath = self.filepath
         col.operator("wm.append", text="Append...", icon='APPEND_BLEND').filepath = self.filepath
 
+
 classes = (
     WM_OT_addon_disable,
     WM_OT_addon_enable,
index 56612c3..f1205b0 100644 (file)
@@ -143,7 +143,7 @@ class DATA_PT_gpencil_datapanel(Panel):
             srow = col.row(align=True)
             srow.prop(gpl, "opacity", text="Opacity", slider=True)
             srow.prop(gpl, "clamp_layer", text="",
-                     icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+                      icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
 
         col = row.column()
 
index 7641851..3d4f303 100644 (file)
@@ -615,7 +615,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         layout.separator()
         col = layout.column()
 
-
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
 
         col.label(text="Textures:")
@@ -635,7 +634,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         col.prop(md, "offset_u")
         col.prop(md, "offset_v")
 
-
     def MULTIRES(self, layout, ob, md):
         layout.row().prop(md, "subdivision_type", expand=True)
 
index 9ba2c06..11aeb74 100644 (file)
@@ -983,8 +983,8 @@ class GPENCIL_UL_layer(UIList):
 
             row = layout.row(align=True)
             row.prop(gpl, "clamp_layer", text="",
-                        icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE',
-                        emboss=False)
+                     icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE',
+                     emboss=False)
 
             row.prop(gpl, "lock", text="", emboss=False)
             row.prop(gpl, "hide", text="", emboss=False)
index 76eee82..72f4845 100644 (file)
@@ -311,6 +311,7 @@ def brush_mask_texture_settings(layout, brush):
     col.prop(mask_tex_slot, "offset")
     col.prop(mask_tex_slot, "scale")
 
+
 classes = (
     VIEW3D_MT_tools_projectpaint_clone,
 )
index 9f24945..a45c2bc 100644 (file)
@@ -148,6 +148,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel):
         col.prop(props, "use_gtao_bent_normals")
         col.prop(props, "use_gtao_bounce")
 
+
 class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
     bl_label = "Motion Blur"
     bl_options = {'DEFAULT_CLOSED'}
@@ -505,7 +506,6 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel):
         col.prop(rd, "alpha_mode", text="Alpha")
 
 
-
 class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
     bl_label = "Hair"
     bl_options = {'DEFAULT_CLOSED'}
index 47c5de8..f0f8cf1 100644 (file)
@@ -423,6 +423,7 @@ class DOPESHEET_MT_marker(Menu):
 #######################################
 # Keyframe Editing
 
+
 class DOPESHEET_MT_channel(Menu):
     bl_label = "Channel"
 
index 6b407da..73afb62 100644 (file)
@@ -145,7 +145,6 @@ class NODE_HT_header(Header):
 
             layout.template_ID(snode, "node_tree", new="node.new_node_tree")
 
-
         layout.prop(snode, "pin", text="")
         layout.separator_spacer()
 
@@ -576,9 +575,11 @@ class EEVEE_NODE_PT_material_settings(Panel):
     @classmethod
     def poll(cls, context):
         snode = context.space_data
-        return (context.engine in cls.COMPAT_ENGINES) and \
-               snode.tree_type == 'ShaderNodeTree' and snode.id and \
-               snode.id.bl_rna.identifier == 'Material'
+        return (
+            (context.engine in cls.COMPAT_ENGINES) and
+            (snode.tree_type == 'ShaderNodeTree' and snode.id) and
+            (snode.id.bl_rna.identifier == 'Material')
+        )
 
     def draw(self, context):
         material = context.space_data.id
@@ -595,8 +596,10 @@ class NODE_PT_material_viewport(Panel):
     @classmethod
     def poll(cls, context):
         snode = context.space_data
-        return snode.tree_type == 'ShaderNodeTree' and snode.id and \
-               snode.id.bl_rna.identifier == 'Material'
+        return (
+            (snode.tree_type == 'ShaderNodeTree' and snode.id) and
+            (snode.id.bl_rna.identifier == "Material")
+        )
 
     def draw(self, context):
         material = context.space_data.id
index a018a64..b6c42d9 100644 (file)
@@ -99,7 +99,7 @@ class SEQUENCER_HT_header(Header):
 
         if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
             layout.separator()
-            layout.operator("sequencer.refresh_all", icon="FILE_REFRESH", text="")
+            layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="")
 
         if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
             layout.prop(st, "display_mode", text="", icon_only=True)
@@ -408,7 +408,7 @@ class SEQUENCER_MT_add_effect(Menu):
         col.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
         col.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
         col.operator("sequencer.effect_strip_add", text="Color Mix").type = 'COLORMIX'
-        col.enabled = sel_sequences(context) >=2
+        col.enabled = sel_sequences(context) >= 2
 
         layout.separator()
 
index d8a8c2a..9d13bd9 100644 (file)
@@ -631,6 +631,7 @@ def _activate_by_item(context, space_type, item, index):
         handle = WindowManager.draw_cursor_add(handle_fn, (context, item, tool), space_type)
         handle_map[space_type] = handle
 
+
 _activate_by_item._cursor_draw_handle = {}
 
 
index 24af3ce..a4ca27e 100644 (file)
@@ -32,6 +32,7 @@ from .space_toolsystem_common import (
     ToolDef,
 )
 
+
 def generate_from_enum_ex(
         context, *,
         icon_prefix,
@@ -873,6 +874,7 @@ class _defs_vertex_paint:
             attr="vertex_tool",
         )
 
+
 class _defs_texture_paint:
 
     @staticmethod
@@ -1108,6 +1110,7 @@ class _defs_gpencil_paint:
             keymap=(),
         )
 
+
 class _defs_gpencil_edit:
     @ToolDef.from_fn
     def bend():
index 7b666d8..67530ba 100644 (file)
@@ -540,7 +540,7 @@ class TOPBAR_PT_gpencil_layers(Panel):
             srow = col.row(align=True)
             srow.prop(gpl, "opacity", text="Opacity", slider=True)
             srow.prop(gpl, "clamp_layer", text="",
-                     icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+                      icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
 
         col = row.column()
 
index 88bfa8a..5411587 100644 (file)
@@ -1571,7 +1571,7 @@ class USERPREF_PT_studiolight_light_editor(Panel):
 
         row = layout.row()
         row.prop(system, "edit_studio_light", toggle=True)
-        row.operator("wm.studiolight_new", text="Save as Studio light", icon="FILE_TICK")
+        row.operator("wm.studiolight_new", text="Save as Studio light", icon='FILE_TICK')
 
         layout.separator()
 
index d6f27a3..3507ddb 100644 (file)
@@ -4417,7 +4417,7 @@ class VIEW3D_PT_shading_lighting(Panel):
                     sub.scale_y = 0.6  # smaller studiolight preview
                     sub.template_icon_view(shading, "studio_light", scale=3)
                 else:
-                    sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon="NONE", toggle=True)
+                    sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon='NONE', toggle=True)
 
                 col = split.column()
                 col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES')
@@ -4426,7 +4426,7 @@ class VIEW3D_PT_shading_lighting(Panel):
                 col = split.column()
 
                 row = col.row()
-                row.prop(shading, "use_world_space_lighting", text="", icon="WORLD", toggle=True)
+                row.prop(shading, "use_world_space_lighting", text="", icon='WORLD', toggle=True)
                 row = row.row()
                 row.active = shading.use_world_space_lighting
                 row.prop(shading, "studiolight_rotate_z", text="Rotation")
@@ -5263,7 +5263,7 @@ class VIEW3D_PT_transform_orientations(Panel):
 
         if orientation:
             row = layout.row(align=False)
-            row.prop(orientation, "name", text="", icon="OBJECT_ORIGIN")
+            row.prop(orientation, "name", text="", icon='OBJECT_ORIGIN')
             row.operator("transform.delete_orientation", text="", icon='X', emboss=False)
 
 
index 24ce5c5..5d7d9f3 100644 (file)
@@ -631,13 +631,12 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
 
         col = layout.column()
 
-
         row = col.row(align=True)
 
         sub = row.row(align=True)
         sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha")
         sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
-        row.prop(brush,"use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON')
+        row.prop(brush, "use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON')
 
         col.active = brush.brush_capabilities.has_overlay
 
@@ -925,6 +924,8 @@ class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, View3DPaintPanel):
             col.operator("sculpt.detail_flood_fill")
 
 # TODO, move to space_view3d.py
+
+
 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
     bl_label = "Options"
@@ -972,6 +973,7 @@ class VIEW3D_PT_sculpt_options_unified(Panel, View3DPaintPanel):
 
         self.unified_paint_settings(layout, context)
 
+
 class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
     bl_parent_id = "VIEW3D_PT_sculpt_options"
@@ -1302,6 +1304,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
         col = flow.column()
         col.prop(ipaint, "use_backface_culling")
 
+
 class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
     bl_parent_id = "VIEW3D_PT_tools_projectpaint"
@@ -1314,6 +1317,7 @@ class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
 
         self.unified_paint_settings(layout, context)
 
+
 class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel):
     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
     bl_label = "Cavity Mask"
@@ -1454,6 +1458,8 @@ class VIEW3D_PT_tools_normal(View3DPanel, Panel):
 # ********** grease pencil object tool panels ****************
 
 # Grease Pencil drawing brushes
+
+
 class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Brush"
@@ -1702,7 +1708,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Sensitivity"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):
@@ -1718,7 +1724,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Strength"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):
@@ -1734,7 +1740,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_jitter(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Jitter"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):