Skip to content
Snippets Groups Projects
Commit fa5f3894 authored by M Bouchard Guillaume's avatar M Bouchard Guillaume
Browse files

Allow importing of multiples ply files at once

parent cd4e5ff0
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment