paint: add script_append_mesh

This commit is contained in:
luboslenco
2026-08-23 22:00:27 +02:00
parent 684a8ef75c
commit 84aeb6e757
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -1198,6 +1198,7 @@ void minic_register_builtins() {
R(script_project_new, "v()");
R(script_project_open, "v(p:char path)");
R(script_import_asset, "v(p:char path,i hdr_as_envmap)");
R(script_append_mesh, "v(p:char path)");
R(script_export_mesh, "v(p:char path)");
R(script_export_material, "v(p:char path)");
R(project_filepath_get, "p:char()");
+12
View File
@@ -376,6 +376,18 @@ void script_import_asset(char *path, bool hdr_as_envmap) {
g_context->ddirty = 2;
}
void script_append_mesh(char *path) {
if (path == NULL || !iron_file_exists(path)) {
return;
}
gpu_texture_t *current;
bool in_use;
script_gpu_begin(&current, &in_use);
import_mesh_run(path, false, false, true);
script_gpu_end(current, in_use);
g_context->ddirty = 2;
}
void script_export_mesh(char *path) {
if (path == NULL) {
return;