diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-16 14:05:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-03-16 14:09:27 +0300 |
commit | e8da70ab73d2dd5ff46e47c87cf2da633446670f (patch) | |
tree | 1917c3cf7e713cbf1c93ea0e7c561268f2277e45 /io_scene_x3d/__init__.py | |
parent | d17b93756929e1b7bf5cce8a3073fa532f750e39 (diff) |
X3D: basic initial port to blender2.8.
That was a rather heavy work, since in 2.7 that add-on was still using
tessellated geometry API quiet extensively (and that one has been
removed from 2.8)...
Also updated some minor things on the road, like e.g. exporting
ColorRGBA for vertex colors, since ours now have some alpha.
Main remaining TODO is materials afaik (those need to be ported to the
new nodeshader wrapper), not very high priority for now.
Also note that the whole code has many sub-optimal handling, but that
whole format is not really designed for heavy geometries anyway I think,
so this is probably fine for now (and going over whole code to optimize
it would be quiet a work too).
Diffstat (limited to 'io_scene_x3d/__init__.py')
-rw-r--r-- | io_scene_x3d/__init__.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/io_scene_x3d/__init__.py b/io_scene_x3d/__init__.py index 8115f72e..54377704 100644 --- a/io_scene_x3d/__init__.py +++ b/io_scene_x3d/__init__.py @@ -21,8 +21,8 @@ bl_info = { "name": "Web3D X3D/VRML2 format", "author": "Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev", - "version": (1, 2, 0), - "blender": (2, 76, 0), + "version": (2, 2, 0), + "blender": (2, 80, 0), "location": "File > Import-Export", "description": "Import-Export X3D, Import VRML2", "warning": "", @@ -152,7 +152,7 @@ class ExportX3D(bpy.types.Operator, ExportHelper): )) global_matrix = axis_conversion(to_forward=self.axis_forward, to_up=self.axis_up, - ).to_4x4() * Matrix.Scale(self.global_scale, 4) + ).to_4x4() @ Matrix.Scale(self.global_scale, 4) keywords["global_matrix"] = global_matrix return export_x3d.save(context, **keywords) @@ -168,21 +168,27 @@ def menu_func_export(self, context): text="X3D Extensible 3D (.x3d)") +classes = ( + ExportX3D, + ImportX3D, +) + + def register(): - bpy.utils.register_module(__name__) + for cls in classes: + bpy.utils.register_class(cls) bpy.types.TOPBAR_MT_file_import.append(menu_func_import) bpy.types.TOPBAR_MT_file_export.append(menu_func_export) def unregister(): - bpy.utils.unregister_module(__name__) - bpy.types.TOPBAR_MT_file_import.remove(menu_func_import) bpy.types.TOPBAR_MT_file_export.remove(menu_func_export) -# NOTES -# - blender version is hardcoded + for cls in classes: + bpy.utils.unregister_class(cls) + if __name__ == "__main__": register() |