Skip to content

Commit

Permalink
Use orientation_helper decorator
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dfelinto committed Sep 28, 2018
1 parent cd90aa0 commit 345d7ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 27 deletions.
8 changes: 3 additions & 5 deletions io_anim_bvh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,13 @@
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"
Expand Down
9 changes: 4 additions & 5 deletions io_mesh_ply/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,11 @@
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"
Expand Down Expand Up @@ -94,7 +91,9 @@ def execute(self, context):
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"
Expand Down
11 changes: 5 additions & 6 deletions io_scene_3ds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@
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'
Expand Down Expand Up @@ -104,7 +102,8 @@ def execute(self, context):
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'
Expand Down
8 changes: 3 additions & 5 deletions io_scene_vrml2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@
)
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"
Expand Down
11 changes: 5 additions & 6 deletions io_scene_x3d/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@
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"
Expand All @@ -81,7 +79,8 @@ def execute(self, context):
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'
Expand Down

0 comments on commit 345d7ac

Please sign in to comment.