From 97d62f018397d279f6f1654c76d1e6b414c9d343 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2013 23:15:32 +0000 Subject: style cleanup --- release/scripts/startup/bl_operators/node.py | 4 +++- release/scripts/startup/bl_operators/object.py | 26 +++++++++++----------- release/scripts/startup/bl_operators/presets.py | 10 ++++----- .../startup/bl_operators/uvcalc_follow_active.py | 15 ++++++------- .../startup/bl_operators/uvcalc_lightmap.py | 16 ++++++------- release/scripts/startup/bl_operators/wm.py | 2 +- 6 files changed, 37 insertions(+), 36 deletions(-) (limited to 'release/scripts/startup/bl_operators') diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index 39e00f94953..bc0224db765 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -22,6 +22,7 @@ import bpy from bpy.types import Operator from bpy.props import BoolProperty, EnumProperty, StringProperty + # Base class for node 'Add' operators class NodeAddOperator(): @staticmethod @@ -78,8 +79,9 @@ class NODE_OT_add_node(NodeAddOperator, Operator): use_transform = BoolProperty( name="Use Transform", description="Start transform operator after inserting the node", - default = False, + default=False, ) + def execute(self, context): node = self.create_node(context, self.type) diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index d6a0e30b110..567ea830409 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -111,10 +111,10 @@ class SelectCamera(Operator): bl_options = {'REGISTER', 'UNDO'} extend = BoolProperty( - name="Extend", - description="Extend the selection", - default=False - ) + name="Extend", + description="Extend the selection", + default=False + ) def execute(self, context): scene = context.scene @@ -305,7 +305,7 @@ class ShapeTransfer(Operator): ('RELATIVE_EDGE', "Relative Edge", "Calculate relative position (using edges)", - ), + ), ), name="Transformation Mode", description="Relative shape positions to the new shape method", @@ -682,7 +682,7 @@ class TransformsToDeltasAnim(Operator): "scale" : "delta_scale" } DELTA_PATHS = STANDARD_TO_DELTA_PATHS.values() - + # try to apply on each selected object success = False for obj in context.selected_editable_objects: @@ -692,7 +692,7 @@ class TransformsToDeltasAnim(Operator): "No animation data to convert on object: %r" % obj.name) continue - + # first pass over F-Curves: ensure that we don't have conflicting # transforms already (e.g. if this was applied already) [#29110] existingFCurves = {} @@ -708,7 +708,7 @@ class TransformsToDeltasAnim(Operator): else: # non-transform - ignore continue - + # a delta path like this for the same index shouldn't # exist already, otherwise we've got a conflict if dpath in existingFCurves: @@ -716,8 +716,9 @@ class TransformsToDeltasAnim(Operator): if fcu.array_index in existingFCurves[dpath]: # conflict self.report({'ERROR'}, - "Object '%r' already has '%r' F-Curve(s). Remove these before trying again" % - (obj.name, dpath)) + "Object '%r' already has '%r' F-Curve(s). " + "Remove these before trying again" % + (obj.name, dpath)) return {'CANCELLED'} else: # no conflict here @@ -725,8 +726,7 @@ class TransformsToDeltasAnim(Operator): else: # no conflict yet existingFCurves[dpath] = [fcu.array_index] - - + # if F-Curve uses standard transform path # just append "delta_" to this path for fcu in adt.action.fcurves: @@ -766,7 +766,7 @@ class DupliOffsetFromCursor(Operator): @classmethod def poll(cls, context): - return context.active_object is not None + return (context.active_object is not None) def execute(self, context): scene = context.scene diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index ae4079e35aa..dac7adecaff 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -320,13 +320,13 @@ class AddPresetFluid(AddPresetBase, Operator): preset_menu = "FLUID_MT_presets" preset_defines = [ - "fluid = bpy.context.fluid" - ] + "fluid = bpy.context.fluid" + ] preset_values = [ - "fluid.settings.viscosity_base", - "fluid.settings.viscosity_exponent", - ] + "fluid.settings.viscosity_base", + "fluid.settings.viscosity_exponent", + ] preset_subdir = "fluid" diff --git a/release/scripts/startup/bl_operators/uvcalc_follow_active.py b/release/scripts/startup/bl_operators/uvcalc_follow_active.py index 7b6013f3044..ee3ae2878dc 100644 --- a/release/scripts/startup/bl_operators/uvcalc_follow_active.py +++ b/release/scripts/startup/bl_operators/uvcalc_follow_active.py @@ -26,18 +26,18 @@ from bpy.types import Operator def extend(obj, operator, EXTEND_MODE): - + import bmesh me = obj.data # script will fail without UVs if not me.uv_textures: me.uv_textures.new() - + bm = bmesh.from_edit_mesh(me) - + f_act = bm.faces.active uv_act = bm.loops.layers.uv.active - + if f_act is None: operator.report({'ERROR'}, "No active face") return @@ -57,7 +57,7 @@ def extend(obj, operator, EXTEND_MODE): f.tag = False # tag the active face True since we begin there f_act.tag = True - + def walk_face(f): # all faces in this list must be tagged f.tag = True @@ -102,7 +102,6 @@ def extend(obj, operator, EXTEND_MODE): else: break - def extrapolate_uv(fac, l_a_outer, l_a_inner, l_b_outer, l_b_inner): @@ -112,7 +111,7 @@ def extend(obj, operator, EXTEND_MODE): def apply_uv(f_prev, l_prev, f_next): l_a = [None, None, None, None] l_b = [None, None, None, None] - + l_a[0] = l_prev l_a[1] = l_a[0].link_loop_next l_a[2] = l_a[1].link_loop_next @@ -133,7 +132,7 @@ def extend(obj, operator, EXTEND_MODE): # +-----------+ # copy from this face to the one above. - # get the other loops + # get the other loops l_next = l_prev.link_loop_radial_next if l_next.vert != l_prev.vert: l_b[1] = l_next diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py index 198b3660ff8..6cb9e7276fd 100644 --- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py +++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py @@ -189,14 +189,14 @@ class prettyface(object): def lightmap_uvpack(meshes, - PREF_SEL_ONLY=True, - PREF_NEW_UVLAYER=False, - PREF_PACK_IN_ONE=False, - PREF_APPLY_IMAGE=False, - PREF_IMG_PX_SIZE=512, - PREF_BOX_DIV=8, - PREF_MARGIN_DIV=512 - ): + PREF_SEL_ONLY=True, + PREF_NEW_UVLAYER=False, + PREF_PACK_IN_ONE=False, + PREF_APPLY_IMAGE=False, + PREF_IMG_PX_SIZE=512, + PREF_BOX_DIV=8, + PREF_MARGIN_DIV=512 + ): """ BOX_DIV if the maximum division of the UV map that a box may be consolidated into. diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index b33a10b671e..6c418902433 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1584,7 +1584,7 @@ class WM_OT_addon_enable(Operator): "version %d.%d.%d and might not " "function (correctly), " "though it is enabled") % - info_ver) + info_ver) return {'FINISHED'} else: return {'CANCELLED'} -- cgit v1.2.3