Skip to content

Commit

Permalink
Forge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Dec 10, 2024
1 parent b969935 commit 092a7aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions armorforge/sources/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ function sim_delete() {
array_remove(project_paint_objects, so);
mesh_object_remove(so);
sim_remove_body(so.base.uid);
_tab_scene_paint_object_length--;
}
12 changes: 9 additions & 3 deletions armorforge/sources/tab_scene.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

let tab_scene_line_counter: i32 = 0;
let tab_scene_new_meshes: string[] = null;
let _tab_scene_paint_object_length: i32 = 1;

function tab_scene_select_object(mo: mesh_object_t) {
if (mo == null) {
Expand All @@ -21,9 +22,14 @@ function tab_scene_select_object(mo: mesh_object_t) {
}

function tab_scene_import_mesh_done() {
let mo: mesh_object_t = project_paint_objects[project_paint_objects.length - 1];
object_set_parent(mo.base, null);
tab_scene_select_object(mo);
let count: i32 = project_paint_objects.length - _tab_scene_paint_object_length;
_tab_scene_paint_object_length = project_paint_objects.length;

for (let i: i32 = 0; i < count; ++i) {
let mo: mesh_object_t = project_paint_objects[project_paint_objects.length - 1 - i];
object_set_parent(mo.base, null);
tab_scene_select_object(mo);
}

app_notify_on_next_frame(function() {
util_mesh_merge();
Expand Down
4 changes: 4 additions & 0 deletions base/sources/import_asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ function import_asset_run(path: string, drop_x: f32 = -1.0, drop_y: f32 = -1.0,
}

if (path_is_mesh(path)) {
///if is_forge
project_import_mesh_box(path, false, false, tab_scene_import_mesh_done);
///else
show_box ? project_import_mesh_box(path) : import_mesh_run(path);
///end
if (drop_x > 0) {
ui_box_click_to_hide = false; // Prevent closing when going back to window after drag and drop
}
Expand Down

0 comments on commit 092a7aa

Please sign in to comment.