This commit is contained in:
luboslenco
2024-06-16 19:36:26 +02:00
parent a06ab733c6
commit 3dcba9d28b
18 changed files with 53 additions and 59 deletions
-11
View File
@@ -1,11 +0,0 @@
---
name: Ask a question
about: Post a question about ArmorPaint
title: ''
labels: question
assignees: ''
---
<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/armory3d/armortools/issues?q=is%3Aissue
-->
@@ -5,4 +5,5 @@ let project = new Project('plugins');
project.addDefine('WITH_PLUGIN_EMBED'); project.addDefine('WITH_PLUGIN_EMBED');
project.addDefine('TINYUSDZ_NO_STB_IMAGE_IMPLEMENTATION'); project.addDefine('TINYUSDZ_NO_STB_IMAGE_IMPLEMENTATION');
project.flatten();
return project; return project;
+1
View File
@@ -39,4 +39,5 @@ if (flags.raytrace) {
} }
} }
project.flatten();
return project; return project;
+6 -6
View File
@@ -447,13 +447,13 @@ function base_on_resize() {
base_resize(); base_resize();
///if (krom_linux || krom_darwin) ///if (krom_linux || krom_macos)
base_save_window_rect(); base_save_window_rect();
///end ///end
} }
function base_save_window_rect() { function base_save_window_rect() {
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
config_raw.window_w = sys_width(); config_raw.window_w = sys_width();
config_raw.window_h = sys_height(); config_raw.window_h = sys_height();
config_raw.window_x = sys_x(); config_raw.window_x = sys_x();
@@ -706,7 +706,7 @@ function base_material_dropped() {
function base_handle_drop_paths() { function base_handle_drop_paths() {
if (base_drop_paths.length > 0) { if (base_drop_paths.length > 0) {
///if (krom_linux || krom_darwin) ///if (krom_linux || krom_macos)
let wait: bool = !mouse_moved; // Mouse coords not updated during drag let wait: bool = !mouse_moved; // Mouse coords not updated during drag
///else ///else
let wait: bool = false; let wait: bool = false;
@@ -942,7 +942,7 @@ function base_get_asset_index(file_name: string): i32 {
function base_toggle_fullscreen() { function base_toggle_fullscreen() {
if (sys_mode() == window_mode_t.WINDOWED) { if (sys_mode() == window_mode_t.WINDOWED) {
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
config_raw.window_w = sys_width(); config_raw.window_w = sys_width();
config_raw.window_h = sys_height(); config_raw.window_h = sys_height();
config_raw.window_x = sys_x(); config_raw.window_x = sys_x();
@@ -984,8 +984,8 @@ function base_get_uis(): zui_t[] {
function base_is_decal_layer(): bool { function base_is_decal_layer(): bool {
///if is_paint ///if is_paint
let is_paint: bool = context_raw.tool != workspace_tool_t.MATERIAL && context_raw.tool != workspace_tool_t.BAKE; let is_painting: bool = context_raw.tool != workspace_tool_t.MATERIAL && context_raw.tool != workspace_tool_t.BAKE;
return is_paint && context_raw.layer.fill_layer != null && context_raw.layer.uv_type == uv_type_t.PROJECT; return is_painting && context_raw.layer.fill_layer != null && context_raw.layer.uv_type == uv_type_t.PROJECT;
///end ///end
///if (is_sculpt || is_lab) ///if (is_sculpt || is_lab)
+2 -2
View File
@@ -121,7 +121,7 @@ function config_init() {
config_raw.window_maximizable = true; config_raw.window_maximizable = true;
config_raw.window_w = 1600; config_raw.window_w = 1600;
config_raw.window_h = 900; config_raw.window_h = 900;
///if krom_darwin ///if krom_macos
config_raw.window_w *= 2; config_raw.window_w *= 2;
config_raw.window_h *= 2; config_raw.window_h *= 2;
///end ///end
@@ -131,7 +131,7 @@ function config_init() {
if (sys_display_width() >= 2560 && sys_display_height() >= 1600) { if (sys_display_width() >= 2560 && sys_display_height() >= 1600) {
config_raw.window_scale = 2.0; config_raw.window_scale = 2.0;
} }
///if (krom_android || krom_ios || krom_darwin) ///if (krom_android || krom_ios || krom_macos)
config_raw.window_scale = 2.0; config_raw.window_scale = 2.0;
///end ///end
config_raw.window_vsync = true; config_raw.window_vsync = true;
+3 -3
View File
@@ -79,7 +79,7 @@ type file_download_data_t = {
let _file_download_map: map_t<string, file_download_data_t> = map_create(); let _file_download_map: map_t<string, file_download_data_t> = map_create();
function file_download(url: string, dst_path: string, done: (url: string)=>void, size: i32 = 0) { function file_download(url: string, dst_path: string, done: (url: string)=>void, size: i32 = 0) {
///if (krom_windows || krom_darwin || krom_ios || krom_android) ///if (krom_windows || krom_macos || krom_ios || krom_android)
let fdd: file_download_data_t = { dst_path: dst_path, done: done }; let fdd: file_download_data_t = { dst_path: dst_path, done: done };
map_set(_file_download_map, url, fdd); map_set(_file_download_map, url, fdd);
krom_http_request(url, size, function (url: string, ab: buffer_t) { krom_http_request(url, size, function (url: string, ab: buffer_t) {
@@ -149,7 +149,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) {
dest += path2; dest += path2;
if (file_exists(dest)) { if (file_exists(dest)) {
///if (krom_darwin || krom_ios) ///if (krom_macos || krom_ios)
done(dest); done(dest);
///else ///else
let p: string; let p: string;
@@ -184,7 +184,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) {
fccd.done(null); fccd.done(null);
return; return;
} }
///if (krom_darwin || krom_ios) ///if (krom_macos || krom_ios)
fccd.done(fccd.dest); fccd.done(fccd.dest);
///else ///else
let p: string; let p: string;
+1 -1
View File
@@ -623,7 +623,7 @@ function history_delete_material_group(group: node_group_t) {
///end ///end
function history_push(name: string): step_t { function history_push(name: string): step_t {
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
let filename: string = project_filepath == "" ? ui_files_filename : substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4); let filename: string = project_filepath == "" ? ui_files_filename : substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4);
sys_title_set(filename + "* - " + manifest_title); sys_title_set(filename + "* - " + manifest_title);
///end ///end
+2 -2
View File
@@ -58,7 +58,7 @@ function project_save(save_and_quit: bool = false) {
///end ///end
} }
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
let filename: string = substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4); let filename: string = substring(project_filepath, string_last_index_of(project_filepath, path_sep) + 1, project_filepath.length - 4);
sys_title_set(filename + " - " + manifest_title); sys_title_set(filename + " - " + manifest_title);
///end ///end
@@ -139,7 +139,7 @@ function project_new_box() {
} }
function project_new(reset_layers: bool = true) { function project_new(reset_layers: bool = true) {
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
sys_title_set(manifest_title); sys_title_set(manifest_title);
///end ///end
project_filepath = ""; project_filepath = "";
+2 -2
View File
@@ -9,7 +9,7 @@ function tab_console_draw(htab: zui_handle_t) {
if (zui_tab(htab, title, false, color) && statush > ui_status_default_status_h * zui_SCALE(ui)) { if (zui_tab(htab, title, false, color) && statush > ui_status_default_status_h * zui_SCALE(ui)) {
zui_begin_sticky(); zui_begin_sticky();
///if (krom_windows || krom_linux || krom_darwin) // Copy ///if (krom_windows || krom_linux || krom_macos) // Copy
if (config_raw.touch_ui) { if (config_raw.touch_ui) {
let row: f32[] = [1 / 4, 1 / 4, 1 / 4]; let row: f32[] = [1 / 4, 1 / 4, 1 / 4];
zui_row(row); zui_row(row);
@@ -46,7 +46,7 @@ function tab_console_draw(htab: zui_handle_t) {
krom_file_save_bytes(path, sys_string_to_buffer(str), 0); krom_file_save_bytes(path, sys_string_to_buffer(str), 0);
}); });
} }
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
if (zui_button(tr("Copy"))) { if (zui_button(tr("Copy"))) {
let str: string = string_array_join(console_last_traces, "\n"); let str: string = string_array_join(console_last_traces, "\n");
krom_copy_to_clipboard(str); krom_copy_to_clipboard(str);
+2 -2
View File
@@ -183,7 +183,7 @@ function tab_swatches_draw(htab: zui_handle_t) {
if (ui.is_hovered && ui.input_released_r) { if (ui.is_hovered && ui.input_released_r) {
context_set_swatch(project_raw.swatches[i]); context_set_swatch(project_raw.swatches[i]);
let add: i32 = project_raw.swatches.length > 1 ? 1 : 0; let add: i32 = project_raw.swatches.length > 1 ? 1 : 0;
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
add += 1; // Copy add += 1; // Copy
///end ///end
@@ -203,7 +203,7 @@ function tab_swatches_draw(htab: zui_handle_t) {
context_set_swatch(project_clone_swatch(context_raw.swatch)); context_set_swatch(project_clone_swatch(context_raw.swatch));
array_push(project_raw.swatches, context_raw.swatch); array_push(project_raw.swatches, context_raw.swatch);
} }
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
else if (ui_menu_button(ui, tr("Copy Hex Code"))) { else if (ui_menu_button(ui, tr("Copy Hex Code"))) {
let color: i32 = context_raw.swatch.base; let color: i32 = context_raw.swatch.base;
color = color_set_ab(color, context_raw.swatch.opacity * 255); color = color_set_ab(color, context_raw.swatch.opacity * 255);
+2 -2
View File
@@ -87,7 +87,7 @@ function ui_box_render() {
} }
_zui_end_element(); _zui_end_element();
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
if (ui_box_copyable) { if (ui_box_copyable) {
let row: f32[] = [1 / 3, 1 / 3, 1 / 3]; let row: f32[] = [1 / 3, 1 / 3, 1 / 3];
zui_row(row); zui_row(row);
@@ -103,7 +103,7 @@ function ui_box_render() {
_zui_end_element(); _zui_end_element();
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
if (ui_box_copyable && zui_button(tr("Copy"))) { if (ui_box_copyable && zui_button(tr("Copy"))) {
krom_copy_to_clipboard(ui_box_text); krom_copy_to_clipboard(ui_box_text);
} }
+2 -2
View File
@@ -4,7 +4,7 @@ let ui_files_default_path: string =
"C:\\Users" "C:\\Users"
///elseif krom_android ///elseif krom_android
"/storage/emulated/0/Download" "/storage/emulated/0/Download"
///elseif krom_darwin ///elseif krom_macos
"/Users" "/Users"
///else ///else
"/" "/"
@@ -58,7 +58,7 @@ function ui_files_release_keys() {
// File dialog may prevent firing key up events // File dialog may prevent firing key up events
keyboard_up_listener(key_code_t.SHIFT); keyboard_up_listener(key_code_t.SHIFT);
keyboard_up_listener(key_code_t.CONTROL); keyboard_up_listener(key_code_t.CONTROL);
///if krom_darwin ///if krom_macos
keyboard_up_listener(key_code_t.META); keyboard_up_listener(key_code_t.META);
///end ///end
} }
+3 -3
View File
@@ -506,14 +506,14 @@ function ui_menu_render() {
file_load_url("https://github.com/armory3d/armortools/issues"); file_load_url("https://github.com/armory3d/armortools/issues");
} }
if (ui_menu_button(ui, tr("Report Bug"))) { if (ui_menu_button(ui, tr("Report Bug"))) {
///if (krom_darwin || krom_ios) // Limited url length ///if (krom_macos || krom_ios) // Limited url length
file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id()); file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id());
///else ///else
file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Issue description:**%0A%0A**Steps to reproduce:**%0A%0A"); file_load_url("https://github.com/armory3d/armortools/issues/new?labels=bug&template=bug_report.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Issue description:**%0A%0A**Steps to reproduce:**%0A%0A");
///end ///end
} }
if (ui_menu_button(ui, tr("Request Feature"))) { if (ui_menu_button(ui, tr("Request Feature"))) {
///if (krom_darwin || krom_ios) // Limited url length ///if (krom_macos || krom_ios) // Limited url length
file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id()); file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id());
///else ///else
file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Feature description:**%0A%0A"); file_load_url("https://github.com/armory3d/armortools/issues/new?labels=feature%20request&template=feature_request.md&body=*" + manifest_title + "%20" + manifest_version + "-" + config_get_sha() + ",%20" + sys_system_id() + "*%0A%0A**Feature description:**%0A%0A");
@@ -611,7 +611,7 @@ function ui_menu_render() {
let row: f32[] = [1 / 3, 1 / 3, 1 / 3]; let row: f32[] = [1 / 3, 1 / 3, 1 / 3];
zui_row(row); zui_row(row);
///if (krom_windows || krom_linux || krom_darwin) ///if (krom_windows || krom_linux || krom_macos)
if (zui_button(tr("Copy"))) { if (zui_button(tr("Copy"))) {
krom_copy_to_clipboard(_ui_menu_render_msg); krom_copy_to_clipboard(_ui_menu_render_msg);
} }
+25 -22
View File
@@ -20,45 +20,47 @@ flags.with_iron = true;
flags.with_zui = true; flags.with_zui = true;
flags.physics = false; //// flags.physics = false; ////
flags.on_c_project_created = function(c_project) { let project = new Project("Base");
c_project.addDefine("IDLE_SLEEP");
{
project.addDefine("IDLE_SLEEP");
let dir = flags.name.toLowerCase(); let dir = flags.name.toLowerCase();
if (graphics === "vulkan") { if (graphics === "vulkan") {
c_project.addDefine("KINC_VKRT"); project.addDefine("KINC_VKRT");
c_project.addProject("../" + dir + "/glsl_to_spirv"); project.addProject("../" + dir + "/glsl_to_spirv");
} }
if (flags.with_onnx) { if (flags.with_onnx) {
c_project.addDefine("WITH_ONNX"); project.addDefine("WITH_ONNX");
c_project.addIncludeDir("../" + dir + "/onnx/include"); project.addIncludeDir("../" + dir + "/onnx/include");
if (platform === "win32") { if (platform === "win32") {
c_project.addLib("../" + dir + "/onnx/win32/onnxruntime"); project.addLib("../" + dir + "/onnx/win32/onnxruntime");
} }
else if (platform === "linux") { else if (platform === "linux") {
// patchelf --set-rpath . ArmorLab // patchelf --set-rpath . ArmorLab
c_project.addLib("onnxruntime -L" + flags.dirname + "/../" + dir + "/onnx/linux"); project.addLib("onnxruntime -L" + flags.dirname + "/../" + dir + "/onnx/linux");
// c_project.addLib("onnxruntime_providers_cuda"); // project.addLib("onnxruntime_providers_cuda");
// c_project.addLib("onnxruntime_providers_shared"); // project.addLib("onnxruntime_providers_shared");
// c_project.addLib("cublasLt"); // project.addLib("cublasLt");
// c_project.addLib("cublas"); // project.addLib("cublas");
// c_project.addLib("cudart"); // project.addLib("cudart");
// c_project.addLib("cudnn"); // project.addLib("cudnn");
// c_project.addLib("cufft"); // project.addLib("cufft");
// c_project.addLib("curand"); // project.addLib("curand");
} }
else if (platform === "osx") { else if (platform === "macos") {
c_project.addLib("../" + dir + "/onnx/macos/libonnxruntime.1.14.1.dylib"); project.addLib("../" + dir + "/onnx/macos/libonnxruntime.1.14.1.dylib");
} }
} }
c_project.addProject("../" + dir + "/Plugins"); project.addProject("../" + dir + "/Plugins");
}; }
let project = new Project("Base"); project.addProject("../armorcore");
project.addSources("Sources"); project.addSources("Sources");
project.addSources("Sources/nodes"); project.addSources("Sources/nodes");
project.addShaders("../armorcore/Shaders/*.glsl", { embed: flags.embed }); project.addShaders("../armorcore/shaders/*.glsl", { embed: flags.embed });
project.addShaders("Shaders/*.glsl", { embed: flags.embed }); project.addShaders("Shaders/*.glsl", { embed: flags.embed });
project.addAssets("Assets/*", { destination: "data/{name}", embed: flags.embed }); project.addAssets("Assets/*", { destination: "data/{name}", embed: flags.embed });
project.addAssets("Assets/locale/*", { destination: "data/locale/{name}" }); project.addAssets("Assets/locale/*", { destination: "data/locale/{name}" });
@@ -121,4 +123,5 @@ if (export_version_info) {
project.addAssets(dir + "/version.json", { destination: "data/{name}", embed: flags.embed }); project.addAssets(dir + "/version.json", { destination: "data/{name}", embed: flags.embed });
} }
project.flatten();
return project; return project;
+1 -1
View File
@@ -14,7 +14,7 @@ flags.on_c_project_created = function(c_project) {
let project = new Project("ArmorPad"); let project = new Project("ArmorPad");
let root = "../../"; let root = "../../";
project.addSources("Sources"); project.addSources("Sources");
project.addShaders(root + "armorcore/Shaders/*.glsl",); project.addShaders(root + "armorcore/shaders/*.glsl",);
project.addAssets(root + "base/Assets/font_mono.ttf", { destination: "data/{name}" }); project.addAssets(root + "base/Assets/font_mono.ttf", { destination: "data/{name}" });
project.addAssets(root + "base/Assets/text_coloring.json", { destination: "data/{name}" }); project.addAssets(root + "base/Assets/text_coloring.json", { destination: "data/{name}" });