paint: improve meshes tab
This commit is contained in:
@@ -259,6 +259,12 @@ void export_arm_run_project() {
|
||||
}
|
||||
g_project->mesh_transforms = mesh_transforms;
|
||||
|
||||
i32_array_t *mesh_materials = i32_array_create(g_project->_->paint_objects->length);
|
||||
for (i32 i = 0; i < g_project->_->paint_objects->length; ++i) {
|
||||
mesh_materials->buffer[i] = tab_meshes_get_override(g_project->_->paint_objects->buffer[i]);
|
||||
}
|
||||
g_project->mesh_materials = mesh_materials;
|
||||
|
||||
g_project->material_nodes = mnodes;
|
||||
g_project->brush_nodes = bnodes;
|
||||
g_project->layer_datas = ld;
|
||||
|
||||
@@ -600,6 +600,15 @@ void import_arm_run_project(char *path) {
|
||||
}
|
||||
}
|
||||
|
||||
if (project->mesh_materials != NULL) {
|
||||
for (i32 i = 0; i < g_project->_->paint_objects->length && i < project->mesh_materials->length; ++i) {
|
||||
i32 mat_index = project->mesh_materials->buffer[i];
|
||||
if (mat_index >= 0) {
|
||||
tab_meshes_set_override(g_project->_->paint_objects->buffer[i], mat_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tab_timeline_import(project);
|
||||
|
||||
sys_notify_on_next_frame(&import_arm_run_project_on_next_frame, NULL);
|
||||
|
||||
@@ -230,6 +230,7 @@ project_t *import_arm_from_map_to_arm(any_map_t *old) {
|
||||
project->mesh_assets = any_map_get(old, "mesh_assets");
|
||||
project->mesh_icons = any_map_get(old, "mesh_icons");
|
||||
project->mesh_transforms = any_map_get(old, "mesh_transforms");
|
||||
project->mesh_materials = any_map_get(old, "mesh_materials");
|
||||
project->atlas_objects = any_map_get(old, "atlas_objects");
|
||||
project->atlas_names = any_map_get(old, "atlas_names");
|
||||
project->script_datas = any_map_get(old, "script_datas");
|
||||
@@ -288,6 +289,7 @@ project_t *import_arm_from_map_to_arm(any_map_t *old) {
|
||||
}
|
||||
|
||||
project_t *import_arm_from_version_8(any_map_t *old) {
|
||||
any_map_set(old, "mesh_materials", NULL);
|
||||
any_map_set(old, "script_names", NULL);
|
||||
any_map_set(old, "stages", NULL);
|
||||
return import_arm_from_map_to_arm(old);
|
||||
|
||||
Reference in New Issue
Block a user