From 6d7056ab6e342fba9a62ecfa2efd132ffe2e403a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 30 Jun 2022 17:20:39 +0200 Subject: Cleanup: fix various typos Contributed by luzpaz. Differential Revision: https://developer.blender.org/D15328 --- object_print3d_utils/export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'object_print3d_utils/export.py') diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py index aec19732..d17cd45f 100644 --- a/object_print3d_utils/export.py +++ b/object_print3d_utils/export.py @@ -79,7 +79,7 @@ def write_mesh(context, report_cb): # first ensure the path is created if export_path: # this can fail with strange errors, - # if the dir cant be made then we get an error later. + # if the dir can't be made then we get an error later. try: os.makedirs(export_path, exist_ok=True) except: -- cgit v1.2.3 From fd5afdfe2f67769886eaf50672baca14f3aebf5c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 9 Aug 2022 17:08:43 +1000 Subject: object_print3d_utils: replace f-strings by str.format() for I18n Unfortunately, messages cannot be properly extracted from f-strings. Use `str.format()` method instead. Ref D15615 --- object_print3d_utils/export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'object_print3d_utils/export.py') diff --git a/object_print3d_utils/export.py b/object_print3d_utils/export.py index d17cd45f..e4e3550b 100644 --- a/object_print3d_utils/export.py +++ b/object_print3d_utils/export.py @@ -5,6 +5,8 @@ import bpy +from bpy.app.translations import pgettext_tip as tip_ + def image_get(mat): from bpy_extras import node_shader_utils @@ -153,7 +155,7 @@ def write_mesh(context, report_cb): if 'FINISHED' in ret: if report_cb is not None: - report_cb({'INFO'}, f"Exported: {filepath!r}") + report_cb({'INFO'}, tip_("Exported: {!r}").format(filepath)) return True -- cgit v1.2.3 From 296383210971045cb0b4704847d1e427bfa6817d Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Wed, 24 Aug 2022 15:17:18 +0300 Subject: 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 --- object_print3d_utils/export.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'object_print3d_utils/export.py') 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 -- cgit v1.2.3