diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-08-24 15:17:18 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-08-24 15:17:18 +0300 |
commit | 296383210971045cb0b4704847d1e427bfa6817d (patch) | |
tree | ad0b84163fbe44e73768e8ae9d331ebeed3ba63f | |
parent | 4f050118742e44fc7884bcc31fbe54c50981e336 (diff) |
object_print3d_utils: switch 3D Print Toolbox obj export to use the new exporter
The 3D Print Toolbox addon was using the Python based exporter API,
switch it to use the C++ based obj exporter. This is faster, supports
vertex color attributes, and allows to remove the Python based exporter
some day.
Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D15769
-rw-r--r-- | object_print3d_utils/export.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py index e4e3550b..11ce5e00 100644 --- a/object_print3d_utils/export.py +++ b/object_print3d_utils/export.py @@ -134,17 +134,17 @@ def write_mesh(context, report_cb): use_normals=export_data_layers, ) elif export_format == 'OBJ': - addon_ensure("io_scene_obj") filepath = bpy.path.ensure_ext(filepath, ".obj") - ret = bpy.ops.export_scene.obj( + ret = bpy.ops.wm.obj_export( filepath=filepath, - use_mesh_modifiers=True, - use_selection=True, - global_scale=global_scale, + apply_modifiers=True, + export_selected_objects=True, + scaling_factor=global_scale, path_mode=path_mode, - use_normals=export_data_layers, - use_uvs=export_data_layers, - use_materials=export_data_layers, + export_normals=export_data_layers, + export_uv=export_data_layers, + export_materials=export_data_layers, + export_colors=export_data_layers, ) else: assert 0 |