From 857fae2e7de8262e7edd83211b1f0267b74aecf0 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Mon, 18 Aug 2025 23:02:17 +0200 Subject: [PATCH] blend import fixes --- base/sources/ts/import_blend_mesh.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/base/sources/ts/import_blend_mesh.ts b/base/sources/ts/import_blend_mesh.ts index d2349db5..324095f6 100644 --- a/base/sources/ts/import_blend_mesh.ts +++ b/base/sources/ts/import_blend_mesh.ts @@ -25,26 +25,22 @@ function import_blend_mesh_ui() { } function import_blend_mesh_run(path: string, replace_existing: bool = true) { - if (config_raw.blender == null || config_raw.blender == "") { console_error(tr("Blender executable path not set")); return; } let save: string = "tmp.obj"; + let bpy_folder: string = "data/"; if (path_is_protected()) { - save = iron_internal_save_path() + "data/" + save; + save = iron_internal_save_path() + save; + bpy_folder = ""; } - ///if arm_windows - path = string_replace_all(path, "\\", "\\\\"); - save = string_replace_all(save, "\\", "\\\\"); - ///end - // Have to use ; instead of \n on windows let py: string = "\ import bpy;\ -bpy.ops.wm.obj_export(filepath='data/" + save + "',export_triangulated_mesh=True,export_materials=False,check_existing=False)"; +bpy.ops.wm.obj_export(filepath='" + bpy_folder + string_replace_all(save, "\\", "/") + "',export_triangulated_mesh=True,export_materials=False,check_existing=False)"; let bl: string = string_replace_all(config_raw.blender, " ", "\\ "); iron_sys_command(bl + " \"" + path + "\" -b --python-expr \"" + py + "\"");