From 82783cd0cd8e742611adb83327431e91806a39db Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 14 Mar 2011 23:17:52 +0000 Subject: pep8 edits and remove commented code from last commit. --- release/scripts/modules/bpy_types.py | 1 + release/scripts/modules/io_utils.py | 4 +-- release/scripts/op/vertexpaint_dirt.py | 1 + release/scripts/ui/properties_material.py | 2 -- release/scripts/ui/properties_object_constraint.py | 15 +++++---- release/scripts/ui/properties_particle.py | 36 +++++++++++----------- release/scripts/ui/space_userpref.py | 27 ++-------------- 7 files changed, 31 insertions(+), 55 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index eff59668e9c..c3352dd33ad 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -28,6 +28,7 @@ StructMetaPropGroup = _bpy.StructMetaPropGroup bpy_types.BlendDataLibraries.load = _bpy._library_load + class Context(StructRNA): __slots__ = () diff --git a/release/scripts/modules/io_utils.py b/release/scripts/modules/io_utils.py index 0b333d29377..10729c465b7 100644 --- a/release/scripts/modules/io_utils.py +++ b/release/scripts/modules/io_utils.py @@ -25,7 +25,7 @@ from bpy.props import StringProperty, BoolProperty class ExportHelper: filepath = StringProperty(name="File Path", description="Filepath used for exporting the file", maxlen=1024, default="", subtype='FILE_PATH') check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) - + # subclasses can override with decorator # True == use ext, False == no ext, None == do nothing. check_extension = True @@ -46,7 +46,7 @@ class ExportHelper: def check(self, context): check_extension = self.check_extension - + if check_extension is None: return False diff --git a/release/scripts/op/vertexpaint_dirt.py b/release/scripts/op/vertexpaint_dirt.py index 82bc25e1b47..8795355d168 100644 --- a/release/scripts/op/vertexpaint_dirt.py +++ b/release/scripts/op/vertexpaint_dirt.py @@ -30,6 +30,7 @@ # but results are far more accurate # + def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only): from mathutils import Vector from math import acos diff --git a/release/scripts/ui/properties_material.py b/release/scripts/ui/properties_material.py index a8fe05ca110..7fb333c4364 100644 --- a/release/scripts/ui/properties_material.py +++ b/release/scripts/ui/properties_material.py @@ -624,7 +624,6 @@ class MATERIAL_PT_physics(MaterialButtonsPanel, bpy.types.Panel): row.prop(phys, "friction") row.prop(phys, "elasticity", slider=True) - row = layout.row() row.label(text="Force Field:") @@ -775,7 +774,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): col.prop(mat, "use_cast_approximate") - class MATERIAL_PT_transp_game(MaterialButtonsPanel, bpy.types.Panel): bl_label = "Transparency" bl_options = {'DEFAULT_CLOSED'} diff --git a/release/scripts/ui/properties_object_constraint.py b/release/scripts/ui/properties_object_constraint.py index 9cc2b7637d4..b4822b675a9 100644 --- a/release/scripts/ui/properties_object_constraint.py +++ b/release/scripts/ui/properties_object_constraint.py @@ -556,44 +556,44 @@ class ConstraintButtonsPanel(): elif con.pivot_type == 'GENERIC_6_DOF': layout.label(text="Limits:") split = layout.split() - + col = split.column(align=True) col.prop(con, "use_limit_x", text="X") sub = col.column() sub.active = con.use_limit_x sub.prop(con, "limit_min_x", text="Min") sub.prop(con, "limit_max_x", text="Max") - + col = split.column(align=True) col.prop(con, "use_limit_y", text="Y") sub = col.column() sub.active = con.use_limit_y sub.prop(con, "limit_min_y", text="Min") sub.prop(con, "limit_max_y", text="Max") - + col = split.column(align=True) col.prop(con, "use_limit_z", text="Z") sub = col.column() sub.active = con.use_limit_z sub.prop(con, "limit_min_z", text="Min") sub.prop(con, "limit_max_z", text="Max") - + split = layout.split() - + col = split.column(align=True) col.prop(con, "use_angular_limit_x", text="Angle X") sub = col.column() sub.active = con.use_angular_limit_x sub.prop(con, "limit_angle_min_x", text="Min") sub.prop(con, "limit_angle_max_x", text="Max") - + col = split.column(align=True) col.prop(con, "use_angular_limit_y", text="Angle Y") sub = col.column() sub.active = con.use_angular_limit_y sub.prop(con, "limit_angle_min_y", text="Min") sub.prop(con, "limit_angle_max_y", text="Max") - + col = split.column(align=True) col.prop(con, "use_angular_limit_z", text="Angle Z") sub = col.column() @@ -790,4 +790,3 @@ def unregister(): if __name__ == "__main__": register() - diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py index 73bd48fdb41..8201daacc4f 100644 --- a/release/scripts/ui/properties_particle.py +++ b/release/scripts/ui/properties_particle.py @@ -407,7 +407,7 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel): row = layout.row() row.label(text="Initial Rotation:") row.prop(part, "use_dynamic_rotation") - + split = layout.split() col = split.column(align=True) @@ -417,7 +417,7 @@ class PARTICLE_PT_rotation(ParticleButtonsPanel, bpy.types.Panel): col = split.column(align=True) col.prop(part, "phase_factor", slider=True) col.prop(part, "phase_factor_random", text="Random", slider=True) - + col = layout.column() col.label(text="Angular Velocity:") col.row().prop(part, "angular_velocity_mode", expand=True) @@ -464,53 +464,53 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel): if part.physics_type in ('NEWTON', 'FLUID'): split = layout.split() - + col = split.column() col.label(text="Forces:") col.prop(part, "brownian_factor") col.prop(part, "drag_factor", slider=True) col.prop(part, "damping", slider=True) - + col = split.column() col.label(text="Integration:") col.prop(part, "integrator", text="") col.prop(part, "time_tweak") col.prop(part, "subframes") - + row = layout.row() row.prop(part, "use_size_deflect") row.prop(part, "use_die_on_collision") - + if part.physics_type == 'FLUID': fluid = part.fluid - + split = layout.split() - + col = split.column() col.label(text="Fluid properties:") col.prop(fluid, "stiffness", text="Stiffness") col.prop(fluid, "linear_viscosity", text="Viscosity") col.prop(fluid, "buoyancy", text="Buoancy", slider=True) - + col = split.column() col.label(text="Advanced:") sub = col.row() sub.prop(fluid, "repulsion", slider=fluid.factor_repulsion) sub.prop(fluid, "factor_repulsion", text="") - + sub = col.row() sub.prop(fluid, "stiff_viscosity", slider=fluid.factor_stiff_viscosity) sub.prop(fluid, "factor_stiff_viscosity", text="") - + sub = col.row() sub.prop(fluid, "fluid_radius", slider=fluid.factor_radius) sub.prop(fluid, "factor_radius", text="") - + sub = col.row() sub.prop(fluid, "rest_density", slider=fluid.factor_density) sub.prop(fluid, "factor_density", text="") - + split = layout.split() col = split.column() @@ -521,7 +521,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel): sub.active = fluid.use_viscoelastic_springs sub.prop(fluid, "yield_ratio", slider=True) sub.prop(fluid, "plasticity", slider=True) - + col = split.column() col.label(text="Advanced:") sub = col.row() @@ -532,7 +532,6 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, bpy.types.Panel): sub.active = fluid.use_viscoelastic_springs sub.prop(fluid, "use_initial_rest_length") sub.prop(fluid, "spring_frames", text="Frames") - elif part.physics_type == 'KEYED': split = layout.split() @@ -772,7 +771,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): col = split.column() col.prop(part, "use_render_emitter") col.prop(part, "use_parent_particles") - + col = split.column() col.prop(part, "show_unborn") col.prop(part, "use_dead") @@ -786,7 +785,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): if part.render_type == 'LINE': col.prop(part, "line_length_tail") col.prop(part, "line_length_head") - + split.prop(part, "use_velocity_length") elif part.render_type == 'PATH': col.prop(part, "use_strand_primitive") @@ -831,7 +830,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): elif part.render_type == 'GROUP': col.prop(part, "dupli_group") split = layout.split() - + col = split.column() col.prop(part, "use_whole_group") sub = col.column() @@ -915,6 +914,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): row.prop(part, "particle_size") row.prop(part, "size_random", slider=True) + class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel): bl_label = "Display" bl_options = {'DEFAULT_CLOSED'} diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 202d5cdbed4..89f703d8981 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -853,8 +853,6 @@ class USERPREF_PT_addons(bpy.types.Panel): bl_region_type = 'WINDOW' bl_options = {'HIDE_HEADER'} - # _addons_cats = None - # _addons_sups = None _addons_fake_modules = {} @classmethod @@ -875,27 +873,6 @@ class USERPREF_PT_addons(bpy.types.Panel): # collect the categories that can be filtered on addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)] - # XXX. we need dynamic enums to properly support this. - """ - cats = {info["category"] for mod, info in addons} - cats.discard("") - - if USERPREF_PT_addons._addons_cats != cats: - bpy.types.WindowManager.addon_filter = EnumProperty(items=[(cat, cat, "") for cat in ["All", "Enabled", "Disabled"] + sorted(cats)], name="Category", description="Filter add-ons by category") - bpy.types.WindowManager.addon_search = StringProperty(name="Search", description="Search within the selected filter") - USERPREF_PT_addons._addons_cats = cats - - [('All', 'All', ''), ('Enabled', 'Enabled', ''), ('Disabled', 'Disabled', ''), ('3D View', '3D View', ''), ('Add Curve', 'Add Curve', ''), ('Add Mesh', 'Add Mesh', ''), ('Animation', 'Animation', ''), ('Development', 'Development', ''), ('Game Engine', 'Game Engine', ''), ('Import-Export', 'Import-Export', ''), ('Mesh', 'Mesh', ''), ('Object', 'Object', ''), ('Render', 'Render', ''), ('Rigging', 'Rigging', ''), ('System', 'System', '')] - - sups_default = {'OFFICIAL', 'COMMUNITY'} - sups = sups_default | {info["support"] for mod, info in addons} - sups.discard("") - - if USERPREF_PT_addons._addons_sups != sups: - bpy.types.WindowManager.addon_support = EnumProperty(items=[(sup, sup.title(), "") for sup in reversed(sorted(sups))], name="Support", description="Display support level", default=sups_default, options={'ENUM_FLAG'}) - USERPREF_PT_addons._addons_sups = sups - """ - split = layout.split(percentage=0.2) col = split.column() col.prop(context.window_manager, "addon_search", text="", icon='VIEWZOOM') @@ -1216,8 +1193,8 @@ def register(): ('Object', "Object", ""), ('Render', "Render", ""), ('Rigging', "Rigging", ""), - ('System', "System", "") - ], + ('System', "System", "") + ], name="Category", description="Filter add-ons by category", ) -- cgit v1.2.3