[Bf-blender-cvs] [fa11d41113] master: Cleanup: especially non pep8 parts of Py UI

Campbell Barton noreply at git.blender.org
Sun Mar 19 23:44:58 CET 2017


Commit: fa11d41113514e46038888285e3244858ff5a30c
Author: Campbell Barton
Date:   Mon Mar 20 09:43:18 2017 +1100
Branches: master
https://developer.blender.org/rBfa11d41113514e46038888285e3244858ff5a30c

Cleanup: especially non pep8 parts of Py UI

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

M	release/scripts/startup/bl_operators/anim.py
M	release/scripts/startup/bl_ui/properties_material.py
M	release/scripts/startup/bl_ui/properties_particle.py
M	release/scripts/startup/bl_ui/properties_physics_smoke.py
M	release/scripts/startup/bl_ui/properties_texture.py
M	release/scripts/startup/bl_ui/space_view3d.py

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

diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index e1a0b3c990..78fcf0dd12 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -28,11 +28,11 @@ if "bpy" in locals():
 import bpy
 from bpy.types import Operator
 from bpy.props import (
-        IntProperty,
-        BoolProperty,
-        EnumProperty,
-        StringProperty,
-        )
+    IntProperty,
+    BoolProperty,
+    EnumProperty,
+    StringProperty,
+)
 
 
 class ANIM_OT_keying_set_export(Operator):
@@ -115,30 +115,30 @@ class ANIM_OT_keying_set_export(Operator):
                 # Find material or lamp using this node tree...
                 id_bpy_path = "bpy.data.nodes[\"%s\"]"
                 found = False
-                
+
                 for mat in bpy.data.materials:
                     if mat.node_tree == ksp.id:
                         id_bpy_path = "bpy.data.materials[\"%s\"].node_tree" % (mat.name)
                         found = True
-                        break;
-                        
+                        break
+
                 if not found:
                     for lamp in bpy.data.lamps:
                         if lamp.node_tree == ksp.id:
                             id_bpy_path = "bpy.data.lamps[\"%s\"].node_tree" % (lamp.name)
                             found = True
-                            break;
-                    
+                            break
+
                 if not found:
-                    self.report({'WARN'}, "Could not find material or lamp using Shader Node Tree - %s" % (ksp.id))                    
+                    self.report({'WARN'}, "Could not find material or lamp using Shader Node Tree - %s" % (ksp.id))
             elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"):
                 # Find compositor nodetree using this node tree...
                 for scene in bpy.data.scenes:
                     if scene.node_tree == ksp.id:
                         id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name)
-                        break;
+                        break
                 else:
-                    self.report({'WARN'}, "Could not find scene using Compositor Node Tree - %s" % (ksp.id)) 
+                    self.report({'WARN'}, "Could not find scene using Compositor Node Tree - %s" % (ksp.id))
             else:
                 idtype_list = ksp.id.bl_rna.name.lower() + "s"
                 id_bpy_path = "bpy.data.%s[\"%s\"]" % (idtype_list, ksp.id.name)
@@ -302,9 +302,11 @@ class ClearUselessActions(Operator):
     bl_label = "Clear Useless Actions"
     bl_options = {'REGISTER', 'UNDO'}
 
-    only_unused = BoolProperty(name="Only Unused",
+    only_unused = BoolProperty(
+            name="Only Unused",
             description="Only unused (Fake User only) actions get considered",
-            default=True)
+            default=True,
+            )
 
     @classmethod
     def poll(cls, context):
@@ -393,7 +395,7 @@ class UpdateAnimatedTransformConstraint(Operator):
                     except:
                         pass
                     ret = (data, new_path)
-                    #print(ret)
+                    # print(ret)
 
             return ret
 
@@ -419,4 +421,4 @@ classes = (
     BakeAction,
     ClearUselessActions,
     UpdateAnimatedTransformConstraint,
-)
\ No newline at end of file
+)
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index c384600344..06ae1847d0 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -71,6 +71,7 @@ class MATERIAL_MT_specials(Menu):
 
 
 class MATERIAL_UL_matslots(UIList):
+
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         # assert(isinstance(item, bpy.types.MaterialSlot)
         # ob = data
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index 593312fc07..2c27c68ed9 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -23,11 +23,11 @@ from rna_prop_ui import PropertyPanel
 from bpy.app.translations import pgettext_iface as iface_
 
 from bl_ui.properties_physics_common import (
-        point_cache_ui,
-        effector_weights_ui,
-        basic_force_field_settings_ui,
-        basic_force_field_falloff_ui,
-        )
+    point_cache_ui,
+    effector_weights_ui,
+    basic_force_field_settings_ui,
+    basic_force_field_falloff_ui,
+)
 
 
 def particle_panel_enabled(context, psys):
