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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-14 15:08:57 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-14 15:08:57 +0300
commitbfbabc0592b820ec948fa355805ed78a882f4943 (patch)
tree99ce02e98f051e85f49b5901797ca9511254d20b /io_scene_x3d
parenta32177f76b250183612ac2f38ec29157b4f88c1d (diff)
Use new IOHelperOrientation class to handle forward/up axes.
Helps ensuring common behavior, and saves quite a few lines of code, too...
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/__init__.py53
1 files changed, 4 insertions, 49 deletions
diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py
index 7bda64ab..2443c28c 100644
--- a/io_scene_x3d/__init__.py
+++ b/io_scene_x3d/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "Web3D X3D/VRML2 format",
"author": "Campbell Barton, Bart",
- "blender": (2, 57, 0),
+ "blender": (2, 73, 0),
"location": "File > Import-Export",
"description": "Import-Export X3D, Import VRML2",
"warning": "",
@@ -41,12 +41,13 @@ import bpy
from bpy.props import StringProperty, BoolProperty, EnumProperty, FloatProperty
from bpy_extras.io_utils import (ImportHelper,
ExportHelper,
+ IOHelperOrientation,
axis_conversion,
path_reference_mode,
)
-class ImportX3D(bpy.types.Operator, ImportHelper):
+class ImportX3D(bpy.types.Operator, ImportHelper, IOHelperOrientation):
"""Import an X3D or VRML2 file"""
bl_idname = "import_scene.x3d"
bl_label = "Import X3D/VRML2"
@@ -55,30 +56,6 @@ class ImportX3D(bpy.types.Operator, ImportHelper):
filename_ext = ".x3d"
filter_glob = StringProperty(default="*.x3d;*.wrl", options={'HIDDEN'})
- axis_forward = EnumProperty(
- name="Forward",
- items=(('X', "X Forward", ""),
- ('Y', "Y Forward", ""),
- ('Z', "Z Forward", ""),
- ('-X', "-X Forward", ""),
- ('-Y', "-Y Forward", ""),
- ('-Z', "-Z Forward", ""),
- ),
- default='Z',
- )
-
- axis_up = EnumProperty(
- name="Up",
- items=(('X', "X Up", ""),
- ('Y', "Y Up", ""),
- ('Z', "Z Up", ""),
- ('-X', "-X Up", ""),
- ('-Y', "-Y Up", ""),
- ('-Z', "-Z Up", ""),
- ),
- default='Y',
- )
-
def execute(self, context):
from . import import_x3d
@@ -94,7 +71,7 @@ class ImportX3D(bpy.types.Operator, ImportHelper):
return import_x3d.load(self, context, **keywords)
-class ExportX3D(bpy.types.Operator, ExportHelper):
+class ExportX3D(bpy.types.Operator, ExportHelper, IOHelperOrientation):
"""Export selection to Extensible 3D file (.x3d)"""
bl_idname = "export_scene.x3d"
bl_label = 'Export X3D'
@@ -145,28 +122,6 @@ class ExportX3D(bpy.types.Operator, ExportHelper):
default=False,
)
- axis_forward = EnumProperty(
- name="Forward",
- items=(('X', "X Forward", ""),
- ('Y', "Y Forward", ""),
- ('Z', "Z Forward", ""),
- ('-X', "-X Forward", ""),
- ('-Y', "-Y Forward", ""),
- ('-Z', "-Z Forward", ""),
- ),
- default='Z',
- )
- axis_up = EnumProperty(
- name="Up",
- items=(('X', "X Up", ""),
- ('Y', "Y Up", ""),
- ('Z', "Z Up", ""),
- ('-X', "-X Up", ""),
- ('-Y', "-Y Up", ""),
- ('-Z', "-Z Up", ""),
- ),
- default='Y',
- )
global_scale = FloatProperty(
name="Scale",
min=0.01, max=1000.0,