diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-09-28 21:57:39 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-09-28 21:58:23 +0300 |
commit | 345d7ace8756781708ae2dd3f8912be498ebffff (patch) | |
tree | 6766012c85ed760f58bc28a380fd82ff531bd188 | |
parent | cd90aa081b33a579f12f2b4a9f1452ce68c6d2c4 (diff) |
Use orientation_helper decorator
The warnings in the console are getting on the way. May as well update
the addons even if they are still mostly not ported to 2.8.
We can probably ditch orientation_helper_factory altogether.
-rw-r--r-- | io_anim_bvh/__init__.py | 8 | ||||
-rw-r--r-- | io_mesh_ply/__init__.py | 9 | ||||
-rw-r--r-- | io_scene_3ds/__init__.py | 11 | ||||
-rw-r--r-- | io_scene_vrml2/__init__.py | 8 | ||||
-rw-r--r-- | io_scene_x3d/__init__.py | 11 |
5 files changed, 20 insertions, 27 deletions
diff --git a/io_anim_bvh/__init__.py b/io_anim_bvh/__init__.py index 1655a783..c9b5dfdf 100644 --- a/io_anim_bvh/__init__.py +++ b/io_anim_bvh/__init__.py @@ -49,15 +49,13 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, ExportHelper, - orientation_helper_factory, + orientation_helper, axis_conversion, ) -ImportBVHOrientationHelper = orientation_helper_factory("ImportBVHOrientationHelper", axis_forward='-Z', axis_up='Y') - - -class ImportBVH(bpy.types.Operator, ImportHelper, ImportBVHOrientationHelper): +@orientation_helper(axis_forward='-Z', axis_up='Y') +class ImportBVH(bpy.types.Operator, ImportHelper): """Load a BVH motion capture file""" bl_idname = "import_anim.bvh" bl_label = "Import BVH" diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py index c0fcc8dc..25066040 100644 --- a/io_mesh_ply/__init__.py +++ b/io_mesh_ply/__init__.py @@ -56,14 +56,11 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, ExportHelper, - orientation_helper_factory, + orientation_helper, axis_conversion, ) -IOPLYOrientationHelper = orientation_helper_factory("IOPLYOrientationHelper", axis_forward='Y', axis_up='Z') - - class ImportPLY(bpy.types.Operator, ImportHelper): """Load a PLY geometry file""" bl_idname = "import_mesh.ply" @@ -94,7 +91,9 @@ class ImportPLY(bpy.types.Operator, ImportHelper): return {'FINISHED'} -class ExportPLY(bpy.types.Operator, ExportHelper, IOPLYOrientationHelper): + +@orientation_helper(axis_forward='Y', axis_up='Z') +class ExportPLY(bpy.types.Operator, ExportHelper): """Export a single object as a Stanford PLY with normals, """ \ """colors and texture coordinates""" bl_idname = "export_mesh.ply" diff --git a/io_scene_3ds/__init__.py b/io_scene_3ds/__init__.py index 4377674d..4daa4c29 100644 --- a/io_scene_3ds/__init__.py +++ b/io_scene_3ds/__init__.py @@ -50,15 +50,13 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, ExportHelper, - orientation_helper_factory, + orientation_helper, axis_conversion, ) -IO3DSOrientationHelper = orientation_helper_factory("IO3DSOrientationHelper", axis_forward='Y', axis_up='Z') - - -class Import3DS(bpy.types.Operator, ImportHelper, IO3DSOrientationHelper): +@orientation_helper(axis_forward='Y', axis_up='Z') +class Import3DS(bpy.types.Operator, ImportHelper): """Import from 3DS file format (.3ds)""" bl_idname = "import_scene.autodesk_3ds" bl_label = 'Import 3DS' @@ -104,7 +102,8 @@ class Import3DS(bpy.types.Operator, ImportHelper, IO3DSOrientationHelper): return import_3ds.load(self, context, **keywords) -class Export3DS(bpy.types.Operator, ExportHelper, IO3DSOrientationHelper): +@orientation_helper(axis_forward='Y', axis_up='Z') +class Export3DS(bpy.types.Operator, ExportHelper): """Export to 3DS file format (.3ds)""" bl_idname = "export_scene.autodesk_3ds" bl_label = 'Export 3DS' diff --git a/io_scene_vrml2/__init__.py b/io_scene_vrml2/__init__.py index 18821623..4a420f70 100644 --- a/io_scene_vrml2/__init__.py +++ b/io_scene_vrml2/__init__.py @@ -47,16 +47,14 @@ from bpy.props import ( ) from bpy_extras.io_utils import ( ExportHelper, - orientation_helper_factory, + orientation_helper, path_reference_mode, axis_conversion, ) -ExportVRMLOrientationHelper = orientation_helper_factory("ExportVRMLOrientationHelper", axis_forward='Z', axis_up='Y') - - -class ExportVRML(bpy.types.Operator, ExportHelper, ExportVRMLOrientationHelper): +@orientation_helper(axis_forward='Z', axis_up='Y') +class ExportVRML(bpy.types.Operator, ExportHelper): """Export mesh objects as a VRML2, colors and texture coordinates""" bl_idname = "export_scene.vrml2" bl_label = "Export VRML2" diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index f3db0e15..06a9a122 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -48,16 +48,14 @@ from bpy.props import ( from bpy_extras.io_utils import ( ImportHelper, ExportHelper, - orientation_helper_factory, + orientation_helper, axis_conversion, path_reference_mode, ) -IOX3DOrientationHelper = orientation_helper_factory("IOX3DOrientationHelper", axis_forward='Z', axis_up='Y') - - -class ImportX3D(bpy.types.Operator, ImportHelper, IOX3DOrientationHelper): +@orientation_helper(axis_forward='Z', axis_up='Y') +class ImportX3D(bpy.types.Operator, ImportHelper): """Import an X3D or VRML2 file""" bl_idname = "import_scene.x3d" bl_label = "Import X3D/VRML2" @@ -81,7 +79,8 @@ class ImportX3D(bpy.types.Operator, ImportHelper, IOX3DOrientationHelper): return import_x3d.load(context, **keywords) -class ExportX3D(bpy.types.Operator, ExportHelper, IOX3DOrientationHelper): +@orientation_helper(axis_forward='Z', axis_up='Y') +class ExportX3D(bpy.types.Operator, ExportHelper): """Export selection to Extensible 3D file (.x3d)""" bl_idname = "export_scene.x3d" bl_label = 'Export X3D' |