paint: add script_append_mesh
This commit is contained in:
@@ -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()");
|
||||
|
||||
@@ -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(¤t, &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;
|
||||
|
||||
Reference in New Issue
Block a user