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
This commit is contained in:
Aras Pranckevicius 2022-08-24 15:17:18 +03:00
parent 4f05011874
commit 2963832109
1 changed files with 8 additions and 8 deletions

View File

@ -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