From 5ba6ad03f194ac5686898c432c77c0b69fe10105 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 7 Aug 2025 14:15:45 +0200 Subject: [PATCH] Move sculpt to branch --- armorpaint/sources/context_ext.ts | 3 - armorpaint/sources/render_path_paint.ts | 20 - armorsculpt/assets/badge.png | Bin 9151 -> 0 bytes armorsculpt/assets/default_brush.arm | Bin 2081 -> 0 bytes armorsculpt/assets/default_material.arm | Bin 595 -> 0 bytes armorsculpt/assets/keymap_presets/touch.json | 6 - armorsculpt/assets/licenses/keepme.txt | 0 armorsculpt/assets/meshes/keepme.txt | 0 armorsculpt/assets/plugins/keepme.txt | 0 armorsculpt/assets/readme/readme.txt | 14 - armorsculpt/icon.png | Bin 8141 -> 0 bytes armorsculpt/plugins/plugins.c | 8 - armorsculpt/plugins/project.js | 5 - armorsculpt/project.js | 25 -- armorsculpt/readme.md | 6 - armorsculpt/shaders/keepme | 0 armorsculpt/sources/base_ext.ts | 28 -- armorsculpt/sources/export_obj.ts | 101 ----- armorsculpt/sources/import_mesh.ts | 240 ---------- armorsculpt/sources/make_brush.ts | 30 -- armorsculpt/sources/make_material.ts | 323 ------------- armorsculpt/sources/make_mesh.ts | 349 --------------- armorsculpt/sources/make_mesh_preview.ts | 160 ------- armorsculpt/sources/make_sculpt.ts | 94 ---- armorsculpt/sources/manifest.ts | 6 - .../sources/nodes/brush_output_node_ext.ts | 163 ------- armorsculpt/sources/render_path_sculpt.ts | 86 ---- armorsculpt/sources/tab_layers.ts | 423 ------------------ armorsculpt/sources/ui_base_ext.ts | 29 -- armorsculpt/sources/ui_header_ext.ts | 13 - armorsculpt/sources/ui_toolbar_ext.ts | 5 - base/assets/licenses/license_icons.md | 2 +- base/sources/ts/base.ts | 4 +- base/sources/ts/box_preferences.ts | 4 +- base/sources/ts/export_arm.ts | 12 +- base/sources/ts/history.ts | 8 +- base/sources/ts/import_arm.ts | 21 +- base/sources/ts/import_mesh.ts | 12 +- base/sources/ts/layers.ts | 10 +- base/sources/ts/pipes.ts | 4 +- base/sources/ts/project.ts | 34 +- base/sources/ts/render_path_deferred.ts | 23 +- base/sources/ts/slot_layer.ts | 23 - base/sources/ts/tab_browser.ts | 2 +- base/sources/ts/tab_meshes.ts | 2 +- base/sources/ts/tab_plugins.ts | 2 +- base/sources/ts/tab_swatches.ts | 2 +- base/sources/ts/tab_textures.ts | 8 +- base/sources/ts/ui_base.ts | 30 +- base/sources/ts/ui_files.ts | 2 +- base/sources/ts/ui_menu.ts | 8 +- base/sources/ts/ui_menubar.ts | 8 +- base/sources/ts/ui_nodes.ts | 60 +-- base/sources/ts/ui_status.ts | 2 +- base/sources/ts/ui_view2d.ts | 34 +- base/sources/ts/uniforms_ext.ts | 6 +- base/sources/ts/util_encode.ts | 2 +- base/tools/extract_locales.js | 1 - readme.md | 1 - 59 files changed, 131 insertions(+), 2333 deletions(-) delete mode 100644 armorsculpt/assets/badge.png delete mode 100644 armorsculpt/assets/default_brush.arm delete mode 100644 armorsculpt/assets/default_material.arm delete mode 100644 armorsculpt/assets/keymap_presets/touch.json delete mode 100644 armorsculpt/assets/licenses/keepme.txt delete mode 100644 armorsculpt/assets/meshes/keepme.txt delete mode 100644 armorsculpt/assets/plugins/keepme.txt delete mode 100644 armorsculpt/assets/readme/readme.txt delete mode 100644 armorsculpt/icon.png delete mode 100644 armorsculpt/plugins/plugins.c delete mode 100644 armorsculpt/plugins/project.js delete mode 100644 armorsculpt/project.js delete mode 100644 armorsculpt/readme.md delete mode 100644 armorsculpt/shaders/keepme delete mode 100644 armorsculpt/sources/base_ext.ts delete mode 100644 armorsculpt/sources/export_obj.ts delete mode 100644 armorsculpt/sources/import_mesh.ts delete mode 100644 armorsculpt/sources/make_brush.ts delete mode 100644 armorsculpt/sources/make_material.ts delete mode 100644 armorsculpt/sources/make_mesh.ts delete mode 100644 armorsculpt/sources/make_mesh_preview.ts delete mode 100644 armorsculpt/sources/make_sculpt.ts delete mode 100644 armorsculpt/sources/manifest.ts delete mode 100644 armorsculpt/sources/nodes/brush_output_node_ext.ts delete mode 100644 armorsculpt/sources/render_path_sculpt.ts delete mode 100644 armorsculpt/sources/tab_layers.ts delete mode 100644 armorsculpt/sources/ui_base_ext.ts delete mode 100644 armorsculpt/sources/ui_header_ext.ts delete mode 100644 armorsculpt/sources/ui_toolbar_ext.ts diff --git a/armorpaint/sources/context_ext.ts b/armorpaint/sources/context_ext.ts index a509397a..3c66eaf1 100644 --- a/armorpaint/sources/context_ext.ts +++ b/armorpaint/sources/context_ext.ts @@ -5,9 +5,6 @@ function context_ext_init(c: context_t) { c.brush_radius = 0.5; c.brush_radius_handle.value = 0.5; c.brush_hardness = 0.8; - ///if is_sculpt - c.brush_hardness = 0.05; - ///end } function context_ext_select_paint_object(o: mesh_object_t) { diff --git a/armorpaint/sources/render_path_paint.ts b/armorpaint/sources/render_path_paint.ts index f9340434..e8776303 100644 --- a/armorpaint/sources/render_path_paint.ts +++ b/armorpaint/sources/render_path_paint.ts @@ -117,11 +117,6 @@ function render_path_paint_commands_paint(dilation: bool = true) { let tid: i32 = context_raw.layer.id; if (context_raw.pdirty > 0) { - ///if is_sculpt - render_path_sculpt_commands(); - return; - ///end - if (context_raw.tool == workspace_tool_t.COLORID) { render_path_set_target("texpaint_colorid", null, null, clear_flag_t.COLOR, 0xff000000); render_path_bind_target("gbuffer2", "gbuffer2"); @@ -529,12 +524,6 @@ function render_path_paint_live_brush_dirty() { } function render_path_paint_begin() { - - ///if is_sculpt - render_path_sculpt_begin(); - return; - ///end - if (!render_path_paint_dilated) { render_path_paint_dilate(config_raw.dilate == dilate_type_t.DELAYED, true); render_path_paint_dilated = true; @@ -813,11 +802,6 @@ function render_path_paint_restore_plane_mesh() { } function render_path_paint_bind_layers() { - ///if is_sculpt - render_path_sculpt_bind_layers(); - return; - ///end - let is_live: bool = config_raw.brush_live && render_path_paint_live_layer_drawn > 0; let is_material_tool: bool = context_raw.tool == workspace_tool_t.MATERIAL; if (is_live || is_material_tool) { @@ -836,10 +820,6 @@ function render_path_paint_bind_layers() { } function render_path_paint_unbind_layers() { - ///if is_sculpt - return; - ///end - let is_live: bool = config_raw.brush_live && render_path_paint_live_layer_drawn > 0; let is_material_tool: bool = context_raw.tool == workspace_tool_t.MATERIAL; if (is_live || is_material_tool) { diff --git a/armorsculpt/assets/badge.png b/armorsculpt/assets/badge.png deleted file mode 100644 index 8da0c5a334b462ba8279c5eaa06b870fb9ce1066..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9151 zcmbt)XIN8D(CfROU`0|K(L=`eq?+Nc}o06@S!Oy>vyI7egJEdcNq1b}Tz0FcT6 z09w}%7JaG!z@eh?Sn-+P>~4;KcJ}j3WY9ByG-7lik=PW!Kt1BDUQ8-@ zS3#m>-&Vv9q*$vZ^aqBCNYW$!R6wM-HX$P0tOu>8-VZgCdLL>rjA7r2bFB9gm&)1p z^4&vvpvx+X9a}4${M*_pcFsfOuH(eb^g56;xr>q;k}!RNhaFjLbNF*WBS@;}RS&jQ z7z-Bq!}VHx4zq!9I4izb?1Lj$S=56i0^ScAqrWrrNU=h(h}4tu!&xV}Ual`L#vax1 zR{xl6VZ{%B(hFW%fvy=)i4Ck}w$frNlD&Qg1S!QA*d^amWmceCqyI%LrCFC57w_X> zx)}i(21H^BlO3%1O2mYKA{mDFF@PBZ^9C#2QrP6cKPndZM=4@MZm;391Gm={$w2?8 zaQy!lYot)`^N+4ysElZuY(W*;HsYG_l6!alG2dS}cZ#2^Gv7@CHJOF5>AF1rWI)QR z{4(X=!1?UgU8R(Zmkc_2XTUqxHn4Q+eLd~`&71yH_1)>HN=GT9w8s0l<6|qR6gYAw zG4;thaq**%sZ)kCOD<8vZLv2Sl#c(&_IruK$?1Z0F!yd&mq!D~&qYz9i?F5C%5nRj zP+iUvmH!clz>M2}NsyTKtI&}RT-sWgCc&!T=1jmSaidD4wkJ5B*YWwS9`GUY-Hqyh zqcShoJ~0c~7aMR=+Y8g zSR47AS*JsI{Y))2$@2euRB(G&PkjHAR^8z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Jjb|HMmsqFbc0j`wR+^YAwe7B(@9b5Tt=!Otg+k~ z17!iyXfLzAa*n9LwuR~_(G|Z6 z6|;dy|h^?{81{P3D{f%LJe0wMR zXWTz<5aES|2@S>|9+u(9HH1n~3%`8^={?R=lbVo?yp!YnowBV0FE`6lCNE91j%G#2 z=~6a+LyUsUo`5VPetrEFe#SL1<-_$Hg%Z?yZZ~uLwBeKv2H3al|NjY#|9d#&?N?x| zgzhy>c_5}{%0L6~@sB07bGS z#G9D)=RiA$5F?^kJf`3WxZOj!FX84BOR_(jsfFk+4G16Io-w&W1O36F9pII+PyqAN NP|(+?KmNj9DSB!G>%&2RlZy%+`u> z6sT7wv8{k5lpr=%xvQ%C)vM~)!v)82vPJrYqARl{G8%DWI&6j7mu4_eYr}Pf!BT#I z4t6EwFpLt*OE!&UhG2!IHg?Dm|M$P+JT}-&$^6~q13Vq*xc_i>_>wJ;a^5+RTu!z^ zA8gm2K(Ilcmbgi`kA$xhQ{X@~XS=P_{nBB*UhgH_B!@3AL=xEc9}y&S0E~o-&H*7^ z6_$Pkz~BDN*2ojZ(o;rh`2RH+l&?$_h_sLFNuEB2jqMorv6azxg61l8VyR(=2{Lm8q>FMibmfc*>?l*FP^8Glh)fYanAf4n*vS(o7|BGsTR~*I)+C zq;8?7g72i65sn0oAmxxpq5Tp_C0@k3JAN-w6fYRml~$M5x3rb!?h3^yi6=>%j>C8`y$wg{q&Icc^YtqT-uvFI&>i;u%uESYEbpU_ zwL8W~AhDlmX!0(@31*2g-GQRgA&19#hlMt}3rESIGpDZWwYxwe=QCCcn?5s9a=$Vn zz1=vv&;ld|xU&x!aiemE8C~!U3@Fk+dyaT=Fj}z6AL$n{t?Xa?O-!|sW*OLOd%pii h_Jqp+qG=GRMSdu)Rq{JQP%n_%d3zKJ1<0pX-2ldXs~Z3S diff --git a/armorsculpt/assets/keymap_presets/touch.json b/armorsculpt/assets/keymap_presets/touch.json deleted file mode 100644 index 6769a72f..00000000 --- a/armorsculpt/assets/keymap_presets/touch.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "action_sculpt": "left", - "action_rotate": "left", - "action_pan": "right", - "action_zoom": "" -} diff --git a/armorsculpt/assets/licenses/keepme.txt b/armorsculpt/assets/licenses/keepme.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/armorsculpt/assets/meshes/keepme.txt b/armorsculpt/assets/meshes/keepme.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/armorsculpt/assets/plugins/keepme.txt b/armorsculpt/assets/plugins/keepme.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/armorsculpt/assets/readme/readme.txt b/armorsculpt/assets/readme/readme.txt deleted file mode 100644 index 11c29062..00000000 --- a/armorsculpt/assets/readme/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -Thank you for supporting ArmorSculpt! - -Quick start: -https://armory3d.org/sculpt/manual - - ( - ( )\ ) ( ) - )\ ( ) ( (()/( ( )\ ( /( -((((_)( )( ( ( )( /(_)) ( ))\ ((_)` ) )\()) - )\ _ )\(()\ )\ ' )\ (()\ (_)) )\ /((_) _ /(/( (_))/ - (_)_\(_)((_) _((_)) ((_) ((_)/ __| ((_)(_))( | |((_)_\ | |_ - / _ \ | '_|| ' \()/ _ \| '_|\__ \/ _| | || || || '_ \)| _| - /_/ \_\|_| |_|_|_| \___/|_| |___/\__| \_,_||_|| .__/ \__| - |_| diff --git a/armorsculpt/icon.png b/armorsculpt/icon.png deleted file mode 100644 index e621d4ea91a93e5199fdc89a24b8f8ee59ce7e8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8141 zcmd6M^x)LNLffhAP|M7hRQ<_2n>7$gJ49! z#nL1H8E_$S*D!kt0ts_nf55(96um(p_FzpFB_m((RtAYLo$6%QZ00SWpI{PAecw75qX~b!=yUs&~NcSk`;&pQS3)NDi*jK}Hy_YE^2y_XtTHlD?SE zjpz9 z=^J90%JJDfif#z#=oRs6?Hho@k;uo81-7Pe#us{T{Oe7k7|`7To)jYVjd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ev/null @@ -1,8 +0,0 @@ - -#include "../../../base/plugins/plugin_api.h" - -void plugin_embed() { - JSValue global_obj = JS_GetGlobalObject(js_ctx); - - JS_FreeValue(js_ctx, global_obj); -} diff --git a/armorsculpt/plugins/project.js b/armorsculpt/plugins/project.js deleted file mode 100644 index 2bf4c71c..00000000 --- a/armorsculpt/plugins/project.js +++ /dev/null @@ -1,5 +0,0 @@ -let project = new Project("plugins"); - -project.add_cfiles("plugins.c"); - -return project; diff --git a/armorsculpt/project.js b/armorsculpt/project.js deleted file mode 100644 index 37d8da0a..00000000 --- a/armorsculpt/project.js +++ /dev/null @@ -1,25 +0,0 @@ - -let flags = globalThis.flags; -flags.name = "ArmorSculpt"; -flags.package = "org.armorsculpt"; - -let project = new Project(flags.name); -project.add_define("is_sculpt"); -project.add_project("../base"); - -project.add_tsfiles("../armorpaint/sources"); -project.add_tsfiles("../armorpaint/sources/nodes"); -project.add_shaders("../armorpaint/shaders/*.kong"); -project.add_tsfiles("sources"); -project.add_tsfiles("sources/nodes"); -project.add_shaders("shaders/*.kong"); -project.add_assets("assets/*", { destination: "data/{name}" }); -project.add_assets("assets/keymap_presets/*", { destination: "data/keymap_presets/{name}" }); -project.add_assets("assets/licenses/**", { destination: "data/licenses/{name}" }); -project.add_assets("assets/plugins/*", { destination: "data/plugins/{name}" }); -project.add_assets("../armorpaint/assets/plugins/hello_world.js", { destination: "data/plugins/{name}" }); -project.add_assets("assets/meshes/*", { destination: "data/meshes/{name}", noembed: true }); -project.add_assets("assets/readme/readme.txt", { destination: "{name}" }); - -project.flatten(); -return project; diff --git a/armorsculpt/readme.md b/armorsculpt/readme.md deleted file mode 100644 index 204e0ff6..00000000 --- a/armorsculpt/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -![](https://armory3d.org/sculpt/img/git.jpg) - -armorsculpt -============== - -A sculpting experiment with layer workflow and node-based brushes. Please disregard for now. diff --git a/armorsculpt/shaders/keepme b/armorsculpt/shaders/keepme deleted file mode 100644 index e69de29b..00000000 diff --git a/armorsculpt/sources/base_ext.ts b/armorsculpt/sources/base_ext.ts deleted file mode 100644 index bb5d4f8d..00000000 --- a/armorsculpt/sources/base_ext.ts +++ /dev/null @@ -1,28 +0,0 @@ - -function base_ext_init() { - -} - -function base_ext_render() { - if (context_raw.frame == 2) { - util_render_make_material_preview(); - ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; - - base_init_undo_layers(); - - sys_notify_on_next_frame(function () { - sys_notify_on_next_frame(function () { - context_raw.project_type = project_model_t.SPHERE; - project_new(); - }); - }); - } -} - -function base_ext_init_config(raw: config_t) { - -} - -function base_ext_update() { - -} diff --git a/armorsculpt/sources/export_obj.ts b/armorsculpt/sources/export_obj.ts deleted file mode 100644 index bc3984f0..00000000 --- a/armorsculpt/sources/export_obj.ts +++ /dev/null @@ -1,101 +0,0 @@ - -function export_obj_write_string(out: u8[], str: string) { - for (let i: i32 = 0; i < str.length; ++i) { - array_push(out, char_code_at(str, i)); - } -} - -function export_obj_run(path: string, paint_objects: mesh_object_t[], apply_disp: bool = false) { - let o: u8[] = []; - export_obj_write_string(o, "# armorsculpt\n"); - - let texpaint: gpu_texture_t = project_layers[0].texpaint; - let pixels: buffer_t = gpu_get_texture_pixels(texpaint); - let mesh: mesh_data_t = paint_objects[0].data; - let inda: u32_array_t = mesh.index_arrays[0].values; - - let posa: i16_array_t = i16_array_create(inda.length * 4); - for (let i: i32 = 0; i < inda.length; ++i) { - let index: i32 = inda[i]; - posa[index * 4 ] = math_floor(buffer_get_f32(pixels, i * 16 ) * 32767); - posa[index * 4 + 1] = math_floor(buffer_get_f32(pixels, i * 16 + 4) * 32767); - posa[index * 4 + 2] = math_floor(buffer_get_f32(pixels, i * 16 + 8) * 32767); - } - - let poff: i32 = 0; - // for (let i: i32 = 0; i < paint_objects.length; ++i) { - let p: mesh_object_t = paint_objects[0]; - // let mesh = p.data.raw; - let inv: f32 = 1 / 32767; - let sc: f32 = p.data.scale_pos * inv; - // let posa = mesh.vertex_arrays[0].values; - let len: i32 = math_floor(posa.length / 4); - // let len = math_floor(inda.length); - - // Merge shared vertices and remap indices - let posa2: i16_array_t = i16_array_create(len * 3); - let posmap: i32_array_t = i32_array_create(len); - - let pi: i32 = 0; - for (let i: i32 = 0; i < len; ++i) { - let found: bool = false; - for (let j: i32 = 0; j < pi; ++j) { - if (posa2[j * 3 ] == posa[i * 4 ] && - posa2[j * 3 + 1] == posa[i * 4 + 1] && - posa2[j * 3 + 2] == posa[i * 4 + 2]) { - posmap[i] = j; - found = true; - break; - } - } - if (!found) { - posmap[i] = pi; - posa2[pi * 3 ] = posa[i * 4 ]; - posa2[pi * 3 + 1] = posa[i * 4 + 1]; - posa2[pi * 3 + 2] = posa[i * 4 + 2]; - pi++; - } - } - - export_obj_write_string(o, "o " + p.base.name + "\n"); - for (let i: i32 = 0; i < pi; ++i) { - export_obj_write_string(o, "v "); - let f: f32 = posa2[i * 3] * sc; - let vx: string = f + ""; - export_obj_write_string(o, substring(vx, 0, string_index_of(vx, ".") + 7)); - export_obj_write_string(o, " "); - f = posa2[i * 3 + 2] * sc; - let vy: string = f + ""; - export_obj_write_string(o, substring(vy, 0, string_index_of(vy, ".") + 7)); - export_obj_write_string(o, " "); - f = -posa2[i * 3 + 1] * sc; - let vz: string = f + ""; - export_obj_write_string(o, substring(vz, 0, string_index_of(vz, ".") + 7)); - export_obj_write_string(o, "\n"); - } - - // let inda = mesh.index_arrays[0].values; - for (let i: i32 = 0; i < math_floor(inda.length / 3); ++i) { - let pi1: i32 = posmap[inda[i * 3 ]] + 1 + poff; - let pi2: i32 = posmap[inda[i * 3 + 1]] + 1 + poff; - let pi3: i32 = posmap[inda[i * 3 + 2]] + 1 + poff; - export_obj_write_string(o, "f "); - export_obj_write_string(o, pi1 + ""); - export_obj_write_string(o, " "); - export_obj_write_string(o, pi2 + ""); - export_obj_write_string(o, " "); - export_obj_write_string(o, pi3 + ""); - export_obj_write_string(o, "\n"); - } - poff += pi; - // } - - if (!ends_with(path, ".obj")) { - path += ".obj"; - } - - iron_file_save_bytes(path, o, 0); -} - -function export_obj_run_fast(path: string, paint_objects: mesh_object_t[]) { -} diff --git a/armorsculpt/sources/import_mesh.ts b/armorsculpt/sources/import_mesh.ts deleted file mode 100644 index ddc83581..00000000 --- a/armorsculpt/sources/import_mesh.ts +++ /dev/null @@ -1,240 +0,0 @@ - -let import_mesh_clear_layers: bool = true; - -function import_mesh_run(path: string, _clear_layers: bool = true, replace_existing: bool = true) { - if (!path_is_mesh(path)) { - if (!context_enable_import_plugin(path)) { - console_error(strings_unknown_asset_format()); - return; - } - } - - import_mesh_clear_layers = _clear_layers; - context_raw.layer_filter = 0; - - let p: string = to_lower_case(path); - if (ends_with(p, ".obj")) { - import_obj_run(path, replace_existing); - } - else if (ends_with(p, ".blend")) { - import_blend_mesh_run(path, replace_existing); - } - else { - let ext: string = substring(path, string_last_index_of(path, ".") + 1, path.length); - let importer: any = map_get(path_mesh_importers, ext); - let mesh: raw_mesh_t = js_pcall_str(importer, path); - if (replace_existing) { - import_mesh_make_mesh(mesh); - } - else { - import_mesh_add_mesh(mesh); - } - } - - project_mesh_assets = [path]; - - ///if (arm_android || arm_ios) - sys_title_set(substring(path, string_last_index_of(path, path_sep) + 1, string_last_index_of(path, "."))); - ///end -} - -function import_mesh_finish_import() { - if (context_raw.merged_object != null) { - mesh_object_remove(context_raw.merged_object); - data_delete_mesh(context_raw.merged_object.data._.handle); - context_raw.merged_object = null; - } - - context_select_paint_object(context_main_object()); - - if (project_paint_objects.length > 1) { - // Sort by name - array_sort(project_paint_objects, function (pa: any_ptr, pb: any_ptr): i32 { - let a: mesh_object_t = DEREFERENCE(pa); - let b: mesh_object_t = DEREFERENCE(pb); - return strcmp(a.base.name, b.base.name); - }); - - // No mask by default - for (let i: i32 = 0; i < project_paint_objects.length; ++i) { - let p: mesh_object_t = project_paint_objects[i]; - p.base.visible = true; - } - if (context_raw.merged_object == null) { - util_mesh_merge(); - } - context_raw.paint_object.skip_context = "paint"; - context_raw.merged_object.base.visible = true; - } - - viewport_scale_to_bounds(); - - if (context_raw.paint_object.base.name == "") { - context_raw.paint_object.base.name = "Object"; - } - make_material_parse_paint_material(); - make_material_parse_mesh_material(); - - ui_view2d_hwnd.redraws = 2; - - ///if arm_physics - context_raw.paint_body = null; - ///end -} - -function _import_mesh_make_mesh(mesh: raw_mesh_t) { - let raw: raw_mesh_t = import_mesh_raw_mesh(mesh); - - let md: mesh_data_t = mesh_data_create(raw); - context_raw.paint_object = context_main_object(); - - context_select_paint_object(context_main_object()); - for (let i: i32 = 0; i < project_paint_objects.length; ++i) { - let p: mesh_object_t = project_paint_objects[i]; - if (p == context_raw.paint_object) { - continue; - } - data_delete_mesh(p.data._.handle); - mesh_object_remove(p); - } - let handle: string = context_raw.paint_object.data._.handle; - if (handle != "SceneSphere" && handle != "ScenePlane") { - data_delete_mesh(handle); - } - - if (import_mesh_clear_layers) { - while (project_layers.length > 0) { - let l: slot_layer_t = array_pop(project_layers); - slot_layer_unload(l); - } - layers_new_layer(false); - sys_notify_on_init(layers_init); - history_reset(); - } - - mesh_object_set_data(context_raw.paint_object, md); - context_raw.paint_object.base.name = mesh.name; - project_paint_objects = [context_raw.paint_object]; - - md._.handle = raw.name; - map_set(data_cached_meshes, md._.handle, md); - - context_raw.ddirty = 4; - ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2; - ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; - - // Wait for add_mesh calls to finish - sys_notify_on_init(import_mesh_finish_import); - - sys_notify_on_next_frame(function (mesh: raw_mesh_t) { - import_mesh_pack_to_texture(mesh); - }, mesh); -} - -function import_mesh_make_mesh(mesh: raw_mesh_t) { - if (mesh == null || mesh.posa == null || mesh.nora == null || mesh.inda == null || mesh.posa.length == 0) { - console_error(strings_failed_to_read_mesh_data()); - return; - } - - _import_mesh_make_mesh(mesh); -} - -function _import_mesh_is_unique_name(s: string): bool { - for (let i: i32 = 0; i < project_paint_objects.length; ++i) { - let p: mesh_object_t = project_paint_objects[i]; - if (p.base.name == s) { - return false; - } - } - return true; -} - -function _import_mesh_number_ext(i: i32): string { - if (i < 10) { - return ".00" + i; - } - if (i < 100) { - return ".0" + i; - } - return "." + i; -} - -function import_mesh_add_mesh(mesh: raw_mesh_t) { - let raw: raw_mesh_t = import_mesh_raw_mesh(mesh); - - let md: mesh_data_t = mesh_data_create(raw); - - let object: mesh_object_t = scene_add_mesh_object(md, context_raw.paint_object.materials, context_raw.paint_object.base); - object.base.name = mesh.name; - object.skip_context = "paint"; - - // Ensure unique names - let oname: string = object.base.name; - let ext: string = ""; - let i: i32 = 0; - while (!_import_mesh_is_unique_name(oname + ext)) { - ext = _import_mesh_number_ext(++i); - } - object.base.name += ext; - raw.name += ext; - - array_push(project_paint_objects, object); - - md._.handle = raw.name; - map_set(data_cached_meshes, md._.handle, md); - - context_raw.ddirty = 4; - ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2; -} - -function import_mesh_raw_mesh(mesh: raw_mesh_t): mesh_data_t { - let posa: i16_array_t = i16_array_create(mesh.inda.length * 4); - for (let i: i32 = 0; i < posa.length; ++i) { - posa[i] = 32767; - } - - let inda: u32_array_t = u32_array_create(mesh.inda.length); - for (let i: i32 = 0; i < inda.length; ++i) { - inda[i] = i; - } - - let raw: mesh_data_t = { - name: mesh.name, - vertex_arrays: [ - { - values: posa, - attrib: "pos", - data: "short4norm" - } - ], - index_arrays: [ - { - values: inda, - material: 0 - } - ], - scale_pos: 1.0, - scale_tex: 1.0 - }; - return raw; -} - -function import_mesh_pack_to_texture(mesh: raw_mesh_t) { - let b: buffer_t = buffer_create(config_get_texture_res_x() * config_get_texture_res_y() * 4 * 4); - for (let i: i32 = 0; i < math_floor(mesh.inda.length); ++i) { - let index: i32 = mesh.inda[i]; - buffer_set_f32(b, 4 * i * 4, mesh.posa[index * 4] / 32767); - buffer_set_f32(b, 4 * i * 4 + 1 * 4, mesh.posa[index * 4 + 1] / 32767); - buffer_set_f32(b, 4 * i * 4 + 2 * 4, mesh.posa[index * 4 + 2] / 32767); - buffer_set_f32(b, 4 * i * 4 + 3 * 4, 1.0); - } - - let imgmesh: gpu_texture_t = gpu_create_texture_from_bytes(b, config_get_texture_res_x(), config_get_texture_res_y(), tex_format_t.RGBA128); - let texpaint: gpu_texture_t = project_layers[0].texpaint; - draw_begin(texpaint); - draw_set_pipeline(pipes_copy128); - draw_scaled_image(imgmesh, 0, 0, config_get_texture_res_x(), config_get_texture_res_y()); - draw_set_pipeline(null); - draw_end(); -} diff --git a/armorsculpt/sources/make_brush.ts b/armorsculpt/sources/make_brush.ts deleted file mode 100644 index 44edbf57..00000000 --- a/armorsculpt/sources/make_brush.ts +++ /dev/null @@ -1,30 +0,0 @@ - -function make_brush_run(kong: node_shader_t) { - - node_shader_write_frag(kong, "var dist: float = 0.0;"); - - if (config_raw.brush_3d) { - node_shader_write_frag(kong, "var depth: float = sample_lod(gbufferD, sampler_linear, constants.inp.xy, 0.0).r;"); - - node_shader_add_constant(kong, "invVP: float4x4", "_inv_view_proj_matrix"); - node_shader_write_frag(kong, "var winp: float4 = float4(float2(constants.inp.x, 1.0 - constants.inp.y) * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0);"); - node_shader_write_frag(kong, "winp = constants.invVP * winp;"); - node_shader_write_frag(kong, "winp.xyz /= winp.w;"); - - node_shader_add_constant(kong, "W: float4x4", "_world_matrix"); - - node_shader_add_constant(kong, "texpaint_undo_size: float2", "_size(texpaint_undo)"); - - node_shader_write_attrib_frag(kong, "var wposition: float3 = (constants.W * texpaint_undo[uint2(tex_coord.x * constants.texpaint_undo_size.x, tex_coord.y * constants.texpaint_undo_size.y)]).xyz;"); - - node_shader_write_frag(kong, "var depthlast: float = sample_lod(gbufferD, sampler_linear, constants.inplast.xy, 0.0).r;"); - - node_shader_write_frag(kong, "var winplast: float4 = float4(float2(constants.inplast.x, 1.0 - constants.inplast.y) * 2.0 - 1.0, depthlast * 2.0 - 1.0, 1.0);"); - node_shader_write_frag(kong, "winplast = constants.invVP * winplast;"); - node_shader_write_frag(kong, "winplast.xyz /= winplast.w;"); - - node_shader_write_frag(kong, "dist = distance(wposition, winp.xyz);"); - } - - node_shader_write_frag(kong, "if (dist > constants.brush_radius) { discard; }"); -} diff --git a/armorsculpt/sources/make_material.ts b/armorsculpt/sources/make_material.ts deleted file mode 100644 index d8927965..00000000 --- a/armorsculpt/sources/make_material.ts +++ /dev/null @@ -1,323 +0,0 @@ - -let make_material_default_scon: shader_context_t = null; -let make_material_default_mcon: material_context_t = null; - -let make_material_height_used: bool = false; -let make_material_emis_used: bool = false; -let make_material_subs_used: bool = false; - -function make_material_get_mout(): bool { - for (let i: i32 = 0; i < ui_nodes_get_canvas_material().nodes.length; ++i) { - let n: ui_node_t = ui_nodes_get_canvas_material().nodes[i]; - if (n.type == "OUTPUT_MATERIAL_PBR") { - return true; - } - } - return false; -} - -function make_material_parse_mesh_material() { - let m: material_data_t = project_materials[0].data; - - for (let i: i32 = 0; i < m._.shader._.contexts.length; ++i) { - let c: shader_context_t = m._.shader._.contexts[i]; - if (c.name == "mesh") { - array_remove(m._.shader.contexts, c); - array_remove(m._.shader._.contexts, c); - make_material_delete_context(c); - break; - } - } - - if (make_mesh_layer_pass_count > 1) { - let i: i32 = 0; - while (i < m._.shader._.contexts.length) { - let c: shader_context_t = m._.shader._.contexts[i]; - for (let j: i32 = 1; j < make_mesh_layer_pass_count; ++j) { - let name: string = "mesh" + j; - if (c.name == name) { - array_remove(m._.shader.contexts, c); - array_remove(m._.shader._.contexts, c); - make_material_delete_context(c); - i--; - break; - } - } - i++; - } - - i = 0; - while (i < m._.contexts.length) { - let c: material_context_t = m._.contexts[i]; - for (let j: i32 = 1; j < make_mesh_layer_pass_count; ++j) { - let name: string = "mesh" + j; - if (c.name == name) { - array_remove(m.contexts, c); - array_remove(m._.contexts, c); - i--; - break; - } - } - i++; - } - } - - let mm: material_t = { name: "Material", canvas: null }; - let con: node_shader_context_t = make_mesh_run(mm); - let scon: shader_context_t = shader_context_create(con.data); - array_push(m._.shader.contexts, scon); - array_push(m._.shader._.contexts, scon); - - for (let i: i32 = 1; i < make_mesh_layer_pass_count; ++i) { - let mm: material_t = { name: "Material", canvas: null }; - let con: node_shader_context_t = make_mesh_run(mm, i); - let scon: shader_context_t = shader_context_create(con.data); - array_push(m._.shader.contexts, scon); - array_push(m._.shader._.contexts, scon); - - let tmcon: material_context_t = { name: "mesh" + i, bind_textures: [] }; - let mcon: material_context_t = material_context_create(tmcon); - array_push(m.contexts, mcon); - array_push(m._.contexts, mcon); - } - - context_raw.ddirty = 2; -} - -function make_material_parse_mesh_preview_material() { - if (!make_material_get_mout()) { - return; - } - - let m: material_data_t = project_materials[0].data; - let scon: shader_context_t = null; - for (let i: i32 = 0; i < m._.shader._.contexts.length; ++i) { - let c: shader_context_t = m._.shader._.contexts[i]; - if (c.name == "mesh") { - scon = c; - break; - } - } - - array_remove(m._.shader.contexts, scon); - array_remove(m._.shader._.contexts, scon); - - let mcon: material_context_t = { name: "mesh", bind_textures: [] }; - - let sd: material_t = { name: "Material", canvas: null }; - let con: node_shader_context_t = make_mesh_preview_run(sd, mcon); - - for (let i: i32 = 0; i < m._.contexts.length; ++i) { - if (m._.contexts[i].name == "mesh") { - m._.contexts[i] = material_context_create(mcon); - break; - } - } - - if (scon != null) { - make_material_delete_context(scon); - } - - let compile_error: bool = false; - let _scon: shader_context_t = shader_context_create(con.data); - if (_scon == null) { - compile_error = true; - } - scon = _scon; - if (compile_error) { - return; - } - - array_push(m._.shader.contexts, scon); - array_push(m._.shader._.contexts, scon); -} - -function make_material_parse_paint_material(bake_previews: bool = true) { - if (!make_material_get_mout()) { - return; - } - - if (bake_previews) { - let current: gpu_texture_t = _draw_current; - let in_use: bool = gpu_in_use; - if (in_use) draw_end(); - make_material_bake_node_previews(); - if (in_use) draw_begin(current); - } - - let m: material_data_t = project_materials[0].data; - // let scon: shader_context_t = null; - // let mcon: material_context_t = null; - for (let i: i32 = 0; i < m._.shader._.contexts.length; ++i) { - let c: shader_context_t = m._.shader._.contexts[i]; - if (c.name == "paint") { - array_remove(m._.shader.contexts, c); - array_remove(m._.shader._.contexts, c); - if (c != make_material_default_scon) { - make_material_delete_context(c); - } - break; - } - } - for (let i: i32 = 0; i < m._.contexts.length; ++i) { - let c: material_context_t = m._.contexts[i]; - if (c.name == "paint") { - array_remove(m.contexts, c); - array_remove(m._.contexts, c); - break; - } - } - - let sdata: material_t = { name: "Material", canvas: ui_nodes_get_canvas_material() }; - let mcon2: material_context_t = { name: "paint", bind_textures: [] }; - let con: node_shader_context_t = make_sculpt_run(sdata, mcon2); - - let compile_error: bool = false; - let scon2: shader_context_t; - let _scon: shader_context_t = shader_context_create(con.data); - if (_scon == null) { - compile_error = true; - } - scon2 = _scon; - - if (compile_error) { - return; - } - - let mcon3: material_context_t = material_context_create(mcon2); - - array_push(m._.shader.contexts, scon2); - array_push(m._.shader._.contexts, scon2); - array_push(m.contexts, mcon3); - array_push(m._.contexts, mcon3); - - if (make_material_default_scon == null) { - make_material_default_scon = scon2; - } - if (make_material_default_mcon == null) { - make_material_default_mcon = mcon3; - } -} - -function make_material_bake_node_previews() { - context_raw.node_previews_used = []; - if (context_raw.node_previews == null) { - context_raw.node_previews = map_create(); - } - let empty: ui_node_t[] = []; - make_material_traverse_nodes(ui_nodes_get_canvas_material().nodes, null, empty); - - let keys: string[] = map_keys(context_raw.node_previews); - for (let i: i32 = 0; i < keys.length; ++i) { - let key: string = keys[i]; - if (array_index_of(context_raw.node_previews_used, key) == -1) { - let image: gpu_texture_t = map_get(context_raw.node_previews, key); - iron_delete_texture(image); - map_delete(context_raw.node_previews, key); - } - } -} - -function make_material_traverse_nodes(nodes: ui_node_t[], group: ui_node_canvas_t, parents: ui_node_t[]) { - for (let i: i32 = 0; i < nodes.length; ++i) { - let node: ui_node_t = nodes[i]; - make_material_bake_node_preview(node, group, parents); - if (node.type == "GROUP") { - for (let j: i32 = 0; j < project_material_groups.length; ++j) { - let g: node_group_t = project_material_groups[j]; - let cname: string = g.canvas.name; - if (cname == node.name) { - array_push(parents, node); - make_material_traverse_nodes(g.canvas.nodes, g.canvas, parents); - array_pop(parents); - break; - } - } - } - } -} - -function make_material_bake_node_preview(node: ui_node_t, group: ui_node_canvas_t, parents: ui_node_t[]) { - if (node.type == "BLUR") { - let id: string = parser_material_node_name(node, parents); - let image: gpu_texture_t = map_get(context_raw.node_previews, id); - array_push(context_raw.node_previews_used, id); - let res_x: i32 = math_floor(config_get_texture_res_x() / 4); - let res_y: i32 = math_floor(config_get_texture_res_y() / 4); - if (image == null || image.width != res_x || image.height != res_y) { - if (image != null) { - iron_delete_texture(image); - } - image = gpu_create_render_target(res_x, res_y); - map_set(context_raw.node_previews, id, image); - } - - parser_material_blur_passthrough = true; - util_render_make_node_preview(ui_nodes_get_canvas_material(), node, image, group, parents); - parser_material_blur_passthrough = false; - } - else if (node.type == "DIRECT_WARP") { - let id: string = parser_material_node_name(node, parents); - let image: gpu_texture_t = map_get(context_raw.node_previews, id); - array_push(context_raw.node_previews_used, id); - let res_x: i32 = math_floor(config_get_texture_res_x()); - let res_y: i32 = math_floor(config_get_texture_res_y()); - if (image == null || image.width != res_x || image.height != res_y) { - if (image != null) { - iron_delete_texture(image); - } - image = gpu_create_render_target(res_x, res_y); - map_set(context_raw.node_previews, id, image); - } - - parser_material_warp_passthrough = true; - util_render_make_node_preview(ui_nodes_get_canvas_material(), node, image, group, parents); - parser_material_warp_passthrough = false; - } -} - -type parse_node_preview_result_t = { - scon: shader_context_t; - mcon: material_context_t; -}; - -function make_material_parse_node_preview_material(node: ui_node_t, group: ui_node_canvas_t = null, parents: ui_node_t[] = null): parse_node_preview_result_t { - if (node.outputs.length == 0) { - return null; - } - let sdata: material_t = { name: "Material", canvas: ui_nodes_get_canvas_material() }; - let mcon_raw: material_context_t = { name: "mesh", bind_textures: [] }; - let con: node_shader_context_t = make_node_preview_run(sdata, mcon_raw, node, group, parents); - let compile_error: bool = false; - let scon: shader_context_t; - let _scon: shader_context_t = shader_context_create(con.data); - if (_scon == null) { - compile_error = true; - } - scon = _scon; - - if (compile_error) { - return null; - } - let mcon: material_context_t = material_context_create(mcon_raw); - let result: parse_node_preview_result_t = { - scon: scon, - mcon: mcon - }; - return result; -} - -function make_material_parse_brush() { - parser_logic_parse(context_raw.brush.canvas); -} - -function make_material_get_displace_strength(): f32 { - let sc: vec4_t = context_main_object().base.transform.scale; - return config_raw.displace_strength * 0.02 * sc.x; -} - -function make_material_delete_context(c: shader_context_t) { - sys_notify_on_next_frame(function (c: shader_context_t) { // Ensure pipeline is no longer in use - shader_context_delete(c); - }, c); -} diff --git a/armorsculpt/sources/make_mesh.ts b/armorsculpt/sources/make_mesh.ts deleted file mode 100644 index f67acdb6..00000000 --- a/armorsculpt/sources/make_mesh.ts +++ /dev/null @@ -1,349 +0,0 @@ - -let make_mesh_layer_pass_count: i32 = 1; - -function make_mesh_run(data: material_t, layer_pass: i32 = 0): node_shader_context_t { - let context_id: string = layer_pass == 0 ? "mesh" : "mesh" + layer_pass; - let depth_write: bool = layer_pass == 0 ? true : false; - let compare_mode: string = layer_pass == 0 ? "less" : "equal"; - let cull_mode: string = (context_raw.cull_backfaces || layer_pass > 0) ? "clockwise" : "none"; - - let props: shader_context_t = { - name: context_id, - depth_write: depth_write, - compare_mode: compare_mode, - cull_mode: cull_mode, - vertex_elements: [ - { - name: "pos", - data: "short4norm" - } - ], - color_attachments: [ - "RGBA64", - "RGBA64", - "RGBA64" - ], - depth_attachment: "D32" - }; - - let con_mesh: node_shader_context_t = node_shader_context_create(data, props); - - let kong: node_shader_t = node_shader_context_make_kong(con_mesh); - - node_shader_add_out(kong, "tex_coord: float2"); - kong.frag_wvpposition = true; - node_shader_add_constant(kong, "VP: float4x4", "_view_proj_matrix"); - kong.frag_wposition = true; - - let texture_count: i32 = 0; - - node_shader_add_constant(kong, "WVP: float4x4", "_world_view_proj_matrix"); - let lid: i32 = project_layers[0].id; - node_shader_add_texture(kong, "texpaint_vert", "_texpaint_vert" + lid); - node_shader_add_constant(kong, "texpaint_vert_size: float2", "_size(_texpaint_vert" + lid + ")"); - // node_shader_write_vert(kong, "var meshpos: float3 = sample_lod(texpaint_vert, sampler_linear, uint2(vertex_id() % constants.texpaint_vert_size.x, vertex_id() / constants.texpaint_vert_size.y), 0.0).xyz;"); - node_shader_write_vert(kong, "var meshpos: float3 = texpaint_vert[uint2(vertex_id() % constants.texpaint_vert_size.x, vertex_id() / constants.texpaint_vert_size.y)].xyz;"); - // + input.pos.xyz * 0.000001 - node_shader_write_vert(kong, "output.pos = constants.WVP * float4(meshpos.xyz, 1.0);"); - - node_shader_write_vert(kong, "output.tex_coord = float2(0.0, 0.0);"); - node_shader_write_attrib_frag(kong, "var tex_coord: float2 = input.tex_coord;"); - - kong.frag_out = "float4[3]"; - - node_shader_add_constant(kong, "N: float3x3", "_normal_matrix"); - node_shader_add_out(kong, "wnormal: float3"); - - node_shader_write_attrib_vert(kong, "var base_vertex0: int = vertex_id() - (vertex_id() % float(3));"); - node_shader_write_attrib_vert(kong, "var base_vertex1: int = base_vertex0 + 1;"); - node_shader_write_attrib_vert(kong, "var base_vertex2: int = base_vertex0 + 2;"); - // node_shader_write_attrib_vert(kong, "var meshpos0: float3 = sample_lod(texpaint_vert, sampler_linear, uint2(base_vertex0 % constants.texpaint_vert_size.x, base_vertex0 / constants.texpaint_vert_size.y), 0.0).xyz;"); - // node_shader_write_attrib_vert(kong, "var meshpos1: float3 = sample_lod(texpaint_vert, sampler_linear, uint2(base_vertex1 % constants.texpaint_vert_size.x, base_vertex1 / constants.texpaint_vert_size.y), 0.0).xyz;"); - // node_shader_write_attrib_vert(kong, "var meshpos2: float3 = sample_lod(texpaint_vert, sampler_linear, uint2(base_vertex2 % constants.texpaint_vert_size.x, base_vertex2 / constants.texpaint_vert_size.y), 0.0).xyz;"); - node_shader_write_attrib_vert(kong, "var meshpos0: float3 = texpaint_vert[uint2(base_vertex0 % constants.texpaint_vert_size.x, base_vertex0 / constants.texpaint_vert_size.y)].xyz;"); - node_shader_write_attrib_vert(kong, "var meshpos1: float3 = texpaint_vert[uint2(base_vertex1 % constants.texpaint_vert_size.x, base_vertex1 / constants.texpaint_vert_size.y)].xyz;"); - node_shader_write_attrib_vert(kong, "var meshpos2: float3 = texpaint_vert[uint2(base_vertex2 % constants.texpaint_vert_size.x, base_vertex2 / constants.texpaint_vert_size.y)].xyz;"); - node_shader_write_attrib_vert(kong, "var meshnor: float3 = normalize(cross(meshpos2 - meshpos1, meshpos0 - meshpos1));"); - node_shader_write_attrib_vert(kong, "output.wnormal = constants.N * meshnor;"); - node_shader_write_attrib_frag(kong, "var n: float3 = normalize(input.wnormal);"); - - node_shader_add_function(kong, str_pack_float_int16); - node_shader_add_function(kong, str_octahedron_wrap); - node_shader_add_function(kong, str_cotangent_frame); - if (layer_pass > 0) { - node_shader_add_texture(kong, "gbuffer0"); - node_shader_add_texture(kong, "gbuffer1"); - node_shader_add_texture(kong, "gbuffer2"); - node_shader_write_frag(kong, "var fragcoord: float2 = (input.wvpposition.xy / input.wvpposition.w) * 0.5 + 0.5;"); - node_shader_write_frag(kong, "fragcoord.y = 1.0 - fragcoord.y;"); - node_shader_write_frag(kong, "var gbuffer0_sample: float4 = sample_lod(gbuffer0, sampler_linear, fragcoord, 0.0);"); - node_shader_write_frag(kong, "var gbuffer1_sample: float4 = sample_lod(gbuffer1, sampler_linear, fragcoord, 0.0);"); - node_shader_write_frag(kong, "var gbuffer2_sample: float4 = sample_lod(gbuffer2, sampler_linear, fragcoord, 0.0);"); - node_shader_write_frag(kong, "var basecol: float3 = gbuffer0_sample.rgb;"); - node_shader_write_frag(kong, "var roughness: float = gbuffer2_sample.g;"); - node_shader_write_frag(kong, "var metallic: float = gbuffer2_sample.b;"); - node_shader_write_frag(kong, "var occlusion: float = gbuffer2_sample.r;"); - node_shader_write_frag(kong, "var opacity: float = 1.0;//gbuffer0_sample.a;"); - node_shader_write_frag(kong, "var matid: float = gbuffer1_sample.a;"); - node_shader_write_frag(kong, "var ntex: float3 = gbuffer1_sample.rgb;"); - node_shader_write_frag(kong, "var height: float = gbuffer2_sample.a;"); - } - else { - node_shader_write_frag(kong, "var basecol: float3 = float3(0.0, 0.0, 0.0);"); - node_shader_write_frag(kong, "var roughness: float = 0.3;"); - node_shader_write_frag(kong, "var metallic: float = 0.0;"); - node_shader_write_frag(kong, "var occlusion: float = 1.0;"); - node_shader_write_frag(kong, "var opacity: float = 1.0;"); - node_shader_write_frag(kong, "var matid: float = 0.0;"); - node_shader_write_frag(kong, "var ntex: float3 = float3(0.5, 0.5, 1.0);"); - node_shader_write_frag(kong, "var height: float = 0.0;"); - } - node_shader_write_frag(kong, "var texpaint_sample: float4 = float4(0.0, 0.0, 0.0, 1.0);"); - node_shader_write_frag(kong, "var texpaint_nor_sample: float4;"); - node_shader_write_frag(kong, "var texpaint_pack_sample: float4;"); - node_shader_write_frag(kong, "var texpaint_opac: float;"); - - if (make_material_height_used) { - node_shader_write_frag(kong, "var height0: float = 0.0;"); - node_shader_write_frag(kong, "var height1: float = 0.0;"); - node_shader_write_frag(kong, "var height2: float = 0.0;"); - node_shader_write_frag(kong, "var height3: float = 0.0;"); - } - - if (context_raw.draw_wireframe) { - texture_count++; - node_shader_add_texture(kong, "texuvmap", "_texuvmap"); - } - - if (context_raw.viewport_mode == viewport_mode_t.LIT && context_raw.render_mode == render_mode_t.FORWARD) { - texture_count += 2; - node_shader_add_texture(kong, "senvmap_brdf", "$brdf.k"); - node_shader_add_texture(kong, "senvmap_radiance", "_envmap_radiance"); - node_shader_add_texture(kong, "senvmap_radiance0", "_envmap_radiance0"); - node_shader_add_texture(kong, "senvmap_radiance1", "_envmap_radiance1"); - node_shader_add_texture(kong, "senvmap_radiance2", "_envmap_radiance2"); - node_shader_add_texture(kong, "senvmap_radiance3", "_envmap_radiance3"); - node_shader_add_texture(kong, "senvmap_radiance4", "_envmap_radiance4"); - } - - // Get layers for this pass - make_mesh_layer_pass_count = 1; - let layers: slot_layer_t[] = []; - let start_count: i32 = texture_count; - for (let i: i32 = 0; i < project_layers.length; ++i) { - let l: slot_layer_t = project_layers[i]; - if (!slot_layer_is_layer(l) || !slot_layer_is_visible(l)) { - continue; - } - - let count: i32 = 3; - let masks: slot_layer_t[] = slot_layer_get_masks(l); - if (masks != null) { - count += masks.length; - } - texture_count += count; - if (texture_count >= GPU_MAX_TEXTURES - 3) { - texture_count = start_count + count + 3; // gbuffer0_copy, gbuffer1_copy, gbuffer2_copy - make_mesh_layer_pass_count++; - } - if (layer_pass == make_mesh_layer_pass_count - 1) { - array_push(layers, l); - } - } - - let last_pass: bool = layer_pass == make_mesh_layer_pass_count - 1; - - for (let i: i32 = 0; i < layers.length; ++i) { - let l: slot_layer_t = layers[i]; - if (slot_layer_get_object_mask(l) > 0) { - node_shader_add_constant(kong, "uid: int", "_uid"); - if (slot_layer_get_object_mask(l) > project_paint_objects.length) { // Atlas - let visibles: mesh_object_t[] = project_get_atlas_objects(slot_layer_get_object_mask(l)); - node_shader_write_frag(kong, "if ("); - for (let i: i32 = 0; i < visibles.length; ++i) { - if (i > 0) { - node_shader_write_frag(kong, " || "); - } - let uid: i32 = visibles[i].base.uid; - node_shader_write_frag(kong, uid + " == constants.uid"); - } - node_shader_write_frag(kong, ") {"); - } - else { // Object mask - let uid: i32 = project_paint_objects[slot_layer_get_object_mask(l) - 1].base.uid; - node_shader_write_frag(kong, "if (" + uid + " == constants.uid) {"); - } - } - - node_shader_add_texture(kong, "texpaint" + l.id); - node_shader_write_frag(kong, "texpaint_sample = float4(0.8, 0.8, 0.8, 1.0);"); - node_shader_write_frag(kong, "texpaint_opac = texpaint_sample.a;"); - - let masks: slot_layer_t[] = slot_layer_get_masks(l); - if (masks != null) { - let has_visible: bool = false; - for (let i: i32 = 0; i < masks.length; ++i) { - let m: slot_layer_t = masks[i]; - if (slot_layer_is_visible(m)) { - has_visible = true; - break; - } - } - if (has_visible) { - let texpaint_mask: string = "texpaint_mask" + l.id; - node_shader_write_frag(kong, "var " + texpaint_mask + ": float = 0.0;"); - for (let i: i32 = 0; i < masks.length; ++i) { - let m: slot_layer_t = masks[i]; - if (!slot_layer_is_visible(m)) continue; - node_shader_add_texture(kong, "texpaint" + m.id); - node_shader_write_frag(kong, "{"); // Group mask is sampled across multiple layers - node_shader_write_frag(kong, "var texpaint_mask_sample" + m.id + ": float = sample_lod(texpaint" + m.id + ", sampler_liniear, tex_coord, 0.0).r;"); - node_shader_write_frag(kong, "}"); - } - node_shader_write_frag(kong, "texpaint_opac *= clamp(" + texpaint_mask + ", 0.0, 1.0);"); - } - } - - if (slot_layer_get_opacity(l) < 1) { - let opac: f32 = slot_layer_get_opacity(l); - node_shader_write_frag(kong, "texpaint_opac *= " + opac + ";"); - } - - if (l == project_layers[0]) { - node_shader_write_frag(kong, "basecol = float3(0.8, 0.8, 0.8);// texpaint_sample.rgb * texpaint_opac;"); - } - - if (slot_layer_get_object_mask(l) > 0) { - node_shader_write_frag(kong, "}"); - } - - if (last_pass && context_raw.draw_texels) { - node_shader_add_constant(kong, "texpaint_size: float2", "_texpaint_size"); - node_shader_write_frag(kong, "var texel0: float2 = tex_coord * constants.texpaint_size * 0.01;"); - node_shader_write_frag(kong, "var texel1: float2 = tex_coord * constants.texpaint_size * 0.1;"); - node_shader_write_frag(kong, "var texel2: float2 = tex_coord * constants.texpaint_size;"); - node_shader_write_frag(kong, "basecol *= max(float((int(texel0.x) % 2.0) == (int(texel0.y) % 2.0)), 0.9);"); - node_shader_write_frag(kong, "basecol *= max(float((int(texel1.x) % 2.0) == (int(texel1.y) % 2.0)), 0.9);"); - node_shader_write_frag(kong, "basecol *= max(float((int(texel2.x) % 2.0) == (int(texel2.y) % 2.0)), 0.9);"); - } - - if (last_pass && context_raw.draw_wireframe) { - node_shader_write_frag(kong, "basecol *= 1.0 - sample_lod(texuvmap, sampler_linear, tex_coord, 0.0).r;"); - } - - if (make_material_height_used) { - node_shader_write_frag(kong, "if (height > 0.0) {"); - node_shader_write_frag(kong, "var height_dx: float = height0 - height1;"); - node_shader_write_frag(kong, "var height_dy: float = height2 - height3;"); - // Whiteout blend - node_shader_write_frag(kong, "var n1: float3 = ntex * float3(2.0, 2.0, 2.0) - float3(1.0, 1.0, 1.0);"); - node_shader_write_frag(kong, "var n2: float3 = normalize(float3(height_dx * 16.0, height_dy * 16.0, 1.0));"); - node_shader_write_frag(kong, "ntex = normalize(float3(n1.xy + n2.xy, n1.z * n2.z)) * float3(0.5, 0.5, 0.5) + float3(0.5, 0.5, 0.5);"); - node_shader_write_frag(kong, "}"); - } - - if (!last_pass) { - node_shader_write_frag(kong, "output[0] = float4(basecol, opacity);"); - node_shader_write_frag(kong, "output[1] = float4(ntex, matid);"); - node_shader_write_frag(kong, "output[2] = float4(occlusion, roughness, metallic, height);"); - parser_material_finalize(con_mesh); - con_mesh.data.shader_from_source = true; - gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size)); - return con_mesh; - } - - kong.frag_vvec = true; - node_shader_write_frag(kong, "var TBN: float3x3 = cotangent_frame(n, vvec, tex_coord);"); - node_shader_write_frag(kong, "n = ntex * 2.0 - 1.0;"); - node_shader_write_frag(kong, "n.y = -n.y;"); - node_shader_write_frag(kong, "n = normalize(TBN * n);"); - - if (context_raw.viewport_mode == viewport_mode_t.LIT) { - - node_shader_write_frag(kong, "basecol = pow3(basecol, float3(2.2, 2.2, 2.2));"); - - if (context_raw.viewport_shader != null) { - node_shader_write_frag(kong, "var output_color: float3;"); - js_call_ptr(context_raw.viewport_shader, kong); - node_shader_write_frag(kong, "output[1] = float4(output_color, 1.0);"); - } - else if (context_raw.render_mode == render_mode_t.FORWARD) { - kong.frag_wposition = true; - node_shader_write_frag(kong, "var albedo: float3 = lerp3(basecol, float3(0.0, 0.0, 0.0), metallic);"); - node_shader_write_frag(kong, "var f0: float3 = lerp3(float3(0.04, 0.04, 0.04), basecol, metallic);"); - kong.frag_vvec = true; - node_shader_write_frag(kong, "var dotnv: float = max(0.0, dot(n, vvec));"); - // node_shader_write_frag(kong, "var env_brdf: float2 = senvmap_brdf[uint2(float2(roughness, 1.0 - dotnv) * 256.0)].xy;"); - node_shader_write_frag(kong, "var env_brdf: float4 = senvmap_brdf[uint2(float2(roughness, 1.0 - dotnv) * 256.0)];"); - node_shader_add_constant(kong, "envmap_num_mipmaps: int", "_envmap_num_mipmaps"); - node_shader_add_constant(kong, "envmap_data: float4", "_envmap_data"); // angle, sin(angle), cos(angle), strength - node_shader_write_frag(kong, "var wreflect: float3 = reflect(-vvec, n);"); - - node_shader_add_function(kong, str_envmap_equirect); - // node_shader_write_frag(kong, "var envlod: float = roughness * float(constants.envmap_num_mipmaps);"); - // node_shader_write_frag(kong, "var prefiltered_color: float3 = sample_lod(senvmap_radiance, sampler_linear, envmap_equirect(wreflect, constants.envmap_data.x), envlod).rgb;"); - - node_shader_add_function(kong, str_envmap_sample); - node_shader_write_frag(kong, "var envlod: float = roughness * 5.0;"); - node_shader_write_frag(kong, "var lod0: float = floor(envlod);"); - node_shader_write_frag(kong, "var lod1: float = ceil(envlod);"); - node_shader_write_frag(kong, "var lodf: float = envlod - lod0;"); - node_shader_write_frag(kong, "var envmap_coord: float2 = envmap_equirect(wreflect, constants.envmap_data.x);"); - node_shader_write_frag(kong, "var lodc0: float3 = envmap_sample(lod0, envmap_coord);"); - node_shader_write_frag(kong, "var lodc1: float3 = envmap_sample(lod1, envmap_coord);"); - node_shader_write_frag(kong, "var prefiltered_color: float3 = lerp3(lodc0, lodc1, lodf);"); - - // node_shader_add_constant(kong, "shirr: float4[7]", "_envmap_irradiance"); - node_shader_add_constant(kong, "shirr0: float4", "_envmap_irradiance0"); - node_shader_add_constant(kong, "shirr1: float4", "_envmap_irradiance1"); - node_shader_add_constant(kong, "shirr2: float4", "_envmap_irradiance2"); - node_shader_add_constant(kong, "shirr3: float4", "_envmap_irradiance3"); - node_shader_add_constant(kong, "shirr4: float4", "_envmap_irradiance4"); - node_shader_add_constant(kong, "shirr5: float4", "_envmap_irradiance5"); - node_shader_add_constant(kong, "shirr6: float4", "_envmap_irradiance6"); - node_shader_add_function(kong, str_sh_irradiance); - node_shader_write_frag(kong, "var indirect: float3 = albedo * (sh_irradiance(float3(n.x * constants.envmap_data.z - n.y * constants.envmap_data.y, n.x * constants.envmap_data.y + n.y * constants.envmap_data.z, n.z)) / 3.14159265);"); - node_shader_write_frag(kong, "indirect += prefiltered_color * (f0 * env_brdf.x + env_brdf.y) * 1.5;"); - node_shader_write_frag(kong, "indirect *= constants.envmap_data.w * occlusion;"); - node_shader_write_frag(kong, "output[1] = float4(indirect, 1.0);"); - } - else { // Deferred, Pathtraced - if (make_material_emis_used) { - node_shader_write_frag(kong, "if (int(matid * 255.0) % float(3) == 1) { basecol *= 10.0; }"); // Boost for bloom - } - node_shader_write_frag(kong, "output[1] = float4(basecol, occlusion);"); - } - } - else if (context_raw.viewport_mode == viewport_mode_t.OBJECT_NORMAL) { - kong.frag_nattr = true; - node_shader_write_frag(kong, "output[1] = float4(input.nattr, 1.0);"); - } - else if (context_raw.viewport_mode == viewport_mode_t.OBJECT_ID) { - node_shader_add_constant(kong, "object_id: float", "_object_id"); - node_shader_write_frag(kong, "var obid: float = constants.object_id + 1.0 / 255.0;"); - node_shader_write_frag(kong, "var id_r: float = frac(sin(dot(float2(obid, obid * 20.0), float2(12.9898, 78.233))) * 43758.5453);"); - node_shader_write_frag(kong, "var id_g: float = frac(sin(dot(float2(obid * 20.0, obid), float2(12.9898, 78.233))) * 43758.5453);"); - node_shader_write_frag(kong, "var id_b: float = frac(sin(dot(float2(obid, obid * 40.0), float2(12.9898, 78.233))) * 43758.5453);"); - node_shader_write_frag(kong, "output[1] = float4(id_r, id_g, id_b, 1.0);"); - } - else { - node_shader_write_frag(kong, "output[1] = float4(1.0, 0.0, 1.0, 1.0);"); // Pink - } - - if (context_raw.viewport_mode != viewport_mode_t.LIT && context_raw.viewport_mode != viewport_mode_t.PATH_TRACE) { - node_shader_write_frag(kong, "output[1].rgb = pow3(output[1].rgb, float3(2.2, 2.2, 2.2));"); - } - - node_shader_write_frag(kong, "n /= (abs(n.x) + abs(n.y) + abs(n.z));"); - // node_shader_write_frag(kong, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);"); - node_shader_write_frag(kong, "if (n.z < 0.0) { n.xy = octahedron_wrap(n.xy); }"); - node_shader_write_frag(kong, "output[0] = float4(n.xy, roughness, pack_f32_i16(metallic, uint(float(int(matid * 255.0)) % float(3))));"); - } - - node_shader_write_frag(kong, "output[2] = float4(0.0, 0.0, tex_coord.xy);"); - - parser_material_finalize(con_mesh); - con_mesh.data.shader_from_source = true; - gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size)); - return con_mesh; -} diff --git a/armorsculpt/sources/make_mesh_preview.ts b/armorsculpt/sources/make_mesh_preview.ts deleted file mode 100644 index 14c7a033..00000000 --- a/armorsculpt/sources/make_mesh_preview.ts +++ /dev/null @@ -1,160 +0,0 @@ - -let make_mesh_preview_opacity_discard_decal: f32 = 0.05; - -function make_mesh_preview_run(data: material_t, matcon: material_context_t): node_shader_context_t { - let context_id: string = "mesh"; - - let props: shader_context_t = { - name: context_id, - depth_write: true, - compare_mode: "less", - cull_mode: "clockwise", - vertex_elements: [ - { - name: "pos", - data: "short4norm" - }, - { - name: "nor", - data: "short2norm" - }, - { - name: "tex", - data: "short2norm" - } - ], - color_attachments: [ - "RGBA64", - "RGBA64", - "RGBA64" - ], - depth_attachment: "D32" - }; - - let con_mesh: node_shader_context_t = node_shader_context_create(data, props); - - let kong: node_shader_t = node_shader_context_make_kong(con_mesh); - - let pos: string = "input.pos"; - - ///if arm_skin - let skin: bool = mesh_data_get_vertex_array(context_raw.paint_object.data, "bone") != null; - if (skin) { - pos = "spos"; - node_shader_context_add_elem(con_mesh, "bone", "short4norm"); - node_shader_context_add_elem(con_mesh, "weight", "short4norm"); - node_shader_add_function(kong, str_get_skinning_dual_quat); - node_shader_add_constant(kong, "skin_bones: float4[128 * 2]", "_skin_bones"); - node_shader_add_constant(kong, "pos_unpack: float", "_pos_unpack"); - node_shader_write_attrib_vert(kong, "var skin_a: float4;"); - node_shader_write_attrib_vert(kong, "var skin_b: float4;"); - node_shader_write_attrib_vert(kong, "get_skinning_dual_quat(int4(bone * 32767), weight, skin_a, skin_b);"); - node_shader_write_attrib_vert(kong, "var spos: float3 = input.pos.xyz;"); - node_shader_write_attrib_vert(kong, "spos.xyz *= constants.pos_unpack;"); - node_shader_write_attrib_vert(kong, "spos.xyz += 2.0 * cross(skin_a.xyz, cross(skin_a.xyz, spos.xyz) + skin_a.w * spos.xyz);"); - node_shader_write_attrib_vert(kong, "spos.xyz += 2.0 * (skin_a.w * skin_b.xyz - skin_b.w * skin_a.xyz + cross(skin_a.xyz, skin_b.xyz));"); - node_shader_write_attrib_vert(kong, "spos.xyz /= constants.pos_unpack;"); - } - ///end - - node_shader_add_constant(kong, "WVP: float4x4", "_world_view_proj_matrix"); - node_shader_write_attrib_vert(kong, "output.pos = constants.WVP * float4(" + pos + ".xyz, 1.0);"); - - let sc: f32 = context_raw.brush_scale * context_raw.brush_nodes_scale; - let brush_scale: string = sc + ""; - node_shader_add_out(kong, "tex_coord: float2"); - node_shader_write_attrib_vert(kong, "output.tex_coord = input.tex * float(" + brush_scale + ");"); - node_shader_write_attrib_frag(kong, "var tex_coord: float2 = input.tex_coord;"); - - let decal: bool = context_raw.decal_preview; - parser_material_sample_keep_aspect = decal; - parser_material_sample_uv_scale = brush_scale; - parser_material_parse_height = make_material_height_used; - parser_material_parse_height_as_channel = true; - parser_material_parse_height = false; - parser_material_parse_height_as_channel = false; - parser_material_sample_keep_aspect = false; - let base: string = "float3(1.0, 1.0, 1.0)"; - let rough: string = "0.0"; - let met: string = "0.0"; - let occ: string = "0.0"; - let opac: string = "0.0"; - let height: string = "0.0"; - let nortan: string = "float3(1.0, 1.0, 1.0)"; - node_shader_write_frag(kong, "var basecol: float3 = pow3(" + base + ", float3(2.2, 2.2, 2.2));"); - node_shader_write_frag(kong, "var roughness: float = " + rough + ";"); - node_shader_write_frag(kong, "var metallic: float = " + met + ";"); - node_shader_write_frag(kong, "var occlusion: float = " + occ + ";"); - node_shader_write_frag(kong, "var opacity: float = " + opac + ";"); - node_shader_write_frag(kong, "var nortan: float3 = " + nortan + ";"); - node_shader_write_frag(kong, "var height: float = " + height + ";"); - - if (decal) { - if (context_raw.tool == workspace_tool_t.TEXT) { - node_shader_add_texture(kong, "textexttool", "_textexttool"); - node_shader_write_frag(kong, "opacity *= sample_lod(textexttool, sampler_linear, tex_coord / float(" + brush_scale + "), 0.0).r;"); - } - } - if (decal) { - let opac: f32 = make_mesh_preview_opacity_discard_decal; - node_shader_write_frag(kong, "if (opacity < " + opac + ") { discard; }"); - } - - kong.frag_out = "float4[3]"; - kong.frag_n = true; - - node_shader_add_function(kong, str_pack_float_int16); - node_shader_add_function(kong, str_cotangent_frame); - node_shader_add_function(kong, str_octahedron_wrap); - - if (make_material_height_used) { - node_shader_write_frag(kong, "if (height > 0.0) {"); - node_shader_write_frag(kong, "var height_dx: float = ddx(height * 2.0);"); - node_shader_write_frag(kong, "var height_dy: float = ddy(height * 2.0);"); - // Whiteout blend - node_shader_write_frag(kong, "var n1: float3 = nortan * float3(2.0, 2.0, 2.0) - float3(1.0, 1.0, 1.0);"); - node_shader_write_frag(kong, "var n2: float3 = normalize(float3(height_dx * 16.0, height_dy * 16.0, 1.0));"); - node_shader_write_frag(kong, "nortan = normalize(float3(n1.xy + n2.xy, n1.z * n2.z)) * float3(0.5, 0.5, 0.5) + float3(0.5, 0.5, 0.5);"); - node_shader_write_frag(kong, "}"); - } - - // Apply normal channel - if (decal) { - // TODO - } - else { - kong.frag_vvec = true; - node_shader_write_frag(kong, "var TBN: float3x3 = cotangent_frame(n, vvec, tex_coord);"); - node_shader_write_frag(kong, "n = nortan * 2.0 - 1.0;"); - node_shader_write_frag(kong, "n.y = -n.y;"); - node_shader_write_frag(kong, "n = normalize(TBN * n);"); - } - - node_shader_write_frag(kong, "n /= (abs(n.x) + abs(n.y) + abs(n.z));"); - // node_shader_write_frag(kong, "n.xy = n.z >= 0.0 ? n.xy : octahedron_wrap(n.xy);"); - node_shader_write_frag(kong, "if (n.z < 0.0) { n.xy = octahedron_wrap(n.xy); }"); - // var matid: uint = uint(0); - - if (decal) { - node_shader_write_frag(kong, "output[0] = float4(n.x, n.y, roughness, pack_f32_i16(metallic, uint(0)));"); // metallic/matid - node_shader_write_frag(kong, "output[1] = float4(basecol, occlusion);"); - } - else { - node_shader_write_frag(kong, "output[0] = float4(n.x, n.y, lerp(1.0, roughness, opacity), pack_f32_i16(lerp(1.0, metallic, opacity), uint(0)));"); // metallic/matid - node_shader_write_frag(kong, "output[1] = float4(lerp3(float3(0.0, 0.0, 0.0), basecol, opacity), occlusion);"); - } - node_shader_write_frag(kong, "output[2] = float4(0.0, 0.0, 0.0, 0.0);"); // veloc - - parser_material_finalize(con_mesh); - - ///if arm_skin - if (skin) { - node_shader_write_vert(kong, "wnormal = normalize(N * float3(input.nor.xy, input.pos.w) + 2.0 * cross(skin_a.xyz, cross(skin_a.xyz, float3(input.nor.xy, input.pos.w)) + skin_a.w * float3(input.nor.xy, input.pos.w)));"); - } - ///end - - con_mesh.data.shader_from_source = true; - gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_mesh.data.vertex_shader), ADDRESS(con_mesh.data.fragment_shader), ADDRESS(con_mesh.data._.vertex_shader_size), ADDRESS(con_mesh.data._.fragment_shader_size)); - - return con_mesh; -} diff --git a/armorsculpt/sources/make_sculpt.ts b/armorsculpt/sources/make_sculpt.ts deleted file mode 100644 index 0043f2f6..00000000 --- a/armorsculpt/sources/make_sculpt.ts +++ /dev/null @@ -1,94 +0,0 @@ - -function make_sculpt_run(data: material_t, matcon: material_context_t): node_shader_context_t { - let context_id: string = "paint"; - - let props: shader_context_t = { - name: context_id, - depth_write: false, - compare_mode: "always", - cull_mode: "none", - vertex_elements: [ - { - name: "pos", - data: "float2" - } - ], - color_attachments: [ - "RGBA32", - "RGBA32", - "RGBA32", - "R8" - ] - }; - let con_paint: node_shader_context_t = node_shader_context_create(data, props); - - con_paint.data.color_writes_red = [true, true, true, true]; - con_paint.data.color_writes_green = [true, true, true, true]; - con_paint.data.color_writes_blue = [true, true, true, true]; - con_paint.data.color_writes_alpha = [true, true, true, true]; - con_paint.allow_vcols = mesh_data_get_vertex_array(context_raw.paint_object.data, "col") != null; - - let kong: node_shader_t = node_shader_context_make_kong(con_paint); - - let decal: bool = context_is_decal(); - - node_shader_add_out(kong, "tex_coord: float2"); - node_shader_write_vert(kong, "var madd: float2 = float2(0.5, 0.5);"); - node_shader_write_vert(kong, "output.tex_coord = input.pos.xy * madd + madd;"); - node_shader_write_vert(kong, "output.tex_coord.y = 1.0 - output.tex_coord.y;"); - node_shader_write_vert(kong, "output.pos = float4(input.pos.xy, 0.0, 1.0);"); - node_shader_write_attrib_frag(kong, "var tex_coord: float2 = input.tex_coord;"); - - node_shader_add_constant(kong, "inp: float4", "_input_brush"); - node_shader_add_constant(kong, "inplast: float4", "_input_brush_last"); - node_shader_add_texture(kong, "gbufferD"); - - kong.frag_out = "float4[2]"; - - node_shader_add_constant(kong, "brush_radius: float", "_brush_radius"); - node_shader_add_constant(kong, "brush_opacity: float", "_brush_opacity"); - node_shader_add_constant(kong, "brush_hardness: float", "_brush_hardness"); - - if (context_raw.tool == workspace_tool_t.BRUSH || - context_raw.tool == workspace_tool_t.ERASER || - context_raw.tool == workspace_tool_t.CLONE || - context_raw.tool == workspace_tool_t.BLUR || - context_raw.tool == workspace_tool_t.SMUDGE || - context_raw.tool == workspace_tool_t.PARTICLE || - decal) { - - let depth_reject: bool = !context_raw.xray; - - make_brush_run(kong); - } - - node_shader_write_frag(kong, "var basecol: float3 = float3(1.0, 1.0, 1.0);"); - node_shader_write_frag(kong, "var opacity: float = 1.0;"); - node_shader_write_frag(kong, "if (opacity == 0.0) { discard; }"); - - node_shader_write_frag(kong, "var str: float = clamp((constants.brush_radius - dist) * constants.brush_hardness * 400.0, 0.0, 1.0) * opacity;"); - - node_shader_add_texture(kong, "texpaint_undo", "_texpaint_undo"); - node_shader_write_frag(kong, "var sample_undo: float4 = sample_lod(texpaint_undo, sampler_linear, tex_coord, 0.0);"); - - node_shader_write_frag(kong, "if (sample_undo.r == 0 && sample_undo.g == 0 && sample_undo.b == 0) { discard; }"); - - node_shader_add_function(kong, str_octahedron_wrap); - node_shader_add_texture(kong, "gbuffer0_undo"); - node_shader_write_frag(kong, "var g0_undo: float2 = sample_lod(gbuffer0_undo, sampler_linear, constants.inp.xy, 0.0).rg;"); - node_shader_write_frag(kong, "var wn: float3;"); - node_shader_write_frag(kong, "wn.z = 1.0 - abs(g0_undo.x) - abs(g0_undo.y);"); - // node_shader_write_frag(kong, "wn.xy = wn.z >= 0.0 ? g0_undo.xy : octahedron_wrap(g0_undo.xy);"); - node_shader_write_frag(kong, "if (wn.z >= 0.0) { wn.xy = g0_undo.xy; } else { wn.xy = octahedron_wrap(g0_undo.xy); }"); - node_shader_write_frag(kong, "var n: float3 = normalize(wn);"); - - node_shader_write_frag(kong, "output[0] = float4(sample_undo.rgb + n * 0.1 * str, 1.0);"); - - node_shader_write_frag(kong, "output[1] = float4(str, 0.0, 0.0, 1.0);"); - - parser_material_finalize(con_paint); - con_paint.data.shader_from_source = true; - gpu_create_shaders_from_kong(node_shader_get(kong), ADDRESS(con_paint.data.vertex_shader), ADDRESS(con_paint.data.fragment_shader), ADDRESS(con_paint.data._.vertex_shader_size), ADDRESS(con_paint.data._.fragment_shader_size)); - - return con_paint; -} diff --git a/armorsculpt/sources/manifest.ts b/armorsculpt/sources/manifest.ts deleted file mode 100644 index c37441ca..00000000 --- a/armorsculpt/sources/manifest.ts +++ /dev/null @@ -1,6 +0,0 @@ - -let manifest_title: string = "ArmorSculpt"; -let manifest_version: string = "0.1"; -let manifest_url: string = "https://armory3d.org/sculpt"; -let manifest_url_android: string = ""; -let manifest_url_ios: string = ""; diff --git a/armorsculpt/sources/nodes/brush_output_node_ext.ts b/armorsculpt/sources/nodes/brush_output_node_ext.ts deleted file mode 100644 index 3a4a5282..00000000 --- a/armorsculpt/sources/nodes/brush_output_node_ext.ts +++ /dev/null @@ -1,163 +0,0 @@ - -type brush_output_node_t = { - base?: logic_node_t; - raw?: ui_node_t; -}; - -function brush_output_node_create_ext(n: brush_output_node_t) { - context_raw.brush_output_node_inst = n; -} - -function brush_output_node_parse_inputs(self: brush_output_node_t) { - - let last_mask: gpu_texture_t = context_raw.brush_mask_image; - let last_stencil: gpu_texture_t = context_raw.brush_stencil_image; - - let input0: logic_node_value_t = logic_node_input_get(self.base.inputs[0]); - let input1: logic_node_value_t = logic_node_input_get(self.base.inputs[1]); - let input2: logic_node_value_t = logic_node_input_get(self.base.inputs[2]); - let input3: logic_node_value_t = logic_node_input_get(self.base.inputs[3]); - let input4: logic_node_value_t = logic_node_input_get(self.base.inputs[4]); - - context_raw.paint_vec = input0._vec4; - context_raw.brush_nodes_radius = input1._f32; - - let opac: logic_node_value_t = input2; // Float or texture name - if (opac == null) { - opac = { _f32: 1.0 }; - } - if (opac._str != null) { // string - context_raw.brush_mask_image_is_alpha = ends_with(opac._str, ".a"); - opac._str = substring(opac._str, 0, string_last_index_of(opac._str, ".")); - context_raw.brush_nodes_opacity = 1.0; - let index: i32 = array_index_of(project_asset_names, opac._str); - let asset: asset_t = project_assets[index]; - context_raw.brush_mask_image = project_get_image(asset); - } - else { - context_raw.brush_nodes_opacity = opac._f32; - context_raw.brush_mask_image = null; - } - - context_raw.brush_nodes_hardness = input3._f32; - - let stencil: logic_node_value_t = input4; // Float or texture name - if (stencil == null) { - stencil = { _f32: 1.0 }; - } - if (stencil._str != null) { // string - context_raw.brush_stencil_image_is_alpha = ends_with(stencil._str, ".a"); - stencil._str = substring(stencil._str, 0, string_last_index_of(stencil._str, ".")); - let index: i32 = array_index_of(project_asset_names, stencil._str); - let asset: asset_t = project_assets[index]; - context_raw.brush_stencil_image = project_get_image(asset); - } - else { - context_raw.brush_stencil_image = null; - } - - if (last_mask != context_raw.brush_mask_image || - last_stencil != context_raw.brush_stencil_image) { - make_material_parse_paint_material(); - } - - context_raw.brush_directional = self.raw.buttons[0].default_value[0] > 0.0; -} - -function brush_output_node_run(self: brush_output_node_t, from: i32) { - let left: f32 = 0.0; - let right: f32 = 1.0; - let top: f32 = 0.0; - let bottom: f32 = 1.0; - - if (context_raw.paint2d) { - left = 1.0; - right = (context_raw.split_view ? 2.0 : 1.0) + ui_view2d_ww / base_w(); - } - - // Do not paint over floating toolbar - if (context_is_floating_toolbar()) { - let w: i32 = ui_toolbar_x() + ui_toolbar_w(); - left += w / sys_w(); - top += w / sys_h(); - } - - // First time init - if (context_raw.last_paint_x < 0 || context_raw.last_paint_y < 0) { - context_raw.last_paint_vec_x = context_raw.paint_vec.x; - context_raw.last_paint_vec_y = context_raw.paint_vec.y; - } - - // Paint bounds - if (context_raw.paint_vec.x < left || - context_raw.paint_vec.x > right || - context_raw.paint_vec.y < top || - context_raw.paint_vec.y > bottom) { - return; - } - - // Do not paint over fill layer - let fill_layer: bool = context_raw.layer.fill_layer != null; - if (fill_layer) { - return; - } - - // Do not paint over groups - if (slot_layer_is_group(context_raw.layer)) { - return; - } - - if (!slot_layer_is_visible(context_raw.layer) && !context_raw.paint2d) { - return; - } - - if (ui_base_ui.is_hovered || - base_is_dragging || - base_is_resizing || - base_is_scrolling() || - base_is_combo_selected()) { - return; - } - - brush_output_paint(self); - - if (ui_base_ui.is_hovered || - base_is_dragging || - base_is_resizing || - base_is_scrolling() || - base_is_combo_selected()) { - return; - } - - brush_output_paint(self); -} - -function brush_output_paint(self: brush_output_node_t) { - let down: bool = mouse_down() || pen_down(); - - // Prevent painting the same spot - let same_spot: bool = context_raw.paint_vec.x == context_raw.last_paint_x && context_raw.paint_vec.y == context_raw.last_paint_y; - let lazy: bool = context_raw.tool == workspace_tool_t.BRUSH && context_raw.brush_lazy_radius > 0; - if (down && (same_spot || lazy)) { - context_raw.painted++; - } - else { - context_raw.painted = 0; - } - context_raw.last_paint_x = context_raw.paint_vec.x; - context_raw.last_paint_y = context_raw.paint_vec.y; - - if (context_raw.tool == workspace_tool_t.PARTICLE) { - context_raw.painted = 0; // Always paint particles - } - - if (context_raw.painted == 0) { - brush_output_node_parse_inputs(self); - } - - if (context_raw.painted == 0) { - context_raw.pdirty = 1; - context_raw.rdirty = 2; - history_push_undo2 = true; //// - } -} diff --git a/armorsculpt/sources/render_path_sculpt.ts b/armorsculpt/sources/render_path_sculpt.ts deleted file mode 100644 index 8b2f131d..00000000 --- a/armorsculpt/sources/render_path_sculpt.ts +++ /dev/null @@ -1,86 +0,0 @@ - -function render_path_sculpt_commands() { - let tid: i32 = context_raw.layer.id; - let texpaint: string = "texpaint" + tid; - render_path_set_target("texpaint_blend1"); - render_path_bind_target("texpaint_blend0", "tex"); - render_path_draw_shader("shader_datas/copy_pass/copyR8_pass"); - let additional: string[] = ["texpaint_blend0"]; - render_path_set_target(texpaint, additional); - render_path_bind_target("gbufferD_undo", "gbufferD"); - if ((context_raw.xray || config_raw.brush_angle_reject) && config_raw.brush_3d) { - render_path_bind_target("gbuffer0", "gbuffer0"); - } - render_path_bind_target("texpaint_blend1", "paintmask"); - - // Read texcoords from gbuffer - let read_tc: bool = (context_raw.tool == workspace_tool_t.FILL && context_raw.fill_type_handle.position == fill_type_t.FACE) || - context_raw.tool == workspace_tool_t.CLONE || - context_raw.tool == workspace_tool_t.BLUR || - context_raw.tool == workspace_tool_t.SMUDGE; - if (read_tc) { - render_path_bind_target("gbuffer2", "gbuffer2"); - } - render_path_bind_target("gbuffer0_undo", "gbuffer0_undo"); - - let material_contexts: material_context_t[] = []; - let shader_contexts: shader_context_t[] = []; - let mats: material_data_t[] = project_paint_objects[0].materials; - mesh_object_get_contexts(project_paint_objects[0], "paint", mats, material_contexts, shader_contexts); - - let cc_context: shader_context_t = shader_contexts[0]; - gpu_set_pipeline(cc_context._.pipe_state); - uniforms_set_context_consts(cc_context,_render_path_bind_params); - uniforms_set_obj_consts(cc_context, project_paint_objects[0].base); - uniforms_set_material_consts(cc_context, material_contexts[0]); - gpu_set_vertex_buffer(const_data_screen_aligned_vb); - gpu_set_index_buffer(const_data_screen_aligned_ib); - gpu_draw(); - render_path_end(); -} - -function render_path_sculpt_begin() { - - if (!render_path_paint_paint_enabled()) { - return; - } - - render_path_paint_push_undo_last = history_push_undo; - - if (history_push_undo && history_undo_layers != null) { - history_paint(); - - render_path_set_target("gbuffer0_undo"); - render_path_bind_target("gbuffer0", "tex"); - render_path_draw_shader("shader_datas/copy_pass/copy_pass"); - - render_path_set_target("gbufferD_undo"); - render_path_bind_target("main", "tex"); - render_path_draw_shader("shader_datas/copy_pass/copy_pass"); - } - - if (history_push_undo2 && history_undo_layers != null) { - history_paint(); - } - - if (context_raw.paint2d) { - render_path_paint_set_plane_mesh(); - } - - if (render_path_paint_live_layer_drawn > 0) { - render_path_paint_live_layer_drawn--; - } - - if (config_raw.brush_live && context_raw.pdirty <= 0 && context_raw.ddirty <= 0 && context_raw.brush_time == 0) { - // Depth is unchanged, draw before gbuffer gets updated - render_path_paint_commands_live_brush(); - } -} - -function render_path_sculpt_bind_layers() { - - for (let i: i32 = 0; i < project_layers.length; ++i) { - let l: slot_layer_t = project_layers[i]; - render_path_bind_target("texpaint" + l.id, "texpaint" + l.id); - } -} diff --git a/armorsculpt/sources/tab_layers.ts b/armorsculpt/sources/tab_layers.ts deleted file mode 100644 index a5b65373..00000000 --- a/armorsculpt/sources/tab_layers.ts +++ /dev/null @@ -1,423 +0,0 @@ - -let tab_layers_layer_name_edit: i32 = -1; -let tab_layers_layer_name_handle: ui_handle_t = ui_handle_create(); -let tab_layers_show_context_menu: bool = false; - -function tab_layers_draw(htab: ui_handle_t) { - let mini: bool = config_raw.layout[layout_size_t.SIDEBAR_W] <= ui_base_sidebar_mini_w; - mini ? tab_layers_draw_mini(htab) : tab_layers_draw_full(htab); -} - -function tab_layers_draw_mini(htab: ui_handle_t) { - let ui: ui_t = ui_base_ui; - ui_set_hovered_tab_name(tr("Layers")); - - let _ELEMENT_H: i32 = ui.ops.theme.ELEMENT_H; - ui.ops.theme.ELEMENT_H = math_floor(ui_base_sidebar_mini_w / 2 / ui_SCALE(ui)); - - ui_begin_sticky(); - ui_separator(5); - - tab_layers_combo_filter(); - tab_layers_button_new("+"); - - ui_end_sticky(); - ui._y += 2; - - tab_layers_highlight_odd_lines(); - tab_layers_draw_slots(true); - - ui.ops.theme.ELEMENT_H = _ELEMENT_H; -} - -function tab_layers_draw_full(htab: ui_handle_t) { - let ui: ui_t = ui_base_ui; - if (ui_tab(htab, tr("Layers"))) { - ui_begin_sticky(); - let row: f32[] = [1 / 4, 3 / 4]; - ui_row(row); - - tab_layers_button_new(tr("New")); - tab_layers_combo_filter(); - - ui_end_sticky(); - ui._y += 2; - - tab_layers_highlight_odd_lines(); - tab_layers_draw_slots(false); - } -} - -function tab_layers_draw_slots(mini: bool) { - for (let i: i32 = 0; i < project_layers.length; ++i) { - if (i >= project_layers.length) { - break; // Layer was deleted - } - let j: i32 = project_layers.length - 1 - i; - let l: slot_layer_t = project_layers[j]; - tab_layers_draw_layer_slot(l, j, mini); - } -} - -function tab_layers_highlight_odd_lines() { - let ui: ui_t = ui_base_ui; - let step: i32 = ui.ops.theme.ELEMENT_H * 2; - let full_h: i32 = ui._window_h - ui_base_hwnds[0].scroll_offset; - for (let i: i32 = 0; i < math_floor(full_h / step); ++i) { - if (i % 2 == 0) { - ui_fill(0, i * step, (ui._w / ui_SCALE(ui) - 2), step, ui.ops.theme.WINDOW_BG_COL - 0x00040404); - } - } -} - -function tab_layers_button_new(text: string) { - let ui: ui_t = ui_base_ui; - if (ui_button(text)) { - ui_menu_draw(function (ui: ui_t) { - let l: slot_layer_t = context_raw.layer; - if (ui_menu_button(tr("Paint Layer"))) { - layers_new_layer(); - history_new_layer(); - } - }); - } -} - -function tab_layers_combo_filter() { - let ui: ui_t = ui_base_ui; - let ar: string[] = [tr("All")]; - let filter_handle: ui_handle_t = ui_handle(__ID__); - filter_handle.position = context_raw.layer_filter; - context_raw.layer_filter = ui_combo(filter_handle, ar, tr("Filter"), false, ui_align_t.LEFT); -} - -function tab_layers_remap_layer_pointers(nodes: ui_node_t[], pointer_map: map_t) { - for (let i: i32 = 0; i < nodes.length; ++i) { - let n: ui_node_t = nodes[i]; - if (n.type == "LAYER" || n.type == "LAYER_MASK") { - let i: i32 = n.buttons[0].default_value[0]; - if (map_get(pointer_map, i) != -1) { - n.buttons[0].default_value[0] = map_get(pointer_map, i); - } - } - } -} - -function tab_layers_init_layer_map(): map_t { - let res: map_t = map_create(); - for (let i: i32 = 0; i < project_layers.length; ++i) { - map_set(res, project_layers[i], i); - } - return res; -} - -function tab_layers_fill_layer_map(map: map_t): map_t { - let res: map_t = map_create(); - let keys: string[] = map_keys(map); - for (let i: i32 = 0; i < keys.length; ++i) { - let l: string = keys[i]; - map_set(res, map_get(map, l), array_index_of(project_layers, l) > -1 ? array_index_of(project_layers, l) : 9999); - } - return res; -} - -function tab_layers_set_drag_layer(layer: slot_layer_t, off_x: f32, off_y: f32) { - base_drag_off_x = off_x; - base_drag_off_y = off_y; - base_drag_layer = layer; - context_raw.drag_dest = array_index_of(project_layers, layer); -} - -function tab_layers_draw_layer_slot(l: slot_layer_t, i: i32, mini: bool) { - let ui: ui_t = ui_base_ui; - - if (context_raw.layer_filter > 0 && - slot_layer_get_object_mask(l) > 0 && - slot_layer_get_object_mask(l) != context_raw.layer_filter) { - return; - } - - if (l.parent != null && !l.parent.show_panel) { // Group closed - return; - } - if (l.parent != null && l.parent.parent != null && !l.parent.parent.show_panel) { - return; - } - - let step: i32 = ui.ops.theme.ELEMENT_H; - let checkw: i32 = (ui._window_w / 100 * 8) / ui_SCALE(ui); - - // Highlight drag destination - let absy: i32 = ui._window_y + ui._y; - if (base_is_dragging && base_drag_layer != null && context_in_layers()) { - if (mouse_y > absy + step && mouse_y < absy + step * 3) { - let down: bool = array_index_of(project_layers, base_drag_layer) >= i; - context_raw.drag_dest = down ? i : i - 1; - - let ls: slot_layer_t[] = project_layers; - let dest: i32 = context_raw.drag_dest; - let to_group: bool = down ? dest > 0 && ls[dest - 1].parent != null && ls[dest - 1].parent.show_panel : dest < ls.length && ls[dest].parent != null && ls[dest].parent.show_panel; - let nested_group: bool = slot_layer_is_group(base_drag_layer) && to_group; - if (!nested_group) { - if (slot_layer_can_move(context_raw.layer, context_raw.drag_dest)) { - ui_fill(checkw, step * 2, (ui._window_w / ui_SCALE(ui) - 2) - checkw, 2 * ui_SCALE(ui), ui.ops.theme.HIGHLIGHT_COL); - } - } - } - else if (i == project_layers.length - 1 && mouse_y < absy + step) { - context_raw.drag_dest = project_layers.length - 1; - if (slot_layer_can_move(context_raw.layer, context_raw.drag_dest)) { - ui_fill(checkw, 0, (ui._window_w / ui_SCALE(ui) - 2) - checkw, 2 * ui_SCALE(ui), ui.ops.theme.HIGHLIGHT_COL); - } - } - } - if (base_is_dragging && (base_drag_material != null || base_drag_swatch != null) && context_in_layers()) { - if (mouse_y > absy + step && mouse_y < absy + step * 3) { - context_raw.drag_dest = i; - if (tab_layers_can_drop_new_layer(i)) { - ui_fill(checkw, 2 * step, (ui._window_w / ui_SCALE(ui) - 2) - checkw, 2 * ui_SCALE(ui), ui.ops.theme.HIGHLIGHT_COL); - } - } - else if (i == project_layers.length - 1 && mouse_y < absy + step) { - context_raw.drag_dest = project_layers.length; - if (tab_layers_can_drop_new_layer(project_layers.length)) { - ui_fill(checkw, 0, (ui._window_w / ui_SCALE(ui) - 2) - checkw, 2 * ui_SCALE(ui), ui.ops.theme.HIGHLIGHT_COL); - } - } - } - - mini ? tab_layers_draw_layer_slot_mini(l, i) : tab_layers_draw_layer_slot_full(l, i); - - tab_layers_draw_layer_highlight(l, mini); - - if (tab_layers_show_context_menu) { - tab_layers_draw_layer_context_menu(l, mini); - } -} - -function tab_layers_draw_layer_slot_mini(l: slot_layer_t, i: i32) { - let ui: ui_t = ui_base_ui; - - let row: f32[] = [1 / 1, 1 / 1]; - ui_row(row); - _ui_end_element(); - _ui_end_element(); - - ui._y += ui_ELEMENT_H(ui); - ui._y -= ui_ELEMENT_OFFSET(ui); -} - -function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { - let ui: ui_t = ui_base_ui; - - let step: i32 = ui.ops.theme.ELEMENT_H; - - let has_panel: bool = slot_layer_is_group(l) || (slot_layer_is_layer(l) && slot_layer_get_masks(l, false) != null); - if (has_panel) { - let row: f32[] = [8 / 100, 52 / 100, 30 / 100, 10 / 100]; - ui_row(row); - } - else { - let row: f32[] = [8 / 100, 52 / 100, 30 / 100]; - ui_row(row); - } - - // Draw eye icon - let icons: gpu_texture_t = resource_get("icons.k"); - let r: rect_t = resource_tile18(icons, l.visible ? 0 : 1, 0); - let center: i32 = (step / 2) * ui_SCALE(ui); - ui._x += 2; - ui._y += 3; - ui._y += center; - let col: i32 = ui.ops.theme.ACCENT_COL; - let parent_hidden: bool = l.parent != null && (!l.parent.visible || (l.parent.parent != null && !l.parent.parent.visible)); - if (parent_hidden) { - col -= 0x99000000; - } - - if (ui_sub_image(icons, col, -1.0, r.x, r.y, r.w, r.h) == ui_state_t.RELEASED) { - tab_layers_layer_toggle_visible(l); - } - ui._x -= 2; - ui._y -= 3; - ui._y -= center; - - let uix: i32 = ui._x; - let uiy: i32 = ui._y; - - // Draw layer name - ui._y += center; - if (tab_layers_layer_name_edit == l.id) { - tab_layers_layer_name_handle.text = l.name; - l.name = ui_text_input(tab_layers_layer_name_handle); - if (ui.text_selected_handle != tab_layers_layer_name_handle) { - tab_layers_layer_name_edit = -1; - } - } - else { - if (ui.enabled && ui.input_enabled && ui.combo_selected_handle == 0 && - ui.input_x > ui._window_x + ui._x && ui.input_x < ui._window_x + ui._window_w && - ui.input_y > ui._window_y + ui._y - center && ui.input_y < ui._window_y + ui._y - center + (step * ui_SCALE(ui)) * 2) { - if (ui.input_started) { - context_set_layer(l); - tab_layers_set_drag_layer(context_raw.layer, -(mouse_x - uix - ui._window_x - 3), -(mouse_y - uiy - ui._window_y + 1)); - } - else if (ui.input_released) { - if (sys_time() - context_raw.select_time > 0.2) { - context_raw.select_time = sys_time(); - } - } - else if (ui.input_released_r) { - context_set_layer(l); - tab_layers_show_context_menu = true; - } - } - - let state: ui_state_t = ui_text(l.name); - if (state == ui_state_t.RELEASED) { - let td: f32 = sys_time() - context_raw.select_time; - if (td < 0.2 && td > 0.0) { - tab_layers_layer_name_edit = l.id; - tab_layers_layer_name_handle.text = l.name; - ui_start_text_edit(tab_layers_layer_name_handle); - } - } - - // let in_focus: bool = ui.input_x > ui._window_x && ui.input_x < ui._window_x + ui._window_w && - // ui.input_y > ui._window_y && ui.input_y < ui._window_y + ui._window_h; - // if (in_focus && ui.is_delete_down && can_delete(context_raw.layer)) { - // ui.is_delete_down = false; - // let _init() = function () { - // delete_layer(context_raw.layer); - // } - // sys_notify_on_init(_init); - // } - } - ui._y -= center; - - if (l.parent != null) { - ui._x -= 10 * ui_SCALE(ui); - if (l.parent.parent != null) { - ui._x -= 10 * ui_SCALE(ui); - } - } - - if (slot_layer_is_group(l)) { - _ui_end_element(); - } - else { - if (slot_layer_is_mask(l)) { - ui._y += center; - } - - // combo_blending(ui, l); - _ui_end_element(); - - if (slot_layer_is_mask(l)) { - ui._y -= center; - } - } - - if (has_panel) { - ui._y += center; - let layer_panel: ui_handle_t = ui_nest(ui_handle(__ID__), l.id); - layer_panel.selected = l.show_panel; - l.show_panel = ui_panel(layer_panel, "", true, false); - ui._y -= center; - } - - if (slot_layer_is_group(l) || slot_layer_is_mask(l)) { - ui._y -= ui_ELEMENT_OFFSET(ui); - _ui_end_element(); - } - else { - ui._y -= ui_ELEMENT_OFFSET(ui); - - let row: f32[] = [8 / 100, 16 / 100, 36 / 100, 30 / 100, 10 / 100]; - ui_row(row); - _ui_end_element(); - _ui_end_element(); - _ui_end_element(); - - if (config_raw.touch_ui) { - ui._x += 12 * ui_SCALE(ui); - } - - ui._y -= center; - tab_layers_combo_object(ui, l); - ui._y += center; - - _ui_end_element(); - } - - ui._y -= ui_ELEMENT_OFFSET(ui); -} - -function tab_layers_combo_object(ui: ui_t, l: slot_layer_t, label: bool = false): ui_handle_t { - let ar: string[] = [tr("Shared")]; - let object_handle: ui_handle_t = ui_nest(ui_handle(__ID__), l.id); - object_handle.position = l.object_mask; - l.object_mask = ui_combo(object_handle, ar, tr("Object"), label, ui_align_t.LEFT); - return object_handle; -} - -function tab_layers_layer_toggle_visible(l: slot_layer_t) { - l.visible = !l.visible; - ui_view2d_hwnd.redraws = 2; - make_material_parse_mesh_material(); -} - -function tab_layers_draw_layer_highlight(l: slot_layer_t, mini: bool) { - let ui: ui_t = ui_base_ui; - let step: i32 = ui.ops.theme.ELEMENT_H; - - // Separator line - ui_fill(0, 0, (ui._w / ui_SCALE(ui) - 2), 1 * ui_SCALE(ui), ui.ops.theme.SEPARATOR_COL); - - // Highlight selected - if (context_raw.layer == l) { - if (mini) { - ui_rect(1, -step * 2, ui._w / ui_SCALE(ui) - 1, step * 2 + (mini ? -1 : 1), ui.ops.theme.HIGHLIGHT_COL, 3); - } - else { - ui_rect(1, -step * 2 - 1, ui._w / ui_SCALE(ui) - 2, step * 2 + (mini ? -2 : 1), ui.ops.theme.HIGHLIGHT_COL, 2); - } - } -} - -function tab_layers_can_merge_down(l: slot_layer_t) : bool { - let index: i32 = array_index_of(project_layers, l); - // Lowest layer - if (index == 0) { - return false; - } - // Lowest layer that has masks - if (slot_layer_is_layer(l) && slot_layer_is_mask(project_layers[0]) && project_layers[0].parent == l) { - return false; - } - // The lowest toplevel layer is a group - if (slot_layer_is_group(l) && slot_layer_is_in_group(project_layers[0]) && slot_layer_get_containing_group(project_layers[0]) == l) { - return false; - } - // Masks must be merged down to masks - if (slot_layer_is_mask(l) && !slot_layer_is_mask(project_layers[index - 1])) { - return false; - } - return true; -} - -function tab_layers_draw_layer_context_menu(l: slot_layer_t, mini: bool) { - -} - -function tab_layers_can_drop_new_layer(position: i32): bool { - if (position > 0 && position < project_layers.length && slot_layer_is_mask(project_layers[position - 1])) { - // 1. The layer to insert is inserted in the middle - // 2. The layer below is a mask, i.e. the layer would have to be a (group) mask, too. - return false; - } - return true; -} - -function tab_layers_make_mask_preview_rgba32(l: slot_layer_t) { -} diff --git a/armorsculpt/sources/ui_base_ext.ts b/armorsculpt/sources/ui_base_ext.ts deleted file mode 100644 index 1670c691..00000000 --- a/armorsculpt/sources/ui_base_ext.ts +++ /dev/null @@ -1,29 +0,0 @@ - -function ui_base_ext_init_hwnd_tabs(): tab_draw_array_t[] { - - let a0: tab_draw_array_t = [ - _draw_callback_create(tab_layers_draw), - _draw_callback_create(tab_history_draw), - _draw_callback_create(tab_plugins_draw) - ]; - let a1: tab_draw_array_t = [ - _draw_callback_create(tab_materials_draw), - _draw_callback_create(tab_brushes_draw), - _draw_callback_create(tab_particles_draw) - ]; - let a2: tab_draw_array_t = [ - _draw_callback_create(tab_browser_draw), - _draw_callback_create(tab_textures_draw), - _draw_callback_create(tab_meshes_draw), - _draw_callback_create(tab_fonts_draw), - _draw_callback_create(tab_script_draw), - _draw_callback_create(tab_console_draw), - _draw_callback_create(ui_status_draw_version_tab) - ]; - - let r: tab_draw_array_t[] = []; - array_push(r, a0); - array_push(r, a1); - array_push(r, a2); - return r; -} diff --git a/armorsculpt/sources/ui_header_ext.ts b/armorsculpt/sources/ui_header_ext.ts deleted file mode 100644 index b29f7b2f..00000000 --- a/armorsculpt/sources/ui_header_ext.ts +++ /dev/null @@ -1,13 +0,0 @@ - -function ui_header_draw_tool_properties(ui: ui_t) { - if (context_raw.tool == workspace_tool_t.BRUSH) { - context_raw.brush_radius = ui_slider(context_raw.brush_radius_handle, tr("Radius"), 0.01, 2.0, true); - if (ui.is_hovered) { - let vars: map_t = map_create(); - map_set(vars, "brush_radius", map_get(config_keymap, "brush_radius")); - map_set(vars, "brush_radius_decrease", map_get(config_keymap, "brush_radius_decrease")); - map_set(vars, "brush_radius_increase", map_get(config_keymap, "brush_radius_increase")); - ui_tooltip(tr("Hold {brush_radius} and move mouse to the left or press {brush_radius_decrease} to decrease the radius\nHold {brush_radius} and move mouse to the right or press {brush_radius_increase} to increase the radius", vars)); - } - } -} diff --git a/armorsculpt/sources/ui_toolbar_ext.ts b/armorsculpt/sources/ui_toolbar_ext.ts deleted file mode 100644 index 990836da..00000000 --- a/armorsculpt/sources/ui_toolbar_ext.ts +++ /dev/null @@ -1,5 +0,0 @@ - -function ui_toolbar_ext_draw_tools(ui: ui_t, img: gpu_texture_t, icon_accent: i32, keys: string[]) { - - ui_toolbar_draw_tool(workspace_tool_t.BRUSH, ui, img, icon_accent, keys); -} diff --git a/base/assets/licenses/license_icons.md b/base/assets/licenses/license_icons.md index 4c542049..dd8e96fd 100644 --- a/base/assets/licenses/license_icons.md +++ b/base/assets/licenses/license_icons.md @@ -1,7 +1,7 @@ Toolbar icons are courtesy of Sven Möller. -ArmorSculpt and ArmorForge icons courtesy of Matvey Dolgachyov. +ArmorForge icons courtesy of Matvey Dolgachyov. Material icons: https://github.com/google/material-design-icons diff --git a/base/sources/ts/base.ts b/base/sources/ts/base.ts index 8ee78158..ebe1712e 100644 --- a/base/sources/ts/base.ts +++ b/base/sources/ts/base.ts @@ -406,7 +406,7 @@ function base_update() { base_drop_x = mouse_x; base_drop_y = mouse_y; - ///if (is_paint || is_sculpt) + ///if is_paint _base_material_count = project_materials.length; import_asset_run(base_drag_file, base_drop_x, base_drop_y, true, true, function () { // Asset was material @@ -703,7 +703,7 @@ function base_get_uis(): ui_t[] { } function base_is_decal_layer(): bool { - ///if (is_sculpt || is_lab) + ///if is_lab return false; ///end diff --git a/base/sources/ts/box_preferences.ts b/base/sources/ts/box_preferences.ts index 5a2691b5..a8c3fbc6 100644 --- a/base/sources/ts/box_preferences.ts +++ b/base/sources/ts/box_preferences.ts @@ -423,7 +423,7 @@ function box_preferences_show() { } config_raw.server = ui_text_input(server_handle, tr("Cloud Server")); - ///if (is_paint || is_sculpt) + ///if is_paint let material_live_handle: ui_handle_t = ui_handle(__ID__); if (material_live_handle.init) { material_live_handle.selected = config_raw.material_live; @@ -520,7 +520,7 @@ function box_preferences_show() { } config_raw.pressure_sensitivity = ui_slider(h_pressure_sensitivity, tr("Sensitivity"), 0.0, 10.0, true); - ///if (is_paint || is_sculpt) + ///if is_paint let h_pressure_hardness: ui_handle_t = ui_handle(__ID__); if (h_pressure_hardness.init) { h_pressure_hardness.selected = config_raw.pressure_hardness; diff --git a/base/sources/ts/export_arm.ts b/base/sources/ts/export_arm.ts index 4fb07056..003e6ad7 100644 --- a/base/sources/ts/export_arm.ts +++ b/base/sources/ts/export_arm.ts @@ -18,7 +18,7 @@ function export_arm_run_mesh(path: string, paint_objects: mesh_object_t[]) { } function export_arm_run_project() { - ///if (is_paint || is_sculpt) + ///if is_paint let mnodes: ui_node_canvas_t[] = []; for (let i: i32 = 0; i < project_materials.length; ++i) { let m: slot_material_t = project_materials[i]; @@ -59,7 +59,7 @@ function export_arm_run_project() { } } - ///if (is_paint || is_sculpt) + ///if is_paint let md: mesh_data_t[] = []; for (let i: i32 = 0; i < project_paint_objects.length; ++i) { let p: mesh_object_t = project_paint_objects[i]; @@ -73,7 +73,7 @@ function export_arm_run_project() { let texture_files: string[] = export_arm_assets_to_files(project_filepath, project_assets); - ///if (is_paint || is_sculpt) + ///if is_paint let font_files: string[] = export_arm_fonts_to_files(project_filepath, project_fonts); let mesh_files: string[] = export_arm_meshes_to_files(project_filepath); @@ -140,7 +140,7 @@ function export_arm_run_project() { project_raw.camera_origin = export_arm_vec3f32(camera_origins[0].v); project_raw.camera_fov = scene_camera.data.fov; - ///if (is_paint || is_sculpt) + ///if is_paint // project_raw.mesh_datas = md; // TODO: fix GC ref if (project_raw.mesh_datas == null) { project_raw.mesh_datas = md; @@ -201,7 +201,7 @@ function export_arm_run_project() { iron_write_png(substring(project_filepath, 0, project_filepath.length - 4) + "_icon.png", mesh_icon_pixels, 256, 256, 0); ///end - ///if (is_paint || is_sculpt) + ///if is_paint let is_packed: bool = ends_with(project_filepath, "_packed_.arm"); if (is_packed) { // Pack textures export_arm_pack_assets(project_raw, project_assets); @@ -230,7 +230,7 @@ function export_arm_run_project() { } function export_arm_texture_node_name(): string { - ///if (is_paint || is_sculpt) + ///if is_paint return "TEX_IMAGE"; ///else return "image_texture_node"; diff --git a/base/sources/ts/history.ts b/base/sources/ts/history.ts index 06e671d9..e426433c 100644 --- a/base/sources/ts/history.ts +++ b/base/sources/ts/history.ts @@ -609,7 +609,7 @@ function history_push(name: string): step_t { history_redos = 0; } - ///if (is_paint || is_sculpt) + ///if is_paint let opos: i32 = array_index_of(project_paint_objects, context_raw.paint_object); let lpos: i32 = array_index_of(project_layers, context_raw.layer); let mpos: i32 = array_index_of(project_materials, context_raw.material); @@ -670,10 +670,6 @@ function history_swap_active() { } function history_copy_to_undo(from_id: i32, to_id: i32, is_mask: bool) { - ///if is_sculpt - is_mask = true; - ///end - if (is_mask) { render_path_set_target("texpaint_undo" + to_id); render_path_bind_target("texpaint" + from_id, "tex"); @@ -724,7 +720,7 @@ function history_set_canvas(step: step_t, canvas: ui_node_canvas_t) { } function history_swap_canvas(step: step_t) { - ///if (is_paint || is_sculpt) + ///if is_paint if (step.canvas_type == 0) { let _canvas: ui_node_canvas_t = history_get_canvas(step); history_set_canvas(step, step.canvas); diff --git a/base/sources/ts/import_arm.ts b/base/sources/ts/import_arm.ts index 9599c7d0..58ce197a 100644 --- a/base/sources/ts/import_arm.ts +++ b/base/sources/ts/import_arm.ts @@ -20,7 +20,7 @@ function import_arm_run_project(path: string) { project = armpack_decode(b); } - ///if (is_paint || is_sculpt) + ///if is_paint if (project.version != null && project.layer_datas == null) { // Import as material if (project.material_nodes != null) { @@ -49,7 +49,7 @@ function import_arm_run_project(path: string) { sys_title_set(ui_files_filename + " - " + manifest_title); ///end - ///if (is_paint || is_sculpt) + ///if is_paint // Import as mesh instead if (import_as_mesh) { import_arm_run_mesh(project); @@ -73,7 +73,7 @@ function import_arm_run_project(path: string) { project_raw = project; - ///if (is_paint || is_sculpt) + ///if is_paint let l0: layer_data_t = project.layer_datas[0]; base_res_handle.position = config_get_texture_res_pos(l0.res); let bits_pos: texture_bits_t = l0.bpp == 8 ? texture_bits_t.BITS8 : l0.bpp == 16 ? texture_bits_t.BITS16 : texture_bits_t.BITS32; @@ -117,7 +117,7 @@ function import_arm_run_project(path: string) { import_texture_run(abs, hdr_as_envmap); } - ///if (is_paint || is_sculpt) + ///if is_paint if (project.font_assets != null) { for (let i: i32 = 0; i < project.font_assets.length; ++i) { let file: string = project.font_assets[i]; @@ -135,7 +135,7 @@ function import_arm_run_project(path: string) { } ///end - ///if (is_paint || is_sculpt) + ///if is_paint let md: mesh_data_t = mesh_data_create(project.mesh_datas[0]); ///end @@ -149,7 +149,7 @@ function import_arm_run_project(path: string) { context_raw.paint_object.base.name = md.name; project_paint_objects = [context_raw.paint_object]; - ///if (is_paint || is_sculpt) + ///if is_paint for (let i: i32 = 1; i < project.mesh_datas.length; ++i) { let raw: mesh_data_t = project.mesh_datas[i]; let md: mesh_data_t = mesh_data_create(raw); @@ -185,7 +185,7 @@ function import_arm_run_project(path: string) { context_raw.paint_object.skip_context = "paint"; context_raw.merged_object.base.visible = true; - ///if (is_paint || is_sculpt) + ///if is_paint let tex: gpu_texture_t = project_layers[0].texpaint; if (tex.width != config_get_texture_res_x() || tex.height != config_get_texture_res_y()) { if (history_undo_layers != null) { @@ -222,9 +222,6 @@ function import_arm_run_project(path: string) { ///if is_paint let is_mask: bool = ld.texpaint != null && ld.texpaint_nor == null; ///end - ///if is_sculpt - let is_mask: bool = false; - ///end let l: slot_layer_t = slot_layer_create("", is_group ? layer_slot_type_t.GROUP : is_mask ? layer_slot_type_t.MASK : layer_slot_type_t.LAYER); if (ld.name != null) { @@ -346,7 +343,7 @@ function import_arm_run_project(path: string) { } } - ///if (is_paint || is_sculpt) + ///if is_paint for (let i: i32 = 0; i < project_materials.length; ++i) { let m: slot_material_t = project_materials[i]; context_raw.material = m; @@ -628,7 +625,7 @@ function import_arm_make_pink(abs: string) { } function import_arm_texture_node_name(): string { - ///if (is_paint || is_sculpt) + ///if is_paint return "TEX_IMAGE"; ///else return "image_texture_node"; diff --git a/base/sources/ts/import_mesh.ts b/base/sources/ts/import_mesh.ts index f83b69e3..c915b46c 100644 --- a/base/sources/ts/import_mesh.ts +++ b/base/sources/ts/import_mesh.ts @@ -2,7 +2,7 @@ let import_mesh_clear_layers: bool = true; let import_mesh_meshes_to_unwrap: any[] = null; -///if (is_paint || is_sculpt) +///if is_paint function import_mesh_run(path: string, _clear_layers: bool = true, replace_existing: bool = true) { ///end @@ -17,7 +17,7 @@ function import_mesh_run(path: string, replace_existing: bool = true) { } } - ///if (is_paint || is_sculpt) + ///if is_paint import_mesh_clear_layers = _clear_layers; context_raw.layer_filter = 0; ///end @@ -97,7 +97,7 @@ function import_mesh_finish_import() { make_material_parse_paint_material(); make_material_parse_mesh_material(); - ///if (is_paint || is_sculpt) + ///if is_paint ui_view2d_hwnd.redraws = 2; ///end @@ -141,7 +141,7 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) { context_raw.ddirty = 4; - ///if (is_paint || is_sculpt) + ///if is_paint ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2; ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; util_uv_uvmap_cached = false; @@ -149,7 +149,7 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) { util_uv_dilatemap_cached = false; ///end - ///if (is_paint || is_sculpt) + ///if is_paint if (import_mesh_clear_layers) { while (project_layers.length > 0) { let l: slot_layer_t = array_pop(project_layers); @@ -245,7 +245,7 @@ function _import_mesh_add_mesh(mesh: raw_mesh_t) { context_raw.ddirty = 4; - ///if (is_paint || is_sculpt) + ///if is_paint ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2; util_uv_uvmap_cached = false; util_uv_trianglemap_cached = false; diff --git a/base/sources/ts/layers.ts b/base/sources/ts/layers.ts index ba0813be..5608a550 100644 --- a/base/sources/ts/layers.ts +++ b/base/sources/ts/layers.ts @@ -21,7 +21,7 @@ let _layers_roughness: f32; let _layers_metallic: f32; function layers_init() { - ///if (is_paint || is_sculpt) + ///if is_paint slot_layer_clear(project_layers[0], color_from_floats(layers_default_base, layers_default_base, layers_default_base, 1.0)); ///end @@ -119,7 +119,7 @@ function layers_set_bits() { } function layers_make_temp_img() { - ///if (is_paint || is_sculpt) + ///if is_paint let l: slot_layer_t = project_layers[0]; ///end ///if is_lab @@ -162,7 +162,7 @@ function layers_make_temp_mask_img() { } function layers_make_export_img() { - ///if (is_paint || is_sculpt) + ///if is_paint let l: slot_layer_t = project_layers[0]; ///end ///if is_lab @@ -409,10 +409,6 @@ function layers_update_fill_layer(parse_paint: bool = true) { } function layers_set_object_mask() { - ///if is_sculpt - return; - ///end - let ar: string[] = [tr("None")]; for (let i: i32 = 0; i < project_paint_objects.length; ++i) { let p: mesh_object_t = project_paint_objects[i]; diff --git a/base/sources/ts/pipes.ts b/base/sources/ts/pipes.ts index 361e3f4a..e261eaa0 100644 --- a/base/sources/ts/pipes.ts +++ b/base/sources/ts/pipes.ts @@ -69,7 +69,7 @@ function _pipes_make_merge(red: bool, green: bool, blue: bool, alpha: bool): gpu } function pipes_init() { - ///if (is_paint || is_sculpt) + ///if is_paint pipes_merge = _pipes_make_merge(true, true, true, true); pipes_merge_r = _pipes_make_merge(true, false, false, false); pipes_merge_g = _pipes_make_merge(false, true, false, false); @@ -140,7 +140,7 @@ function pipes_init() { gpu_pipeline_compile(pipes_copy128); } - ///if (is_paint || is_sculpt) + ///if is_paint { pipes_invert8 = gpu_create_pipeline(); pipes_invert8.vertex_shader = sys_get_shader("layer_invert.vert"); diff --git a/base/sources/ts/project.ts b/base/sources/ts/project.ts index 6b309af5..01da8846 100644 --- a/base/sources/ts/project.ts +++ b/base/sources/ts/project.ts @@ -100,7 +100,7 @@ function project_save_as(save_and_quit: bool = false) { } function project_new_box() { - ///if (is_paint || is_sculpt) + ///if is_paint ui_box_show_custom(function (ui: ui_t) { if (ui_tab(ui_handle(__ID__), tr("New Project"))) { if (project_mesh_list == null) { @@ -200,14 +200,6 @@ function project_new(reset_layers: bool = true) { geom_make_plane(1, 1, 512, 512); mesh.name = "Tessellated"; raw = import_mesh_raw_mesh(mesh); - - ///if is_sculpt - sys_notify_on_next_frame(function (mesh: raw_mesh_t) { - sys_notify_on_init(function (mesh: raw_mesh_t) { - import_mesh_pack_to_texture(mesh); - }, mesh); - }, mesh); - ///end } else { let b: buffer_t = data_get_blob("meshes/" + project_mesh_list[context_raw.project_type] + ".arm"); @@ -239,20 +231,20 @@ function project_new(reset_layers: bool = true) { transform_build_matrix(context_raw.paint_object.base.transform); context_raw.paint_object.base.name = n; project_paint_objects = [context_raw.paint_object]; - ///if (is_paint || is_sculpt) + ///if is_paint while (project_materials.length > 0) { slot_material_unload(array_pop(project_materials)); } ///end let m: material_data_t = data_get_material("Scene", "Material"); - ///if (is_paint || is_sculpt) + ///if is_paint array_push(project_materials, slot_material_create(m)); ///end ///if is_lab project_material_data = m; ///end - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.material = project_materials[0]; ///end @@ -260,7 +252,7 @@ function project_new(reset_layers: bool = true) { ui_nodes_group_stack = []; project_material_groups = []; - ///if (is_paint || is_sculpt) + ///if is_paint project_brushes = [slot_brush_create()]; context_raw.brush = project_brushes[0]; @@ -278,7 +270,7 @@ function project_new(reset_layers: bool = true) { make_material_parse_paint_material(); make_material_parse_brush(); - ///if (is_paint || is_sculpt) + ///if is_paint util_render_make_material_preview(); ///end @@ -293,14 +285,14 @@ function project_new(reset_layers: bool = true) { project_raw.packed_assets = []; context_raw.ddirty = 4; - ///if (is_paint || is_sculpt) + ///if is_paint ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2; ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; ///end if (reset_layers) { - ///if (is_paint || is_sculpt) + ///if is_paint let aspect_ratio_changed: bool = project_layers[0].texpaint.width != config_get_texture_res_x() || project_layers[0].texpaint.height != config_get_texture_res_y(); while (project_layers.length > 0) { slot_layer_unload(array_pop(project_layers)); @@ -328,7 +320,7 @@ function project_new(reset_layers: bool = true) { scene_world._.irradiance = context_raw.default_irradiance; scene_world.strength = 4.0; - ///if (is_paint || is_sculpt) + ///if is_paint context_init_tool(); ///end @@ -441,7 +433,7 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl } } - ///if (is_paint || is_sculpt) + ///if is_paint if (ends_with(to_lower_case(path), ".fbx")) { let h: ui_handle_t = ui_handle(__ID__); h.selected = context_raw.parse_vcols; @@ -468,7 +460,7 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl console_toast(tr("Importing mesh")); ///end - ///if (is_paint || is_sculpt) + ///if is_paint import_mesh_run(path, clear_layers, replace_existing); ///end ///if is_lab @@ -611,7 +603,7 @@ function project_reimport_texture_load(path: string, asset: asset_t) { array_insert(project_assets, i, array_pop(project_assets)); array_insert(project_asset_names, i, array_pop(project_asset_names)); - ///if (is_paint || is_sculpt) + ///if is_paint if (context_raw.texture == old_asset) { context_raw.texture = project_assets[i]; } @@ -620,7 +612,7 @@ function project_reimport_texture_load(path: string, asset: asset_t) { sys_notify_on_next_frame(function () { make_material_parse_paint_material(); - ///if (is_paint || is_sculpt) + ///if is_paint util_render_make_material_preview(); ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; ///end diff --git a/base/sources/ts/render_path_deferred.ts b/base/sources/ts/render_path_deferred.ts index 302213ff..5fa7f269 100644 --- a/base/sources/ts/render_path_deferred.ts +++ b/base/sources/ts/render_path_deferred.ts @@ -81,27 +81,6 @@ function render_path_deferred_init() { map_set(render_path_render_targets, t.name, t); } - ///if is_sculpt - { - let t: render_target_t = render_target_create(); - t.name = "gbuffer0_undo"; - t.width = 0; - t.height = 0; - t.format = "RGBA64"; - t.scale = render_path_base_get_super_sampling(); - render_path_create_render_target(t); - } - { - let t: render_target_t = render_target_create(); - t.name = "gbufferD_undo"; - t.width = 0; - t.height = 0; - t.format = "R32"; - t.scale = render_path_base_get_super_sampling(); - render_path_create_render_target(t); - } - ///end - if (config_raw.rp_ssao) { render_path_base_init_ssao(); } @@ -119,7 +98,7 @@ function render_path_deferred_init() { render_path_paint_init(); - ///if (is_paint || is_sculpt) + ///if is_paint render_path_preview_init(); ///end diff --git a/base/sources/ts/slot_layer.ts b/base/sources/ts/slot_layer.ts index 3ee0eb7f..1d607508 100644 --- a/base/sources/ts/slot_layer.ts +++ b/base/sources/ts/slot_layer.ts @@ -79,9 +79,6 @@ function slot_layer_create(ext: string = "", type: layer_slot_type_t = layer_slo let format: string = base_bits_handle.position == texture_bits_t.BITS8 ? "RGBA32" : base_bits_handle.position == texture_bits_t.BITS16 ? "RGBA64" : "RGBA128"; - ///if is_sculpt - format = "RGBA128"; - ///end { let t: render_target_t = render_target_create(); @@ -368,10 +365,6 @@ function slot_layer_resize_and_set_bits(raw: slot_layer_t) { base_bits_handle.position == texture_bits_t.BITS16 ? tex_format_t.RGBA64 : tex_format_t.RGBA128; - ///if is_sculpt - format = tex_format_t.RGBA128; - ///end - let pipe: gpu_pipeline_t = format == tex_format_t.RGBA32 ? pipes_copy : format == tex_format_t.RGBA64 ? pipes_copy64 : pipes_copy128; @@ -567,10 +560,6 @@ function slot_layer_get_object_mask(raw: slot_layer_t): i32 { } function slot_layer_is_layer(raw: slot_layer_t): bool { - ///if is_sculpt - return raw.texpaint != null; - ///end - return raw.texpaint != null && raw.texpaint_nor != null; } @@ -591,26 +580,14 @@ function slot_layer_get_containing_group(raw: slot_layer_t): slot_layer_t { } function slot_layer_is_mask(raw: slot_layer_t): bool { - ///if is_sculpt - return false; - ///end - return raw.texpaint != null && raw.texpaint_nor == null; } function slot_layer_is_group_mask(raw: slot_layer_t): bool { - ///if is_sculpt - return false; - ///end - return raw.texpaint != null && raw.texpaint_nor == null && slot_layer_is_group(raw.parent); } function slot_layer_is_layer_mask(raw: slot_layer_t): bool { - ///if is_sculpt - return false; - ///end - return raw.texpaint != null && raw.texpaint_nor == null && slot_layer_is_layer(raw.parent); } diff --git a/base/sources/ts/tab_browser.ts b/base/sources/ts/tab_browser.ts index d7f86e13..0ff9e6f9 100644 --- a/base/sources/ts/tab_browser.ts +++ b/base/sources/ts/tab_browser.ts @@ -155,7 +155,7 @@ function tab_browser_draw(htab: ui_handle_t) { }); } - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_menu_button(tr("Set as Mask"))) { import_asset_run(file, -1.0, -1.0, true, true, function () { sys_notify_on_next_frame(function () { diff --git a/base/sources/ts/tab_meshes.ts b/base/sources/ts/tab_meshes.ts index 13a2d2ea..1bc24577 100644 --- a/base/sources/ts/tab_meshes.ts +++ b/base/sources/ts/tab_meshes.ts @@ -8,7 +8,7 @@ function tab_meshes_draw(htab: ui_handle_t) { ui_begin_sticky(); - ///if (is_paint || is_sculpt) + ///if is_paint if (config_raw.touch_ui) { ui_row6(); } diff --git a/base/sources/ts/tab_plugins.ts b/base/sources/ts/tab_plugins.ts index 12dea39e..877c354e 100644 --- a/base/sources/ts/tab_plugins.ts +++ b/base/sources/ts/tab_plugins.ts @@ -5,7 +5,7 @@ function tab_plugins_draw(htab: ui_handle_t) { ui_begin_sticky(); - ///if (is_paint || is_sculpt) + ///if is_paint let row: f32[] = [1 / 4]; ui_row(row); ///end diff --git a/base/sources/ts/tab_swatches.ts b/base/sources/ts/tab_swatches.ts index 2ccd2f5a..4098d451 100644 --- a/base/sources/ts/tab_swatches.ts +++ b/base/sources/ts/tab_swatches.ts @@ -205,7 +205,7 @@ function tab_swatches_draw(htab: ui_handle_t) { else if (project_raw.swatches.length > 1 && ui_menu_button(tr("Delete"), "delete")) { tab_swatches_delete_swatch(project_raw.swatches[i]); } - ///if (is_paint || is_sculpt) + ///if is_paint else if (ui_menu_button(tr("Create Material"))) { tab_materials_accept_swatch_drag(project_raw.swatches[i]); } diff --git a/base/sources/ts/tab_textures.ts b/base/sources/ts/tab_textures.ts index f2f32717..19dc02b1 100644 --- a/base/sources/ts/tab_textures.ts +++ b/base/sources/ts/tab_textures.ts @@ -39,7 +39,7 @@ function tab_textures_draw(htab: ui_handle_t) { if (project_assets.length > 0) { - ///if (is_paint || is_sculpt) + ///if is_paint let statusw: i32 = iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W]; ///end ///if is_lab @@ -166,7 +166,7 @@ function tab_textures_draw(htab: ui_handle_t) { project_reimport_texture(_tab_textures_draw_asset); } - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_menu_button(tr("To Mask"))) { sys_notify_on_next_frame(function () { layers_create_image_mask(_tab_textures_draw_asset); @@ -283,13 +283,13 @@ function tab_textures_delete_texture(asset: asset_t) { sys_notify_on_next_frame(function () { make_material_parse_paint_material(); - ///if (is_paint || is_sculpt) + ///if is_paint util_render_make_material_preview(); ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; ///end }); - ///if (is_paint || is_sculpt) + ///if is_paint for (let i: i32 = 0; i < project_materials.length; ++i) { let m: slot_material_t = project_materials[i]; tab_textures_update_texture_pointers(m.canvas.nodes, i); diff --git a/base/sources/ts/ui_base.ts b/base/sources/ts/ui_base.ts index 69a88a7b..cad2b74b 100644 --- a/base/sources/ts/ui_base.ts +++ b/base/sources/ts/ui_base.ts @@ -56,7 +56,7 @@ function ui_base_init_hwnd_tabs(): tab_draw_array_t[] { } function ui_base_init() { - ///if (is_paint || is_sculpt) + ///if is_paint ui_toolbar_init(); context_raw.text_tool_text = tr("Text"); ///end @@ -68,7 +68,7 @@ function ui_base_init() { ui_header_h = math_floor(ui_header_default_h * config_raw.window_scale); ui_menubar_w = math_floor(ui_menubar_default_w * config_raw.window_scale); - ///if (is_paint || is_sculpt) + ///if is_paint if (project_materials == null) { project_materials = []; let m: material_data_t = data_get_material("Scene", "Material"); @@ -159,14 +159,14 @@ function ui_base_init() { ui_on_deselect_text = ui_base_on_deselect_text; ui_on_tab_drop = ui_base_on_tab_drop; - ///if (is_paint || is_sculpt) + ///if is_paint let resources: string[] = ["cursor.k", "icons.k"]; ///end ///if is_lab let resources: string[] = ["cursor.k", "icons.k", "placeholder.k"]; ///end - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.gizmo = scene_get_child(".Gizmo"); context_raw.gizmo_translate_x = object_get_child(context_raw.gizmo, ".TranslateX"); context_raw.gizmo_translate_y = object_get_child(context_raw.gizmo, ".TranslateY"); @@ -219,7 +219,7 @@ function ui_base_update() { if (!ui_nodes_ui.is_typing && !ui_base_ui.is_typing) { if (operator_shortcut(map_get(config_keymap, "toggle_node_editor"))) { - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_canvas_type == canvas_type_t.MATERIAL ? ui_base_show_material_nodes() : ui_base_show_brush_nodes(); ///end ///if is_lab @@ -231,7 +231,7 @@ function ui_base_update() { } else if (operator_shortcut(map_get(config_keymap, "toggle_2d_view"))) { - ///if (is_paint || is_sculpt) + ///if is_paint ui_base_show_2d_view(view_2d_type_t.LAYER); ///else ui_base_show_2d_view(view_2d_type_t.ASSET); @@ -292,7 +292,7 @@ function ui_base_update() { } ///end - ///if (is_paint || is_sculpt) + ///if is_paint let decal: bool = context_is_decal(); let decal_mask: bool = context_is_decal_mask(); @@ -358,7 +358,7 @@ function ui_base_update() { let is_typing: bool = ui_base_ui.is_typing || ui_view2d_ui.is_typing || ui_nodes_ui.is_typing; - ///if (is_paint || is_sculpt) + ///if is_paint if (!is_typing) { if (operator_shortcut(map_get(config_keymap, "select_material"), shortcut_type_t.DOWN)) { ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2; @@ -577,7 +577,7 @@ function ui_base_update() { tr("Metallic"), tr("Opacity"), tr("Height"), - ///if (is_paint || is_sculpt) + ///if is_paint tr("Emission"), tr("Subsurface"), tr("TexCoord"), @@ -624,7 +624,7 @@ function ui_base_update() { context_raw.brush_can_unlock = false; } - ///if (is_paint || is_sculpt) + ///if is_paint let b: bool = (context_raw.brush_can_lock || context_raw.brush_locked) && !operator_shortcut(map_get(config_keymap, "brush_radius"), shortcut_type_t.DOWN) && !operator_shortcut(map_get(config_keymap, "brush_opacity"), shortcut_type_t.DOWN) && @@ -960,7 +960,7 @@ function ui_base_update_ui() { let decal: bool = context_is_decal(); let decal_mask: bool = context_is_decal_mask_paint(); - ///if (is_paint || is_sculpt) + ///if is_paint let down: bool = operator_shortcut(map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) || decal_mask || set_clone_source || @@ -1145,7 +1145,7 @@ function ui_base_update_ui() { history_redo(); } - ///if (is_paint || is_sculpt) + ///if is_paint gizmo_update(); ///end } @@ -1183,14 +1183,14 @@ function ui_base_render() { ui_begin(ui_base_ui); - ///if (is_paint || is_sculpt) + ///if is_paint ui_toolbar_render_ui(); ///end ui_menubar_render_ui(); ui_header_render_ui(); ui_status_render_ui(); - ///if (is_paint || is_sculpt) + ///if is_paint ui_base_draw_sidebar(); ///end @@ -1427,7 +1427,7 @@ function ui_base_show_material_nodes() { // Clear input state as ui receives input events even when not drawn _ui_end_input(ui_nodes_ui); - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_show = !ui_nodes_show || ui_nodes_canvas_type != canvas_type_t.MATERIAL; ui_nodes_canvas_type = canvas_type_t.MATERIAL; ///end diff --git a/base/sources/ts/ui_files.ts b/base/sources/ts/ui_files.ts index b6e9ce1b..04523775 100644 --- a/base/sources/ts/ui_files.ts +++ b/base/sources/ts/ui_files.ts @@ -209,7 +209,7 @@ function ui_files_file_browser(ui: ui_t, handle: ui_handle_t, drag_files: bool = if (ends_with(data.f, ".arm")) { // Used for material sphere alpha cutout draw_begin(icon); - ///if (is_paint || is_sculpt) + ///if is_paint draw_image(project_materials[0].image, 0, 0); ///end } diff --git a/base/sources/ts/ui_menu.ts b/base/sources/ts/ui_menu.ts index a89b5d92..e283e04a 100644 --- a/base/sources/ts/ui_menu.ts +++ b/base/sources/ts/ui_menu.ts @@ -74,7 +74,7 @@ function ui_menu_render() { }); } - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_menu_button(tr("Import Font..."))) { project_import_asset("ttf,ttc,otf"); } @@ -197,7 +197,7 @@ function ui_menu_render() { context_raw.ddirty = 2; } - ///if (is_paint || is_sculpt) + ///if is_paint let split_view_handle: ui_handle_t = ui_handle(__ID__); if (split_view_handle.init) { split_view_handle.selected = context_raw.split_view; @@ -241,7 +241,7 @@ function ui_menu_render() { make_material_parse_mesh_material(); } - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.draw_wireframe = ui_check(context_raw.wireframe_handle, " " + tr("Wireframe")); if (context_raw.wireframe_handle.changed) { let current: gpu_texture_t = _draw_current; @@ -303,7 +303,7 @@ function ui_menu_render() { tr("Emission"), tr("Subsurface"), ///end - ///if (is_paint || is_sculpt) + ///if is_paint tr("TexCoord"), tr("Object Normal"), tr("Material ID"), diff --git a/base/sources/ts/ui_menubar.ts b/base/sources/ts/ui_menubar.ts index a00432ec..23f6c533 100644 --- a/base/sources/ts/ui_menubar.ts +++ b/base/sources/ts/ui_menubar.ts @@ -18,7 +18,7 @@ function ui_menubar_render_ui() { let item_w: i32 = ui_toolbar_w(); let panel_x: i32 = sys_x(); - ///if (is_paint || is_sculpt) + ///if is_paint if (config_raw.layout[layout_size_t.HEADER] == 1) { panel_x = sys_x() - item_w; } @@ -31,7 +31,7 @@ function ui_menubar_render_ui() { if (config_raw.touch_ui) { - ///if (is_paint || is_sculpt) + ///if is_paint ui._w = item_w; ///end ///if is_lab @@ -103,7 +103,7 @@ function ui_menubar_render_ui() { if (ui_menubar_w < ui._x + 10) { ui_menubar_w = math_floor(ui._x + 10); - ///if (is_paint || is_sculpt) + ///if is_paint ui_toolbar_handle.redraws = 2; ///end } @@ -124,7 +124,7 @@ function ui_menubar_draw_tab_header() { let panel_x: i32 = sys_x(); let nodesw: i32 = (ui_nodes_show || ui_view2d_show) ? config_raw.layout[layout_size_t.NODES_W] : 0; - ///if (is_paint || is_sculpt) + ///if is_paint let ww: i32 = iron_window_width() - config_raw.layout[layout_size_t.SIDEBAR_W] - ui_menubar_w - nodesw; panel_x = (sys_x() - item_w) + ui_menubar_w; ///else diff --git a/base/sources/ts/ui_nodes.ts b/base/sources/ts/ui_nodes.ts index ca4dd82d..d99399b5 100644 --- a/base/sources/ts/ui_nodes.ts +++ b/base/sources/ts/ui_nodes.ts @@ -1,5 +1,5 @@ -///if (is_paint || is_sculpt) +///if is_paint let ui_nodes_show: bool = false; ///end ///if is_lab @@ -144,7 +144,7 @@ function ui_viewnodes_on_link_drag(link_drag_id: i32, is_new_link: bool) { // Selecting which node socket to preview else if (ui_nodes.nodes_selected_id.length > 0 && node.id == ui_nodes.nodes_selected_id[0]) { context_raw.node_preview_socket = link_drag.from_id > -1 ? link_drag.from_socket : 0; - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.node_preview_dirty = true; ///end } @@ -267,7 +267,7 @@ function ui_viewnodes_on_socket_released(socket_id: i32) { let i: i32 = array_index_of(node.outputs, socket); if (i > -1) { context_raw.node_preview_socket = i; - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.node_preview_dirty = true; ///end } @@ -313,7 +313,7 @@ function ui_viewnodes_on_canvas_released() { ui_menu._y += 1; let is_protected: bool = selected == null || - ///if (is_paint || is_sculpt) + ///if is_paint selected.type == "OUTPUT_MATERIAL_PBR" || ///end selected.type == "GROUP_INPUT" || @@ -482,7 +482,7 @@ function ui_nodes_tab_index(): i32 { } function ui_nodes_get_canvas(groups: bool = false): ui_node_canvas_t { - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_nodes_canvas_type == canvas_type_t.MATERIAL) { if (groups && ui_nodes_group_stack.length > 0) { return ui_nodes_group_stack[ui_nodes_group_stack.length - 1].canvas; @@ -509,7 +509,7 @@ function ui_nodes_get_canvas_material(): ui_node_canvas_t { } function ui_nodes_get_nodes(): ui_nodes_t { - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_nodes_canvas_type == canvas_type_t.MATERIAL) { if (ui_nodes_group_stack.length > 0) { return ui_nodes_group_stack[ui_nodes_group_stack.length - 1].nodes; @@ -541,7 +541,7 @@ function ui_nodes_update() { return; } - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_wx = math_floor(sys_w()) + ui_toolbar_w(true); ///end ///if is_lab @@ -555,7 +555,7 @@ function ui_nodes_update() { let ww: i32 = config_raw.layout[layout_size_t.NODES_W]; if (!ui_base_show) { - ///if (is_paint || is_sculpt) + ///if is_paint ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true); ui_nodes_wx -= ui_toolbar_w(true); ///end @@ -658,7 +658,7 @@ function ui_nodes_node_search(x: i32 = -1, y: i32 = -1, done: ()=>void = null) { let FILL_BUTTON_BG: bool = ui.ops.theme.FILL_BUTTON_BG; ui.ops.theme.FILL_BUTTON_BG = true; - ///if (is_paint || is_sculpt) + ///if is_paint let node_list: node_list_t[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_list : nodes_brush_list; ///end ///if is_lab @@ -722,7 +722,7 @@ function ui_nodes_get_node_y(): i32 { function ui_nodes_draw_grid(zoom: f32): gpu_texture_t { let ww: i32 = config_raw.layout[layout_size_t.NODES_W]; - ///if (is_paint || is_sculpt) + ///if is_paint if (!ui_base_show) { ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true); } @@ -780,7 +780,7 @@ let _ui_nodes_render_tmp: (col: i32)=>void; function ui_nodes_render() { if (ui_nodes_recompile_mat) { - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_nodes_canvas_type == canvas_type_t.BRUSH) { make_material_parse_brush(); util_render_make_brush_preview(); @@ -818,7 +818,7 @@ function ui_nodes_render() { ui_nodes_recompile_mat = false; } else if (ui_nodes_recompile_mat_final) { - ///if (is_paint || is_sculpt) + ///if is_paint make_material_parse_paint_material(); if (ui_nodes_canvas_type == canvas_type_t.MATERIAL && layers_is_fill_material()) { @@ -841,7 +841,7 @@ function ui_nodes_render() { let nodes: ui_nodes_t = ui_nodes_get_nodes(); if (nodes.nodes_selected_id.length > 0 && nodes.nodes_selected_id[0] != ui_nodes_last_node_selected_id) { ui_nodes_last_node_selected_id = nodes.nodes_selected_id[0]; - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.node_preview_dirty = true; ///end @@ -876,7 +876,7 @@ function ui_nodes_render() { ui_nodes_grid_redraw = false; } - ///if (is_paint || is_sculpt) + ///if is_paint if (config_raw.node_preview && context_raw.node_preview_dirty) { ui_nodes_make_node_preview(); } @@ -888,7 +888,7 @@ function ui_nodes_render() { // Make window ui_nodes_ww = config_raw.layout[layout_size_t.NODES_W]; - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_wx = math_floor(sys_w()) + ui_toolbar_w(true); ///end ///if is_lab @@ -897,7 +897,7 @@ function ui_nodes_render() { ui_nodes_wy = 0; - ///if (is_paint || is_sculpt) + ///if is_paint if (!ui_base_show) { ui_nodes_ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true); ui_nodes_wx -= ui_toolbar_w(true); @@ -961,7 +961,7 @@ function ui_nodes_render() { // Nodes let _input_enabled: bool = ui_nodes_ui.input_enabled; ui_nodes_ui.input_enabled = _input_enabled && !ui_nodes_show_menu; - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_ui.window_border_right = config_raw.layout[layout_size_t.SIDEBAR_W]; ///end ui_nodes_ui.window_border_top = ui_header_h * 2; @@ -979,7 +979,7 @@ function ui_nodes_render() { _ui_nodes_render_tmp(color.base); ui_nodes_hwnd.redraws = 2; - ///if (is_paint || is_sculpt) + ///if is_paint let material_live: bool = config_raw.material_live; ///end ///if is_lab @@ -995,7 +995,7 @@ function ui_nodes_render() { // Remove nodes with unknown id for this canvas type if (ui_is_paste) { - ///if (is_paint || is_sculpt) + ///if is_paint let node_list: node_list_t[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_list : nodes_brush_list; ///end ///if is_lab @@ -1042,7 +1042,7 @@ function ui_nodes_render() { // Recompile material on change if (ui_nodes_ui.changed) { - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_recompile_mat = (ui_nodes_ui.input_dx != 0 || ui_nodes_ui.input_dy != 0 || !ui_nodes_uichanged_last) && config_raw.material_live; // Instant preview ///end ///if is_lab @@ -1060,7 +1060,7 @@ function ui_nodes_render() { let img: gpu_texture_t = null; let sel: ui_node_t = ui_get_node(c.nodes, nodes.nodes_selected_id[0]); - ///if (is_paint || is_sculpt) + ///if is_paint let single_channel: bool = sel.type == "LAYER_MASK"; if (sel.type == "LAYER" || sel.type == "LAYER_MASK") { @@ -1104,7 +1104,7 @@ function ui_nodes_render() { let invert_y: bool = false; - ///if (is_paint || is_sculpt) + ///if is_paint if (single_channel) { draw_set_pipeline(ui_view2d_pipe); gpu_set_int(ui_view2d_channel_loc, 1); @@ -1116,7 +1116,7 @@ function ui_nodes_render() { draw_scaled_image(img, tx, ty + th, tw, -th) : draw_scaled_image(img, tx, ty, tw, th); - ///if (is_paint || is_sculpt) + ///if is_paint if (single_channel) { draw_set_pipeline(null); } @@ -1134,7 +1134,7 @@ function ui_nodes_render() { ui_nodes_ui._y = 2 + start_y; ui_nodes_ui._w = ew; - ///if (is_paint || is_sculpt) + ///if is_paint // Editable canvas name let h: ui_handle_t = ui_handle(__ID__); h.text = c.name; @@ -1191,7 +1191,7 @@ function ui_nodes_render() { let _BUTTON_COL: i32 = ui_nodes_ui.ops.theme.BUTTON_COL; ui_nodes_ui.ops.theme.BUTTON_COL = ui_nodes_ui.ops.theme.SEPARATOR_COL; - ///if (is_paint || is_sculpt) + ///if is_paint let cats: string[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_categories : nodes_brush_categories; ///end ///if is_lab @@ -1251,7 +1251,7 @@ function ui_nodes_render() { ui_end(!ui_nodes_show_menu); if (ui_nodes_show_menu) { - ///if (is_paint || is_sculpt) + ///if is_paint let list: node_list_t[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_list : nodes_brush_list; ///end ///if is_lab @@ -1261,7 +1261,7 @@ function ui_nodes_render() { let category: ui_node_t[] = list[ui_nodes_menu_category]; let num_nodes: i32 = category.length; - ///if (is_paint || is_sculpt) + ///if is_paint let is_group_category: bool = ui_nodes_canvas_type == canvas_type_t.MATERIAL && nodes_material_categories[ui_nodes_menu_category] == "Group"; ///end ///if is_lab @@ -1326,7 +1326,7 @@ function ui_nodes_render() { nodes.nodes_drag = true; } - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_ui.enabled = !project_is_material_group_in_use(g); if (ui_button("x", ui_align_t.CENTER)) { history_delete_material_group(g); @@ -1410,7 +1410,7 @@ function ui_nodes_push_undo(last_canvas: ui_node_canvas_t = null) { function ui_nodes_accept_asset_drag(index: i32) { ui_nodes_push_undo(); let g: node_group_t = ui_nodes_group_stack.length > 0 ? ui_nodes_group_stack[ui_nodes_group_stack.length - 1] : null; - ///if (is_paint || is_sculpt) + ///if is_paint let n: ui_node_t = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_create_node("TEX_IMAGE", g) : @@ -1448,7 +1448,7 @@ function ui_nodes_accept_material_drag(index: i32) { } function ui_nodes_accept_swatch_drag(swatch: swatch_color_t) { - ///if (is_paint || is_sculpt) + ///if is_paint ui_nodes_push_undo(); let g: node_group_t = ui_nodes_group_stack.length > 0 ? ui_nodes_group_stack[ui_nodes_group_stack.length - 1] : null; let n: ui_node_t = nodes_material_create_node("RGB", g); diff --git a/base/sources/ts/ui_status.ts b/base/sources/ts/ui_status.ts index 371dcce5..605a82c3 100644 --- a/base/sources/ts/ui_status.ts +++ b/base/sources/ts/ui_status.ts @@ -5,7 +5,7 @@ function ui_status_init() { } function ui_status_width(): i32 { - ///if (is_paint || is_sculpt) + ///if is_paint return iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W]; ///end ///if is_lab diff --git a/base/sources/ts/ui_view2d.ts b/base/sources/ts/ui_view2d.ts index 49ad2790..a6a3b6c2 100644 --- a/base/sources/ts/ui_view2d.ts +++ b/base/sources/ts/ui_view2d.ts @@ -5,7 +5,7 @@ let ui_view2d_text_input_hover: bool = false; let ui_view2d_uvmap_show: bool = false; let ui_view2d_tex_type: paint_tex_t = paint_tex_t.BASE; let ui_view2d_layer_mode: view_2d_layer_mode_t = view_2d_layer_mode_t.SELECTED; -///if (is_paint || is_sculpt) +///if is_paint let ui_view2d_type: view_2d_type_t = view_2d_type_t.LAYER; ///else let ui_view2d_type: view_2d_type_t = view_2d_type_t.ASSET; @@ -31,7 +31,7 @@ let ui_view2d_grid: gpu_texture_t = null; let ui_view2d_grid_redraw: bool = true; function ui_view2d_init() { - ///if (is_paint || is_sculpt) + ///if is_paint ui_view2d_pipe = gpu_create_pipeline(); ui_view2d_pipe.vertex_shader = sys_get_shader("layer_view.vert"); ui_view2d_pipe.fragment_shader = sys_get_shader("layer_view.frag"); @@ -66,7 +66,7 @@ function ui_view2d_render() { ui_view2d_ww = config_raw.layout[layout_size_t.NODES_W]; - ///if (is_paint || is_sculpt) + ///if is_paint ui_view2d_wx = math_floor(sys_w()) + ui_toolbar_w(true); ///else ui_view2d_wx = math_floor(sys_w()); @@ -74,7 +74,7 @@ function ui_view2d_render() { ui_view2d_wy = 0; - ///if (is_paint || is_sculpt) + ///if is_paint if (!ui_base_show) { ui_view2d_ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true); ui_view2d_wx -= ui_toolbar_w(true); @@ -102,14 +102,14 @@ function ui_view2d_render() { } // Ensure UV map is drawn - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_view2d_uvmap_show) { util_uv_cache_uv_map(); } ///end // Ensure font image is drawn - ///if (is_paint || is_sculpt) + ///if is_paint if (context_raw.font.image == null) { util_render_make_font_preview(); } @@ -153,7 +153,7 @@ function ui_view2d_render() { tex = project_get_image(context_raw.texture); } else if (ui_view2d_type == view_2d_type_t.NODE) { - ///if (is_paint || is_sculpt) + ///if is_paint tex = context_raw.node_preview; @@ -218,7 +218,7 @@ function ui_view2d_render() { th = tw * (tex.height / tex.width); ty = apph / 2 - th / 2 + ui_view2d_pan_y; - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_view2d_type == view_2d_type_t.LAYER) { draw_set_pipeline(ui_view2d_pipe); if (!context_raw.texture_filter) { @@ -241,7 +241,7 @@ function ui_view2d_render() { draw_scaled_image(tex, tx, ty + th, tw, th); } - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_view2d_type == view_2d_type_t.LAYER) { draw_set_pipeline(null); if (!context_raw.texture_filter) { @@ -283,7 +283,7 @@ function ui_view2d_render() { ///end } - ///if (is_paint || is_sculpt) + ///if is_paint // UV map if (ui_view2d_type == view_2d_type_t.LAYER && ui_view2d_uvmap_show) { draw_scaled_image(util_uv_uvmap, tx, ty, tw, th); @@ -304,7 +304,7 @@ function ui_view2d_render() { // Editable layer name let h: ui_handle_t = ui_handle(__ID__); - ///if (is_paint || is_sculpt) + ///if is_paint let text: string = ui_view2d_type == view_2d_type_t.NODE ? context_raw.node_preview_name : h.text; ///else let text: string = h.text; @@ -323,7 +323,7 @@ function ui_view2d_render() { } } else if (ui_view2d_type == view_2d_type_t.NODE) { - ///if (is_paint || is_sculpt) + ///if is_paint ui_text(context_raw.node_preview_name); @@ -336,7 +336,7 @@ function ui_view2d_render() { ///end } - ///if (is_paint || is_sculpt) + ///if is_paint else if (ui_view2d_type == view_2d_type_t.LAYER) { h.text = l.name; l.name = ui_text_input(h, ""); @@ -355,7 +355,7 @@ function ui_view2d_render() { ui_view2d_ui._y = 2 + start_y; ui_view2d_ui._w = ew; - ///if (is_paint || is_sculpt) + ///if is_paint if (ui_view2d_type == view_2d_type_t.LAYER) { let h_layer_mode: ui_handle_t = ui_handle(__ID__); if (h_layer_mode.init) { @@ -409,7 +409,7 @@ function ui_view2d_render() { } // Picked position - ///if (is_paint || is_sculpt) + ///if is_paint if (context_raw.tool == workspace_tool_t.PICKER && (ui_view2d_type == view_2d_type_t.LAYER || ui_view2d_type == view_2d_type_t.ASSET)) { let cursor_img: gpu_texture_t = resource_get("cursor.k"); let hsize: f32 = 16 * ui_SCALE(ui_view2d_ui); @@ -424,7 +424,7 @@ function ui_view2d_render() { function ui_view2d_update() { let headerh: f32 = ui_ELEMENT_H(ui_view2d_ui) * 1.4; - ///if (is_paint || is_sculpt) + ///if is_paint context_raw.paint2d = false; ///end @@ -466,7 +466,7 @@ function ui_view2d_update() { ui_view2d_grid_redraw = true; } - ///if (is_paint || is_sculpt) + ///if is_paint let decal_mask: bool = context_is_decal_mask_paint(); let set_clone_source: bool = context_raw.tool == workspace_tool_t.CLONE && operator_shortcut(map_get(config_keymap, "set_clone_source") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN); diff --git a/base/sources/ts/uniforms_ext.ts b/base/sources/ts/uniforms_ext.ts index c69edd2d..610c9ddd 100644 --- a/base/sources/ts/uniforms_ext.ts +++ b/base/sources/ts/uniforms_ext.ts @@ -20,7 +20,7 @@ function uniforms_ext_i32_link(object: object_t, mat: material_data_t, link: str function uniforms_ext_f32_link(object: object_t, mat: material_data_t, link: string): f32 { if (link == "_brush_radius") { - ///if (is_paint || is_sculpt) + ///if is_paint let decal: bool = context_is_decal(); let decal_mask: bool = decal && operator_shortcut(map_get(config_keymap, "decal_mask") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN); let brush_decal_mask_radius: f32 = context_raw.brush_decal_mask_radius; @@ -396,7 +396,7 @@ function uniforms_ext_tex_link(object: object_t, mat: material_data_t, link: str } if (starts_with(link, "_texpaint_vert")) { - ///if (is_paint || is_sculpt) + ///if is_paint let tid: i32 = parse_int(substring(link, link.length - 1, link.length)); return tid < project_layers.length ? project_layers[tid].texpaint : null; ///end @@ -426,7 +426,7 @@ function uniforms_ext_tex_link(object: object_t, mat: material_data_t, link: str ///end } if (starts_with(link, "_texpaint")) { - ///if (is_paint || is_sculpt) + ///if is_paint let tid: i32 = parse_int(substring(link, link.length - 1, link.length)); return tid < project_layers.length ? project_layers[tid].texpaint : null; ///end diff --git a/base/sources/ts/util_encode.ts b/base/sources/ts/util_encode.ts index 9ad39bd1..e06e4828 100644 --- a/base/sources/ts/util_encode.ts +++ b/base/sources/ts/util_encode.ts @@ -182,7 +182,7 @@ function util_encode_project(raw: project_format_t): buffer_t { armpack_encode_null(); } - ///if (is_paint || is_sculpt) + ///if is_paint armpack_encode_string("brush_nodes"); if (raw.brush_nodes != null) { armpack_encode_array(raw.brush_nodes.length); diff --git a/base/tools/extract_locales.js b/base/tools/extract_locales.js index 1e120530..fbc8f2dc 100644 --- a/base/tools/extract_locales.js +++ b/base/tools/extract_locales.js @@ -23,7 +23,6 @@ let source_paths = [ "base/sources", "base/sources/nodes", "armorpaint/sources", "armorpaint/sources/nodes", "armorlab/sources", "armorlab/sources/nodes", - "armorsculpt/sources", "armorsculpt/sources/nodes", "armorforge/sources", "armorforge/sources/nodes" ]; diff --git a/readme.md b/readme.md index 4db0e0e4..bf255eb3 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,6 @@ armortools [armorpaint/](https://github.com/armory3d/armortools/tree/main/armorpaint)
[armorlab/](https://github.com/armory3d/armortools/tree/main/armorlab)
-[armorsculpt/](https://github.com/armory3d/armortools/tree/main/armorsculpt)
[armorforge/](https://github.com/armory3d/armortools/tree/main/armorforge) **Generating a locale file**