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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/op/io_mesh_ply/__init__.py')
-rw-r--r--release/scripts/op/io_mesh_ply/__init__.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/release/scripts/op/io_mesh_ply/__init__.py b/release/scripts/op/io_mesh_ply/__init__.py
index d004f542ad1..5802dce4c0a 100644
--- a/release/scripts/op/io_mesh_ply/__init__.py
+++ b/release/scripts/op/io_mesh_ply/__init__.py
@@ -23,16 +23,31 @@ if "bpy" in locals():
import imp
if "export_ply" in locals():
imp.reload(export_ply)
+ if "import_ply" in locals():
+ imp.reload(import_ply)
import bpy
from bpy.props import *
-from io_utils import ExportHelper
+from io_utils import ImportHelper, ExportHelper
+
+
+class ImportPLY(bpy.types.Operator, ImportHelper):
+ '''Load a BVH motion capture file'''
+ bl_idname = "import_mesh.ply"
+ bl_label = "Import PLY"
+
+ filename_ext = ".ply"
+ filter_glob = StringProperty(default="*.ply", options={'HIDDEN'})
+
+ def execute(self, context):
+ from . import import_ply
+ return import_ply.load(self, context, **self.as_keywords(ignore=("filter_glob",)))
class ExportPLY(bpy.types.Operator, ExportHelper):
'''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
- bl_idname = "export.ply"
+ bl_idname = "export_mesh.ply"
bl_label = "Export PLY"
filename_ext = ".ply"
@@ -64,16 +79,22 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
row.prop(self, "use_colors")
-def menu_func(self, context):
+def menu_func_import(self, context):
+ self.layout.operator(ImportPLY.bl_idname, text="Stanford (.ply)")
+
+
+def menu_func_export(self, context):
self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)")
def register():
- bpy.types.INFO_MT_file_export.append(menu_func)
+ bpy.types.INFO_MT_file_import.append(menu_func_import)
+ bpy.types.INFO_MT_file_export.append(menu_func_export)
def unregister():
- bpy.types.INFO_MT_file_export.remove(menu_func)
+ bpy.types.INFO_MT_file_import.remove(menu_func_import)
+ bpy.types.INFO_MT_file_export.remove(menu_func_export)
if __name__ == "__main__":
register()