[Bf-blender-cvs] [165afb3ad09] master: Cleanup: pep8, unused vars, line length

Campbell Barton noreply at git.blender.org
Mon Dec 16 04:55:04 CET 2019


Commit: 165afb3ad097a8e89ab3b8547b7e947029a23fe2
Author: Campbell Barton
Date:   Mon Dec 16 14:29:03 2019 +1100
Branches: master
https://developer.blender.org/rB165afb3ad097a8e89ab3b8547b7e947029a23fe2

Cleanup: pep8, unused vars, line length

===================================================================

M	release/scripts/startup/bl_operators/rigidbody.py
M	release/scripts/startup/bl_operators/uvcalc_smart_project.py
M	release/scripts/startup/bl_operators/vertexpaint_dirt.py
M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/properties_paint_common.py
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_physics_cloth.py
M	release/scripts/startup/bl_ui/space_dopesheet.py
M	release/scripts/startup/bl_ui/space_filebrowser.py
M	release/scripts/startup/bl_ui/space_graph.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_toolsystem_common.py
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
index 97149133dec..bc80500c888 100644
--- a/release/scripts/startup/bl_operators/rigidbody.py
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -241,7 +241,8 @@ class ConnectRigidBodies(Operator):
         description="Pattern used to connect objects",
         items=(
             ('SELECTED_TO_ACTIVE', "Selected to Active", "Connect selected objects to the active object"),
-            ('CHAIN_DISTANCE', "Chain by Distance", "Connect objects as a chain based on distance, starting at the active object"),
+            ('CHAIN_DISTANCE', "Chain by Distance", "Connect objects as a chain based on distance, "
+             "starting at the active object"),
         ),
         default='SELECTED_TO_ACTIVE',
     )
diff --git a/release/scripts/startup/bl_operators/uvcalc_smart_project.py b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
index 4e61874b440..1f56cbe6d57 100644
--- a/release/scripts/startup/bl_operators/uvcalc_smart_project.py
+++ b/release/scripts/startup/bl_operators/uvcalc_smart_project.py
@@ -283,7 +283,16 @@ def mergeUvIslands(islandList):
         # UV Edge list used for intersections as well as unique points.
         edges, uniqueEdgePoints = island2Edge(islandList[islandIdx])
 
-        decoratedIslandList.append([islandList[islandIdx], totFaceArea, efficiency, islandBoundsArea, w, h, edges, uniqueEdgePoints])
+        decoratedIslandList.append([
+            islandList[islandIdx],
+            totFaceArea,
+            efficiency,
+            islandBoundsArea,
+            w,
+            h,
+            edges,
+            uniqueEdgePoints,
+        ])
 
     # Sort by island bounding box area, smallest face area first.
     # no.. chance that to most simple edge loop first.
@@ -389,7 +398,8 @@ def mergeUvIslands(islandList):
 
                             # testcount+=1
                             # print 'Testing intersect'
-                            Intersect = islandIntersectUvIsland(sourceIsland, targetIsland, Vector((boxLeft, boxBottom)))
+                            Intersect = islandIntersectUvIsland(
+                                sourceIsland, targetIsland, Vector((boxLeft, boxBottom)))
                             # print 'Done', Intersect
                             if Intersect == 1:  # Line intersect, don't bother with this any more
                                 pass
diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
index 1f982c331fb..39d792bd557 100644
--- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py
+++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
@@ -176,7 +176,14 @@ class VertexPaintDirt(Operator):
         obj = context.object
         mesh = obj.data
 
-        ret = applyVertexDirt(mesh, self.blur_iterations, self.blur_strength, self.dirt_angle, self.clean_angle, self.dirt_only)
+        ret = applyVertexDirt(
+            mesh,
+            self.blur_iterations,
+            self.blur_strength,
+            self.dirt_angle,
+            self.clean_angle,
+            self.dirt_only,
+        )
 
         return ret
 
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index c872b9acd4a..4fe6a5ac19b 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -2414,6 +2414,7 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
         row.prop(md, "layer_pass", text="Pass")
         row.prop(md, "invert_layer_pass", text="", icon='ARROW_LEFTRIGHT')
 
