paint: reparent after sort

This commit is contained in:
luboslenco
2026-05-01 22:32:43 +02:00
parent b75a8e694a
commit 2c468c9079
2 changed files with 12 additions and 2 deletions
+2 -2
View File
@@ -379,7 +379,8 @@ void import_arm_run_project(char *path) {
any_array_push(project_paint_objects, object);
}
for (i32 i = 0; i < project->mesh_datas->length; ++i) {
transform_set_matrix(g_context->paint_object->base->transform, mat4_from_f32_array(project->mesh_transforms->buffer[0], 0));
for (i32 i = 1; i < project->mesh_datas->length; ++i) {
mesh_object_t *o = project_paint_objects->buffer[i];
transform_set_matrix(o->base->transform, mat4_from_f32_array(project->mesh_transforms->buffer[i], 0));
}
@@ -414,7 +415,6 @@ void import_arm_run_project(char *path) {
}
context_select_paint_object(context_main_object());
viewport_scale_to_bounds(2.0);
g_context->paint_object->skip_context = "paint";
g_context->merged_object->base->visible = true;
+10
View File
@@ -82,8 +82,18 @@ void import_mesh_finish_import() {
}
if (project_paint_objects->length > 1) {
// Sort by name
array_sort(project_paint_objects, &import_mesh_finish_import_sort);
mesh_object_t *new_parent = project_paint_objects->buffer[0];
object_set_parent(new_parent->base, NULL);
for (i32 i = 0; i < project_paint_objects->length; ++i) {
mesh_object_t *p = project_paint_objects->buffer[i];
if (p != new_parent) {
object_set_parent(p->base, new_parent->base);
}
}
context_select_paint_object(context_main_object());
if (g_context->merged_object == NULL) {
util_mesh_merge(NULL);