Skip to content

Commit

Permalink
replace imports from *, considered bad practice by python devs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasman42 committed Feb 27, 2011
1 parent 8bc9aa9 commit ebeeb59
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion io_anim_bvh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty, FloatProperty, IntProperty, BoolProperty, EnumProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_anim_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def writeCameras(context, filepath, frame_start, frame_end, only_selected=False)
fw("\n")


from bpy.props import *
from bpy.props import StringProperty, IntProperty, BoolProperty
from io_utils import ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_curve_svg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_import_scene_lwo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ def build_objects(object_layers, object_surfs, object_tags, object_name, add_sub
print("Done Importing LWO File")


from bpy.props import *
from bpy.props import StringProperty, BoolProperty


class IMPORT_OT_lwo(bpy.types.Operator):
Expand Down
8 changes: 4 additions & 4 deletions io_import_scene_mhx.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
import os
import time
import mathutils
from mathutils import *
from mathutils import Matrix
#import geometry
#import string

Expand Down Expand Up @@ -2144,7 +2144,7 @@ def parseProcess(args, tokens):
elif key == 'Bend':
axis = val[1]
angle = float(val[2])
mat = mathutils.Matrix.Rotation(angle, 4, axis)
mat = Matrix.Rotation(angle, 4, axis)
try:
pb = pbones[val[0]]
prod = pb.matrix_local * mat
Expand Down Expand Up @@ -2602,8 +2602,8 @@ def writeDefaults():
# User interface
#

DEBUG= False
from bpy.props import *
DEBUG = False
from bpy.props import StringProperty, FloatProperty, EnumProperty
from io_utils import ImportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_mesh_ply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

import os
import bpy
from bpy.props import *
from bpy.props import CollectionProperty, StringProperty, BoolProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
19 changes: 12 additions & 7 deletions io_mesh_stl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@

if "bpy" in locals():
import imp
imp.reload(stl_utils)
imp.reload(blender_utils)
else:
from . import stl_utils
from . import blender_utils
if "stl_utils" in locals():
imp.reload(stl_utils)
if "blender_utils" in locals():
imp.reload(blender_utils)

import itertools
import os

import bpy
from bpy.props import *
from bpy.props import StringProperty, BoolProperty, CollectionProperty
from io_utils import ExportHelper, ImportHelper


Expand All @@ -82,6 +80,9 @@ class ImportSTL(bpy.types.Operator, ImportHelper):
directory = StringProperty()

def execute(self, context):
from . import stl_utils
from . import blender_utils

paths = [os.path.join(self.directory, name.name) for name in self.files]

if not paths:
Expand Down Expand Up @@ -114,6 +115,10 @@ class ExportSTL(bpy.types.Operator, ExportHelper):
default=True)

def execute(self, context):
from . import stl_utils
from . import blender_utils
import itertools

faces = itertools.chain.from_iterable(
blender_utils.faces_from_mesh(ob, self.apply_modifiers)
for ob in context.selected_objects)
Expand Down
2 changes: 1 addition & 1 deletion io_scene_3ds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty, FloatProperty, BoolProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_scene_fbx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty, BoolProperty, FloatProperty
from io_utils import ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_scene_m3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import time
import datetime
import bpy
from bpy.props import *
from bpy.props import StringProperty, BoolProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_scene_obj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


import bpy
from bpy.props import *
from bpy.props import BoolProperty, FloatProperty, StringProperty
from io_utils import ExportHelper, ImportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_scene_x3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty, BoolProperty
from io_utils import ImportHelper, ExportHelper


Expand Down
2 changes: 1 addition & 1 deletion io_shape_mdd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


import bpy
from bpy.props import *
from bpy.props import StringProperty, IntProperty
from io_utils import ExportHelper, ImportHelper


Expand Down
2 changes: 1 addition & 1 deletion render_povray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

else:
import bpy
from bpy.props import *
from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty, FloatVectorProperty, EnumProperty
from render_povray import ui
from render_povray import render

Expand Down
2 changes: 1 addition & 1 deletion space_view3d_copy_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import bpy
import mathutils
from mathutils import *
from mathutils import Matrix, Vector


def build_exec(loopfunc, func):
Expand Down

0 comments on commit ebeeb59

Please sign in to comment.