浏览代码

Fix blend import

luboslenco 1 月之前
父节点
当前提交
49f2638efd
共有 2 个文件被更改,包括 2 次插入9 次删除
  1. 0 7
      base/sources/ts/import_blend_material.ts
  2. 2 2
      base/sources/ts/import_blend_mesh.ts

+ 0 - 7
base/sources/ts/import_blend_material.ts

@@ -29,15 +29,8 @@ function import_blend_material_run(path: string) {
 }
 }
 
 
 function _import_blend_material() {
 function _import_blend_material() {
-
-	let current: gpu_texture_t = _draw_current;
-	let in_use: bool = gpu_in_use;
-	if (in_use) draw_end();
-
 	console_toast(tr("Baking material"));
 	console_toast(tr("Baking material"));
 
 
-	if (in_use) draw_begin(current);
-
 	sys_notify_on_init(function () {
 	sys_notify_on_init(function () {
 
 
 		let save: string;
 		let save: string;

+ 2 - 2
base/sources/ts/import_blend_mesh.ts

@@ -33,7 +33,7 @@ function import_blend_mesh_run(path: string, replace_existing: bool = true) {
 
 
 	let save: string = "tmp.obj";
 	let save: string = "tmp.obj";
 	if (path_is_protected()) {
 	if (path_is_protected()) {
-		save = iron_internal_save_path() + save;
+		save = iron_internal_save_path() + "data/" + save;
 	}
 	}
 
 
 	///if arm_windows
 	///if arm_windows
@@ -44,7 +44,7 @@ function import_blend_mesh_run(path: string, replace_existing: bool = true) {
 	// Have to use ; instead of \n on windows
 	// Have to use ; instead of \n on windows
 	let py: string = "\
 	let py: string = "\
 import bpy;\
 import bpy;\
-bpy.ops.wm.obj_export(filepath='" + save + "',export_triangulated_mesh=True,export_materials=False,check_existing=False)";
+bpy.ops.wm.obj_export(filepath='data/" + save + "',export_triangulated_mesh=True,export_materials=False,check_existing=False)";
 
 
 	let bl: string = string_replace_all(config_raw.blender, " ", "\\ ");
 	let bl: string = string_replace_all(config_raw.blender, " ", "\\ ");
 	iron_sys_command(bl + " \"" + path + "\" -b --python-expr \"" + py + "\"");
 	iron_sys_command(bl + " \"" + path + "\" -b --python-expr \"" + py + "\"");