@@ -108,6 +108,7 @@ def find_modifier(ob, psys):
 
 
 class PARTICLE_UL_particle_systems(bpy.types.UIList):
+
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag):
         ob = data
         psys = item
@@ -117,8 +118,10 @@ class PARTICLE_UL_particle_systems(bpy.types.UIList):
 
             layout.prop(psys, "name", text="", emboss=False, icon_value=icon)
             if md:
-                layout.prop(md, "show_render", emboss=False, icon_only=True, icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON')
-                layout.prop(md, "show_viewport", emboss=False, icon_only=True, icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON')
+                layout.prop(md, "show_render", emboss=False, icon_only=True,
+                            icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON')
+                layout.prop(md, "show_viewport", emboss=False, icon_only=True,
+                            icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON')
 
         elif self.layout_type == 'GRID':
             layout.alignment = 'CENTER'
@@ -401,7 +404,8 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
                 label = "ERROR"
                 icon = 'ERROR'
             box.label(label, icon=icon)
-            box.label("Iterations: %d .. %d (avg. %d)" % (result.min_iterations, result.max_iterations, result.avg_iterations))
+            box.label("Iterations: %d .. %d (avg. %d)" %
+                      (result.min_iterations, result.max_iterations, result.avg_iterations))
             box.label("Error: %.5f .. %.5f (avg. %.5f)" % (result.min_error, result.max_error, result.avg_error))
 
 
@@ -423,7 +427,12 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel):
         phystype = psys.settings.physics_type
         if phystype == 'NO' or phystype == 'KEYED':
             return False
-        return (psys.settings.type in {'EMITTER', 'REACTOR'} or (psys.settings.type == 'HAIR' and (psys.use_hair_dynamics or psys.point_cache.is_baked))) and engine in cls.COMPAT_ENGINES
+        return (
+            (psys.settings.type in {'EMITTER', 'REACTOR'} or
+             (psys.settings.type == 'HAIR' and
+              (psys.use_hair_dynamics or psys.point_cache.is_baked))) and
+            engine in cls.COMPAT_ENGINES
+        )
 
     def draw(self, context):
         psys = context.particle_system
@@ -743,7 +752,8 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                 layout.label(text="Fluid interaction:")
 
             row = layout.row()
-            row.template_list("UI_UL_list", "particle_targets", psys, "targets", psys, "active_particle_target_index", rows=4)
+            row.template_list("UI_UL_list", "particle_targets", psys, "targets",
+                              psys, "active_particle_target_index", rows=4)
 
             col = row.column()
             sub = col.row()
@@ -760,7 +770,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                 row = layout.row()
                 if part.physics_type == 'KEYED':
                     col = row.column()
-                    #doesn't work yet
+                    # doesn't work yet
                     #col.alert = key.valid
                     col.prop(key, "object", text="")
                     col.prop(key, "system", text="System")
@@ -770,7 +780,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                     col.prop(key, "duration")
                 elif part.physics_type == 'BOIDS':
                     sub = row.row()
-                    #doesn't work yet
+                    # doesn't work yet
                     #sub.alert = key.valid
                     sub.prop(key, "object", text="")
                     sub.prop(key, "system", text="System")
@@ -778,7 +788,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
                     layout.prop(key, "alliance", expand=True)
                 elif part.physics_type == 'FLUID':
                     sub = row.row()
-                    #doesn't work yet
+                    # doesn't work yet
                     #sub.alert = key.valid
                     sub.prop(key, "object", text="")
                     sub.prop(key, "system", text="System")
@@ -831,7 +841,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
             row.label(text="")
 
         row = layout.row()
-        row.template_list("UI_UL_list", "particle_boids_rules", state, "rules", state, "active_boid_rule_index", rows=4)
+        row.template_list("UI_UL_list", "particle_boids_rules", state,
+                          "rules", state, "active_boid_rule_index", rows=4)
 
         col = row.column()
         sub = col.row()
@@ -848,7 +859,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel):
         if rule:
             row = layout.row()
             row.prop(rule, "name", text="")
-            #somebody make nice icons for boids here please! -jahka
+            # somebody make nice icons for boids here please! -jahka
             row.prop(rule, "use_in_air", icon='TRIA_UP', text="")
             row.prop(rule, "use_on_land", icon='TRIA_DOWN', text="")
 
diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py
index e6182c2ec7..f2e6c1e22e 100644
--- a/release/scripts/startup/bl_ui

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list