diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-03 17:04:55 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-03 17:08:21 +0300 |
commit | 53aec1ccff1b7e6356836a29b36115b475f0c3d2 (patch) | |
tree | b276067c771906ecc2b7b970a9e327ede080c16b /io_scene_x3d | |
parent | 0a6d3d725f0b6edc99198f6afa91138968580caf (diff) |
UI: New options layout for IO Add-ons
Updates importers/exporters for the new file-browser design. They are
now reorganized into sub-panels.
Updated the Blender version requirement (won't be compatible with older
Blender versions). Left the Add-on versions untouched, will leave that
up to Authors to change.
Diffstat (limited to 'io_scene_x3d')
-rw-r--r-- | io_scene_x3d/__init__.py | 117 |
1 files changed, 116 insertions, 1 deletions
diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index a08b9a90..1b3060b0 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -22,7 +22,7 @@ bl_info = { "name": "Web3D X3D/VRML2 format", "author": "Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev", "version": (2, 2, 2), - "blender": (2, 80, 0), + "blender": (2, 81, 6), "location": "File > Import-Export", "description": "Import-Export X3D, Import VRML2", "warning": "", @@ -78,6 +78,89 @@ class ImportX3D(bpy.types.Operator, ImportHelper): return import_x3d.load(context, **keywords) + def draw(self, context): + pass + + +class X3D_PT_export_include(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "include" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_x3d" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, "use_selection") + layout.prop(operator, "use_hierarchy") + layout.prop(operator, "name_decorations") + layout.prop(operator, "use_h3d") + + +class X3D_PT_export_transform(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Transform" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_x3d" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, "global_scale") + layout.prop(operator, "axis_forward") + layout.prop(operator, "axis_up") + + +class X3D_PT_export_geometry(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Geometry" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "EXPORT_SCENE_OT_x3d" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, "use_mesh_modifiers") + layout.prop(operator, "use_triangulate") + layout.prop(operator, "use_normals") + layout.prop(operator, "use_compress") + @orientation_helper(axis_forward='Z', axis_up='Y') class ExportX3D(bpy.types.Operator, ExportHelper): @@ -157,6 +240,34 @@ class ExportX3D(bpy.types.Operator, ExportHelper): return export_x3d.save(context, **keywords) + def draw(self, context): + pass + + +class X3D_PT_import_transform(bpy.types.Panel): + bl_space_type = 'FILE_BROWSER' + bl_region_type = 'TOOL_PROPS' + bl_label = "Transform" + bl_parent_id = "FILE_PT_operator" + + @classmethod + def poll(cls, context): + sfile = context.space_data + operator = sfile.active_operator + + return operator.bl_idname == "IMPORT_SCENE_OT_x3d" + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + sfile = context.space_data + operator = sfile.active_operator + + layout.prop(operator, "axis_forward") + layout.prop(operator, "axis_up") + def menu_func_import(self, context): self.layout.operator(ImportX3D.bl_idname, @@ -170,7 +281,11 @@ def menu_func_export(self, context): classes = ( ExportX3D, + X3D_PT_export_include, + X3D_PT_export_transform, + X3D_PT_export_geometry, ImportX3D, + X3D_PT_import_transform, ) |