diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-10-02 17:24:12 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-10-02 17:24:12 +0300 |
commit | 3659c4da92d039c4045ac0af3fb2dfa9bca8b32e (patch) | |
tree | a59198aecbf282cc4fc81620c5652ff46f53cc42 /io_mesh_ply/__init__.py | |
parent | 608cf349ae10c42228edf2e12fdc5c0868e80f8f (diff) |
port 'Stanford PLY format' addon to Blender 2.8
Here are a couple of example files for testing: https://people.sc.fsu.edu/~jburkardt/data/ply/ply.html
I removed the texture support that was implemented here: rBA471370
(it is no official part of the file format; the exporter did not support it; reimplementing it is a bit of a hassle)
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3754
Diffstat (limited to 'io_mesh_ply/__init__.py')
-rw-r--r-- | io_mesh_ply/__init__.py | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py index 25066040..a3baa6d3 100644 --- a/io_mesh_ply/__init__.py +++ b/io_mesh_ply/__init__.py @@ -22,7 +22,7 @@ bl_info = { "name": "Stanford PLY format", "author": "Bruce Merry, Campbell Barton", "version": (1, 0, 0), - "blender": (2, 74, 0), + "blender": (2, 80, 0), "location": "File > Import-Export", "description": "Import-Export PLY mesh data withs UV's and vertex colors", "warning": "", @@ -56,8 +56,8 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, ExportHelper, - orientation_helper, axis_conversion, + orientation_helper ) @@ -67,15 +67,15 @@ class ImportPLY(bpy.types.Operator, ImportHelper): bl_label = "Import PLY" bl_options = {'UNDO'} - files = CollectionProperty(name="File Path", + files: CollectionProperty(name="File Path", description="File path used for importing " "the PLY file", type=bpy.types.OperatorFileListElement) - directory = StringProperty() + directory: StringProperty() filename_ext = ".ply" - filter_glob = StringProperty(default="*.ply", options={'HIDDEN'}) + filter_glob: StringProperty(default="*.ply", options={'HIDDEN'}) def execute(self, context): paths = [os.path.join(self.directory, name.name) @@ -91,7 +91,6 @@ class ImportPLY(bpy.types.Operator, ImportHelper): return {'FINISHED'} - @orientation_helper(axis_forward='Y', axis_up='Z') class ExportPLY(bpy.types.Operator, ExportHelper): """Export a single object as a Stanford PLY with normals, """ \ @@ -100,14 +99,14 @@ class ExportPLY(bpy.types.Operator, ExportHelper): bl_label = "Export PLY" filename_ext = ".ply" - filter_glob = StringProperty(default="*.ply", options={'HIDDEN'}) + filter_glob: StringProperty(default="*.ply", options={'HIDDEN'}) - use_mesh_modifiers = BoolProperty( + use_mesh_modifiers: BoolProperty( name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default=True, ) - use_normals = BoolProperty( + use_normals: BoolProperty( name="Normals", description="Export Normals for smooth and " "hard shaded faces " @@ -115,18 +114,18 @@ class ExportPLY(bpy.types.Operator, ExportHelper): "as individual faces)", default=True, ) - use_uv_coords = BoolProperty( + use_uv_coords: BoolProperty( name="UVs", description="Export the active UV layer", default=True, ) - use_colors = BoolProperty( + use_colors: BoolProperty( name="Vertex Colors", description="Export the active vertex color layer", default=True, ) - global_scale = FloatProperty( + global_scale: FloatProperty( name="Scale", min=0.01, max=1000.0, default=1.0, @@ -149,7 +148,7 @@ class ExportPLY(bpy.types.Operator, ExportHelper): )) global_matrix = axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, - ).to_4x4() * Matrix.Scale(self.global_scale, 4) + ).to_4x4() @ Matrix.Scale(self.global_scale, 4) keywords["global_matrix"] = global_matrix filepath = self.filepath |