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:
authorM Bouchard Guillaume <guillaume.bouchard@liris.cnrs.fr>2011-01-21 16:45:05 +0300
committerM Bouchard Guillaume <guillaume.bouchard@liris.cnrs.fr>2011-01-21 16:45:05 +0300
commitfa5f389405df615397d3c9e888579b8b5f83fcbe (patch)
tree2d9d1b1dfba21ab7fd477052a04e1056093c5024 /io_mesh_ply
parentcd4e5ff0ac7d5adc9968d0584c83d11a47055cf0 (diff)
Allow importing of multiples ply files at once
Diffstat (limited to 'io_mesh_ply')
-rw-r--r--io_mesh_ply/__init__.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py
index bdac6fa2..e6ad0af1 100644
--- a/io_mesh_ply/__init__.py
+++ b/io_mesh_ply/__init__.py
@@ -39,6 +39,7 @@ if "bpy" in locals():
imp.reload(import_ply)
+import os
import bpy
from bpy.props import *
from io_utils import ImportHelper, ExportHelper
@@ -48,13 +49,28 @@ class ImportPLY(bpy.types.Operator, ImportHelper):
'''Load a BVH motion capture file'''
bl_idname = "import_mesh.ply"
bl_label = "Import PLY"
+
+ files = CollectionProperty(name="File Path",
+ description="File path used for importing "
+ "the PLY file",
+ type=bpy.types.OperatorFileListElement)
+
+ directory = StringProperty()
filename_ext = ".ply"
filter_glob = StringProperty(default="*.ply", options={'HIDDEN'})
def execute(self, context):
+ paths = [os.path.join(self.directory, name.name) for name in self.files]
+ if not paths:
+ paths.append(self.filepath)
+
from . import import_ply
- return import_ply.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
+
+ for path in paths:
+ import_ply.load(self, context, path)
+
+ return {'FINISHED'}
class ExportPLY(bpy.types.Operator, ExportHelper):