diff options
author | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2020-07-15 05:04:42 +0300 |
---|---|---|
committer | Mikhail Rachinskiy <mikhail.rachinskiy@gmail.com> | 2020-07-15 05:04:42 +0300 |
commit | e9ada0c8e31cf0f4329f8ecc90c4fb970cbf948b (patch) | |
tree | d572d50c082fad95542ab9e9bb72c88c46d8f600 /io_mesh_ply | |
parent | 44bd5400357ff8dc2baa30dc2d1836196f900c1a (diff) |
PLY Cleanup: formatting
Diffstat (limited to 'io_mesh_ply')
-rw-r--r-- | io_mesh_ply/__init__.py | 33 | ||||
-rw-r--r-- | io_mesh_ply/import_ply.py | 2 |
2 files changed, 16 insertions, 19 deletions
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py index 79b8dc38..835ae60e 100644 --- a/io_mesh_ply/__init__.py +++ b/io_mesh_ply/__init__.py @@ -52,7 +52,7 @@ from bpy_extras.io_utils import ( ImportHelper, ExportHelper, axis_conversion, - orientation_helper + orientation_helper, ) @@ -64,11 +64,9 @@ class ImportPLY(bpy.types.Operator, ImportHelper): files: CollectionProperty( name="File Path", - description=( - "File path used for importing " - "the PLY file" - ), - type=bpy.types.OperatorFileListElement) + description="File path used for importing the PLY file", + type=bpy.types.OperatorFileListElement, + ) # Hide opertator properties, rest of this is managed in C. See WM_operator_properties_filesel(). hide_props_region: BoolProperty( @@ -84,14 +82,16 @@ class ImportPLY(bpy.types.Operator, ImportHelper): def execute(self, context): import os + from . import import_ply + + paths = [ + os.path.join(self.directory, name.name) + for name in self.files + ] - paths = [os.path.join(self.directory, name.name) - for name in self.files] if not paths: paths.append(self.filepath) - from . import import_ply - for path in paths: import_ply.load(self, context, path) @@ -120,10 +120,8 @@ class ExportPLY(bpy.types.Operator, ExportHelper): use_normals: BoolProperty( name="Normals", description=( - "Export Normals for smooth and " - "hard shaded faces " - "(hard shaded faces will be exported " - "as individual faces)" + "Export Normals for smooth and hard shaded faces " + "(hard shaded faces will be exported as individual faces)" ), default=True, ) @@ -137,17 +135,16 @@ class ExportPLY(bpy.types.Operator, ExportHelper): description="Export the active vertex color layer", default=True, ) - global_scale: FloatProperty( name="Scale", - min=0.01, max=1000.0, + min=0.01, + max=1000.0, default=1.0, ) def execute(self, context): - from . import export_ply - from mathutils import Matrix + from . import export_ply keywords = self.as_keywords( ignore=( diff --git a/io_mesh_ply/import_ply.py b/io_mesh_ply/import_ply.py index c7981cc3..6df2ec81 100644 --- a/io_mesh_ply/import_ply.py +++ b/io_mesh_ply/import_ply.py @@ -275,7 +275,7 @@ def load_ply_mesh(filepath, ply_name): vertices[index][colindices[0]] * colmultiply[0], vertices[index][colindices[1]] * colmultiply[1], vertices[index][colindices[2]] * colmultiply[2], - 1.0 + 1.0, ) for index in indices ]) |