cleanup for python scripts - unused vars and imports

This commit is contained in:
Campbell Barton 2011-07-10 12:51:37 +00:00
parent 7370ba1839
commit b62a956cc8
11 changed files with 9 additions and 20 deletions

@ -48,8 +48,6 @@ def paths():
def modules(module_cache):
import os
import sys
import time
path_list = paths()
@ -173,11 +171,9 @@ def enable(module_name, default_set=True):
:return: the loaded module or None on failier.
:rtype: module
"""
# note, this still gets added to _bpy_types.TypeMap
import os
import sys
import bpy_types as _bpy_types
import imp
def handle_error():
@ -246,8 +242,6 @@ def disable(module_name, default_set=True):
:type module_name: string
"""
import sys
import bpy_types as _bpy_types
mod = sys.modules.get(module_name)
# possible this addon is from a previous session and didnt load a module this time.

@ -22,7 +22,6 @@ __all__ = (
"region_2d_to_vector_3d",
"region_2d_to_location_3d",
"location_3d_to_region_2d",
"location_3d_to_region_2d",
)

@ -241,7 +241,7 @@ class _GenericBone:
chain.append(child)
else:
if len(children_basename):
print("multiple basenames found, this is probably not what you want!", bone.name, children_basename)
print("multiple basenames found, this is probably not what you want!", self.name, children_basename)
break

@ -22,7 +22,6 @@
import bpy as _bpy
import bpyml
from bpyml import TAG, ARGS, CHILDREN
from types import ModuleType
_uilayout_rna = _bpy.types.UILayout.bl_rna

@ -114,7 +114,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
to_dict = getattr(val, "to_dict", None)
to_list = getattr(val, "to_list", None)
val_orig = val
# val_orig = val # UNUSED
if to_dict:
val = to_dict()
val_draw = str(val)

@ -121,7 +121,6 @@ class ProjectEdit(bpy.types.Operator):
def execute(self, context):
import os
import subprocess
EXT = "png" # could be made an option but for now ok

@ -87,8 +87,6 @@ class MeshMirrorUV(bpy.types.Operator):
def execute(self, context):
DIR = (self.direction == 'NEGATIVE')
from mathutils import Vector
ob = context.active_object
is_editmode = (ob.mode == 'EDIT')
if is_editmode:

@ -98,8 +98,6 @@ def align_objects(align_x, align_y, align_z, align_mode, relative_to):
# Main Loop
for obj, bb_world in objs:
loc_world = obj.location
bb_world = [Vector(v[:]) * obj.matrix_world for v in obj.bound_box]
Left_Up_Front = bb_world[1]

@ -78,7 +78,7 @@ class PlayRenderedAnim(bpy.types.Operator):
preset = prefs.filepaths.animation_player_preset
player_path = prefs.filepaths.animation_player
file_path = bpy.path.abspath(rd.filepath)
# file_path = bpy.path.abspath(rd.filepath) # UNUSED
is_movie = rd.is_movie_format
# try and guess a command line if it doesn't exist

@ -42,7 +42,6 @@ def extend(obj, operator, EXTEND_MODE):
edge_average_lengths = {}
OTHER_INDEX = 2, 3, 0, 1
FAST_INDICIES = 0, 2, 1, 3 # order is faster
def extend_uvs(face_source, face_target, edge_key):
'''

@ -444,7 +444,7 @@ def lightmap_uvpack(meshes,
del even_dict
del odd_dict
orig = len(pretty_faces)
# orig = len(pretty_faces)
pretty_faces = [pf for pf in pretty_faces if not pf.has_parent]
@ -489,7 +489,10 @@ def lightmap_uvpack(meshes,
if PREF_APPLY_IMAGE:
if not PREF_PACK_IN_ONE:
image = Image.New("lightmap", PREF_IMG_PX_SIZE, PREF_IMG_PX_SIZE, 24)
image = bpy.data.images.new(name="lightmap",
width=PREF_IMG_PX_SIZE,
height=PREF_IMG_PX_SIZE,
)
for f in face_sel:
# f.image = image
@ -530,7 +533,7 @@ def unwrap(operator, context, **kwargs):
return {'FINISHED'}
from bpy.props import BoolProperty, FloatProperty, IntProperty, EnumProperty
from bpy.props import BoolProperty, FloatProperty, IntProperty
class LightMapPack(bpy.types.Operator):