diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-21 13:16:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-21 13:16:07 +0300 |
commit | b3c8b727c60f277f7f00dd525f35b3c8a32f7d3c (patch) | |
tree | 9cad39286b5611d788eb7ca342e13ef470629d0e /io_mesh_stl | |
parent | d746994e155a968b63b931a977cdcdea3e0e2bde (diff) |
support for calling the operator with only filepath set.
Diffstat (limited to 'io_mesh_stl')
-rw-r--r-- | io_mesh_stl/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/io_mesh_stl/__init__.py b/io_mesh_stl/__init__.py index fdf7a1b4..0a1ca354 100644 --- a/io_mesh_stl/__init__.py +++ b/io_mesh_stl/__init__.py @@ -80,7 +80,10 @@ class ImportSTL(bpy.types.Operator, ImportHelper): directory = StringProperty() def execute(self, context): - paths = (os.path.join(self.directory, name.name) for name in self.files) + paths = [os.path.join(self.directory, name.name) for name in self.files] + + if not paths: + paths.append(self.filepath) for path in paths: objName = bpy.path.display_name(path.split("\\")[-1].split("/")[-1]) |