Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-27 18:27:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-27 18:27:55 +0300
commitebeeb59020f86fa0504f364d7703aa9dd100978b (patch)
tree2390eb23a115908b0d21a3e4c76caa0ab4c6a749 /io_mesh_stl
parent8bc9aa9df9885297fc32641e4ffbc333d4c20dfd (diff)
replace imports from *, considered bad practice by python devs.
Diffstat (limited to 'io_mesh_stl')
-rw-r--r--io_mesh_stl/__init__.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py
index f3b925ab..350c4e6c 100644
--- a/io_mesh_stl/__init__.py
+++ b/io_mesh_stl/__init__.py
@@ -51,17 +51,15 @@ Import:
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
@@ -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:
@@ -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)