2024-03-14 15:31:22 +01:00
|
|
|
|
2024-09-03 15:52:05 +02:00
|
|
|
function tab_plugins_draw(htab: ui_handle_t) {
|
|
|
|
|
if (ui_tab(htab, tr("Plugins"))) {
|
2024-03-14 15:31:22 +01:00
|
|
|
|
2024-09-03 15:52:05 +02:00
|
|
|
ui_begin_sticky();
|
2024-03-14 15:31:22 +01:00
|
|
|
|
2025-10-21 21:07:28 +02:00
|
|
|
let row: f32[] = [ -70 ];
|
2024-09-03 15:52:05 +02:00
|
|
|
ui_row(row);
|
2024-03-14 15:31:22 +01:00
|
|
|
|
2024-09-03 15:52:05 +02:00
|
|
|
if (ui_button(tr("Manager"))) {
|
2025-11-12 19:59:27 +01:00
|
|
|
box_preferences_htab.i = preference_tab_t.PLUGINS;
|
2024-03-14 15:31:22 +01:00
|
|
|
box_preferences_show();
|
|
|
|
|
}
|
2024-09-03 15:52:05 +02:00
|
|
|
ui_end_sticky();
|
2024-03-14 15:31:22 +01:00
|
|
|
|
|
|
|
|
// Draw plugins
|
2024-04-12 12:51:40 +02:00
|
|
|
let keys: string[] = map_keys(plugin_map);
|
|
|
|
|
for (let i: i32 = 0; i < keys.length; ++i) {
|
|
|
|
|
let p: plugin_t = map_get(plugin_map, keys[i]);
|
2024-08-07 22:48:08 +02:00
|
|
|
if (p.on_ui != null) {
|
|
|
|
|
js_call(p.on_ui);
|
2024-03-20 16:13:54 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-01-15 19:52:26 +01:00
|
|
|
|
2025-10-15 18:39:55 +02:00
|
|
|
/// if is_debug
|
2025-01-15 19:52:26 +01:00
|
|
|
let rt_keys: string[] = map_keys(render_path_render_targets);
|
|
|
|
|
array_sort(rt_keys, null);
|
|
|
|
|
for (let i: i32 = 0; i < rt_keys.length; ++i) {
|
|
|
|
|
let rt: render_target_t = map_get(render_path_render_targets, rt_keys[i]);
|
|
|
|
|
ui_text(rt_keys[i]);
|
2025-08-04 19:34:53 +02:00
|
|
|
ui_image(rt._image);
|
2025-01-15 19:52:26 +01:00
|
|
|
}
|
2025-10-15 18:39:55 +02:00
|
|
|
/// end
|
2024-03-14 15:31:22 +01:00
|
|
|
}
|
|
|
|
|
}
|
2025-07-20 00:14:24 +02:00
|
|
|
|
|
|
|
|
function plugin_uv_unwrap_button() {
|
|
|
|
|
let cb: any = map_get(util_mesh_unwrappers, "uv_unwrap.js"); // JSValue * -> (a: raw_mesh_t)=>void
|
|
|
|
|
for (let i: i32 = 0; i < project_paint_objects.length; ++i) {
|
2025-10-15 18:39:55 +02:00
|
|
|
let md: mesh_data_t = project_paint_objects[i].data;
|
|
|
|
|
let mesh: raw_mesh_t = {posa : md.vertex_arrays[0].values, nora : md.vertex_arrays[1].values, texa : null, inda : md.index_array};
|
2025-07-20 00:14:24 +02:00
|
|
|
js_call_ptr(cb, mesh);
|
|
|
|
|
md.vertex_arrays[0].values = mesh.posa;
|
|
|
|
|
md.vertex_arrays[1].values = mesh.nora;
|
|
|
|
|
md.vertex_arrays[2].values = mesh.texa;
|
2025-10-15 18:39:55 +02:00
|
|
|
md.index_array = mesh.inda;
|
2025-07-20 00:14:24 +02:00
|
|
|
mesh_data_build(md);
|
|
|
|
|
}
|
|
|
|
|
util_mesh_merge();
|
|
|
|
|
}
|