Forge fixes
This commit is contained in:
@@ -4,8 +4,8 @@ function base_ext_init() {
|
||||
|
||||
object_remove(scene_lights[0].base);
|
||||
|
||||
// project_paint_objects[0].base.visible = false;
|
||||
// tab_scene_new_object("box.arm");
|
||||
transform_move(project_paint_objects[0].base.transform, vec4_z_axis(), -999); // Move default cube away
|
||||
tab_scene_new_object("box.arm");
|
||||
}
|
||||
|
||||
function base_ext_render() {
|
||||
@@ -30,4 +30,8 @@ function base_ext_update() {
|
||||
if (keyboard_down("control") && keyboard_started("d")) {
|
||||
sim_duplicate();
|
||||
}
|
||||
|
||||
if (keyboard_started("delete")) {
|
||||
sim_delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
function context_ext_init(c: context_t) {
|
||||
c.tool = workspace_tool_t.GIZMO;
|
||||
c.brush_radius = 1.0;
|
||||
}
|
||||
|
||||
function context_ext_select_paint_object(o: mesh_object_t) {
|
||||
|
||||
@@ -108,6 +108,8 @@ function sim_duplicate() {
|
||||
pbdup.mass = pb.mass;
|
||||
physics_body_init(pbdup, dup.base);
|
||||
}
|
||||
|
||||
_tab_scene_paint_object_length++;
|
||||
}
|
||||
|
||||
function sim_delete() {
|
||||
|
||||
@@ -8,6 +8,11 @@ function tab_object_draw(htab: ui_handle_t) {
|
||||
h.selected = context_raw.selected_object.visible;
|
||||
context_raw.selected_object.visible = ui_check(h, "Visible");
|
||||
|
||||
if (h.changed) {
|
||||
// Rebuild full vb for path-tracing
|
||||
util_mesh_merge();
|
||||
}
|
||||
|
||||
let t: transform_t = context_raw.selected_object.transform;
|
||||
let rot: vec4_t = quat_get_euler(t.rot);
|
||||
rot = vec4_mult(rot, 180 / 3.141592);
|
||||
|
||||
@@ -33,6 +33,14 @@ function tab_scene_import_mesh_done() {
|
||||
|
||||
app_notify_on_next_frame(function() {
|
||||
util_mesh_merge();
|
||||
tab_scene_select_object(context_raw.selected_object.ext);
|
||||
|
||||
let scene: object_t = _scene_root.children[0];
|
||||
array_sort(scene.children, function (pa: any_ptr, pb: any_ptr): i32 {
|
||||
let a: object_t = DEREFERENCE(pa);
|
||||
let b: object_t = DEREFERENCE(pb);
|
||||
return strcmp(a.name, b.name);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -173,7 +181,6 @@ function tab_scene_draw(htab: ui_handle_t) {
|
||||
tab_scene_line_counter = 0;
|
||||
|
||||
let scene: object_t = _scene_root.children[0];
|
||||
|
||||
for (let i: i32 = 0; i < scene.children.length; ++i) {
|
||||
let c: object_t = scene.children[i];
|
||||
tab_scene_draw_list(ui, ui_handle(__ID__), c);
|
||||
|
||||
@@ -22,6 +22,9 @@ function util_mesh_ext_get_unique(): mesh_object_t[] {
|
||||
let ar: mesh_object_t[] = [];
|
||||
|
||||
for (let i: i32 = 0; i < project_paint_objects.length; ++i) {
|
||||
if (!project_paint_objects[i].base.visible) {
|
||||
continue;
|
||||
}
|
||||
let found: bool = false;
|
||||
for (let j: i32 = 0; j < i; ++j) {
|
||||
if (project_paint_objects[i].data == project_paint_objects[j].data) {
|
||||
|
||||
Reference in New Issue
Block a user