From fa5f389405df615397d3c9e888579b8b5f83fcbe Mon Sep 17 00:00:00 2001
From: M Bouchard Guillaume <guillaume.bouchard@liris.cnrs.fr>
Date: Fri, 21 Jan 2011 13:45:05 +0000
Subject: [PATCH] Allow importing of multiples ply files at once

---
 io_mesh_ply/__init__.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py
index bdac6fa2b..e6ad0af14 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):
-- 
GitLab