+
 classes = (
     DATA_PT_modifiers,
     DATA_PT_gpencil_modifiers,
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 b97571e4547..de08713c3e3 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -160,6 +160,7 @@ class GreasePencilSculptOptionsPanel:
 
             layout.prop(settings, "use_edit_uv", text="Affect UV")
 
+
 # GP Object Tool Settings
 class GreasePencilDisplayPanel:
     bl_label = "Brush Tip"
@@ -175,9 +176,11 @@ class GreasePencilDisplayPanel:
             else:
                 # GP Sculpt and Weight Paint always have Brush Tip panel.
                 return True
+        return False
 
     def draw_header(self, context):
-        if self.is_popover: return
+        if self.is_popover:
+            return
 
         if context.mode == 'PAINT_GPENCIL':
             brush = context.tool_settings.gpencil_paint.brush
@@ -506,7 +509,7 @@ class GPENCIL_MT_move_to_layer(Menu):
             gpl_active = context.active_gpencil_layer
             tot_layers = len(gpd.layers)
             i = tot_layers - 1
-            while(i >= 0):
+            while i >= 0:
                 gpl = gpd.layers[i]
                 if gpl.info == gpl_active.info:
                     icon = 'GREASEPENCIL'
@@ -716,12 +719,11 @@ class GreasePencilToolsPanel:
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
-    def poll(cls, context):
+    def poll(cls, _context):
         # XXX - disabled in 2.8 branch.
+        # return (context.gpencil_data is not None)
         return False
 
-        return (context.gpencil_data is not None)
-
     def draw(self, context):
         layout = self.layout
 
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 32df73f02fa..3c30d3655e0 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -27,7 +27,8 @@ class UnifiedPaintPanel:
 
     @staticmethod
     def get_brush_mode(context):
-        """Get the correct mode for this context. For any context where this returns None, no brush options should be displayed."""
+        """ Get the correct mode for this context. For any context where this returns None,
+            no brush options should be displayed."""
 
         if context.mode == 'PARTICLE':
             # Particle brush settings currently completely do their own thing.
@@ -61,6 +62,7 @@ class UnifiedPaintPanel:
                     else:
                         return None
                 return context.mode
+        return None
 
     @staticmethod
     def paint_settings(context):
@@ -89,22 +91,35 @@ class UnifiedPaintPanel:
             return tool_settings.gpencil_paint
         elif mode in {'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}:
             return tool_settings.gpencil_sculpt
+        return False
 
     @staticmethod
-    def prop_unified(layout, context, brush, prop_name, unified_name=None, pressure_name=None, icon='NONE', text=None, slider=False, display_unified_toggle=True):
-        """ Generalized way of adding brush options to the UI, along with their pen pressure setting and global toggle, if they exist """
+    def prop_unified(
+            layout,
+            context,
+            brush,
+            prop_name,
+            unified_name=None,
+            pressure_name=None,
+            icon='NONE',
+            text=None,
+            slider=False,
+            display_unified_toggle=True,
+    ):
+        """ Generalized way of adding brush options to the UI,
+            along with their pen pressure setting and global toggle, if they exist. """
         row = layout.row(align=True)
         ups = context.tool_settings.unified_paint_settings
         prop_owner = brush
-        if(unified_name and getattr(ups, unified_name) and display_unified_toggle):
+        if unified_name and getattr(ups, unified_name) and display_unified_toggle:
             prop_owner = ups
 
         row.prop(prop_owner, prop_name, icon=icon, text=text, slider=slider)
 
-        if(pressure_name):
+        if pressure_name:
             row.prop(brush, pressure_name, text="")
 
-        if(unified_name and display_unified_toggle):
+        if unified_name and display_unified_toggle:
             row.prop(ups, unified_name, text="", icon="WORLD")
 
         return row
@@ -138,7 +153,7 @@ class BrushSelectPanel(BrushPanel):
         brush = settings.brush
 
         row = layout.row()
-        large_preview=True
+        large_preview = True
         if large_preview:
             row.column().template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8, hide_buttons=False)
         else:
@@ -170,6 +185,7 @@ class ColorPalettePanel(BrushPanel):
         elif context.vertex_paint_object:
             capabilities = brush.vertex_paint_capabilities
             return capabilities.has_color
+        return False
 
     def draw(self, context):
         layout = self.layout
@@ -195,6 +211,7 @@ class ClonePanel(BrushPanel):
         if mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
             brush = settings.brush
             return brush.image_tool == 'CLONE'
+        return False
 
     def draw_header(self, context):
         settings = self.paint_settings(context)
@@ -203,7 +220,6 @@ class ClonePanel(BrushPanel):
     def draw(self, context):
         layout = self.layout
         settings = self.paint_settings(context)
-        brush = settings.brush
 
         layout.active = settings.use_clone_layer
 
@@ -213,16 +229,22 @@ class ClonePanel(BrushPanel):
         if settings.mode == 'MATERIAL':
             if len(ob.material_slots) > 1:
                 col.label(text="Materials")
-                col.template_list("MATERIAL_UL_matslots", "",
-                                ob, "material_slots",
-                                ob, "active_material_index", rows=2)
+                col.template_list(
+                    "MATERIAL_UL_matslots", "",
+                    ob, "material_slots",
+                    ob, "active_material_index",
+                    rows=2,
+                )
 
             mat = ob.active_material
             if mat:
                 col.label(text="Source Clone Slot")
-                col.template_list("TEXTURE_UL_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list