Sfoglia il codice sorgente

Move sculpt to branch

luboslenco 1 mese fa
parent
commit
5ba6ad03f1
59 ha cambiato i file con 131 aggiunte e 2333 eliminazioni
  1. 0 3
      armorpaint/sources/context_ext.ts
  2. 0 20
      armorpaint/sources/render_path_paint.ts
  3. BIN
      armorsculpt/assets/badge.png
  4. BIN
      armorsculpt/assets/default_brush.arm
  5. BIN
      armorsculpt/assets/default_material.arm
  6. 0 6
      armorsculpt/assets/keymap_presets/touch.json
  7. 0 0
      armorsculpt/assets/licenses/keepme.txt
  8. 0 0
      armorsculpt/assets/meshes/keepme.txt
  9. 0 0
      armorsculpt/assets/plugins/keepme.txt
  10. 0 14
      armorsculpt/assets/readme/readme.txt
  11. BIN
      armorsculpt/icon.png
  12. 0 8
      armorsculpt/plugins/plugins.c
  13. 0 5
      armorsculpt/plugins/project.js
  14. 0 25
      armorsculpt/project.js
  15. 0 6
      armorsculpt/readme.md
  16. 0 0
      armorsculpt/shaders/keepme
  17. 0 28
      armorsculpt/sources/base_ext.ts
  18. 0 101
      armorsculpt/sources/export_obj.ts
  19. 0 240
      armorsculpt/sources/import_mesh.ts
  20. 0 30
      armorsculpt/sources/make_brush.ts
  21. 0 323
      armorsculpt/sources/make_material.ts
  22. 0 349
      armorsculpt/sources/make_mesh.ts
  23. 0 160
      armorsculpt/sources/make_mesh_preview.ts
  24. 0 94
      armorsculpt/sources/make_sculpt.ts
  25. 0 6
      armorsculpt/sources/manifest.ts
  26. 0 163
      armorsculpt/sources/nodes/brush_output_node_ext.ts
  27. 0 86
      armorsculpt/sources/render_path_sculpt.ts
  28. 0 423
      armorsculpt/sources/tab_layers.ts
  29. 0 29
      armorsculpt/sources/ui_base_ext.ts
  30. 0 13
      armorsculpt/sources/ui_header_ext.ts
  31. 0 5
      armorsculpt/sources/ui_toolbar_ext.ts
  32. 1 1
      base/assets/licenses/license_icons.md
  33. 2 2
      base/sources/ts/base.ts
  34. 2 2
      base/sources/ts/box_preferences.ts
  35. 6 6
      base/sources/ts/export_arm.ts
  36. 2 6
      base/sources/ts/history.ts
  37. 9 12
      base/sources/ts/import_arm.ts
  38. 6 6
      base/sources/ts/import_mesh.ts
  39. 3 7
      base/sources/ts/layers.ts
  40. 2 2
      base/sources/ts/pipes.ts
  41. 13 21
      base/sources/ts/project.ts
  42. 1 22
      base/sources/ts/render_path_deferred.ts
  43. 0 23
      base/sources/ts/slot_layer.ts
  44. 1 1
      base/sources/ts/tab_browser.ts
  45. 1 1
      base/sources/ts/tab_meshes.ts
  46. 1 1
      base/sources/ts/tab_plugins.ts
  47. 1 1
      base/sources/ts/tab_swatches.ts
  48. 4 4
      base/sources/ts/tab_textures.ts
  49. 15 15
      base/sources/ts/ui_base.ts
  50. 1 1
      base/sources/ts/ui_files.ts
  51. 4 4
      base/sources/ts/ui_menu.ts
  52. 4 4
      base/sources/ts/ui_menubar.ts
  53. 30 30
      base/sources/ts/ui_nodes.ts
  54. 1 1
      base/sources/ts/ui_status.ts
  55. 17 17
      base/sources/ts/ui_view2d.ts
  56. 3 3
      base/sources/ts/uniforms_ext.ts
  57. 1 1
      base/sources/ts/util_encode.ts
  58. 0 1
      base/tools/extract_locales.js
  59. 0 1
      readme.md

+ 0 - 3
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) {

+ 0 - 20
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) {

BIN
armorsculpt/assets/badge.png


BIN
armorsculpt/assets/default_brush.arm


BIN
armorsculpt/assets/default_material.arm


+ 0 - 6
armorsculpt/assets/keymap_presets/touch.json

@@ -1,6 +0,0 @@
-{
-	"action_sculpt": "left",
-	"action_rotate": "left",
-	"action_pan": "right",
-	"action_zoom": ""
-}

+ 0 - 0
armorsculpt/assets/licenses/keepme.txt


+ 0 - 0
armorsculpt/assets/meshes/keepme.txt


+ 0 - 0
armorsculpt/assets/plugins/keepme.txt


+ 0 - 14
armorsculpt/assets/readme/readme.txt

@@ -1,14 +0,0 @@
-Thank you for supporting ArmorSculpt!
-
-Quick start:
-https://armory3d.org/sculpt/manual
-
-                                (
-   (                            )\ )            (            )
-   )\    (       )         (   (()/(        (   )\        ( /(
-((((_)(  )(     (      (   )(   /(_)) (    ))\ ((_)`  )   )\())
- )\ _ )\(()\    )\  '  )\ (()\ (_))   )\  /((_) _  /(/(  (_))/
- (_)_\(_)((_) _((_))  ((_) ((_)/ __| ((_)(_))( | |((_)_\ | |_
-  / _ \ | '_|| '  \()/ _ \| '_|\__ \/ _| | || || || '_ \)|  _|
- /_/ \_\|_|  |_|_|_| \___/|_|  |___/\__|  \_,_||_|| .__/  \__|
-                                                  |_|

BIN
armorsculpt/icon.png


+ 0 - 8
armorsculpt/plugins/plugins.c

@@ -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);
-}

+ 0 - 5
armorsculpt/plugins/project.js

@@ -1,5 +0,0 @@
-let project = new Project("plugins");
-
-project.add_cfiles("plugins.c");
-
-return project;

+ 0 - 25
armorsculpt/project.js

@@ -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;

+ 0 - 6
armorsculpt/readme.md

@@ -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.

+ 0 - 0
armorsculpt/shaders/keepme


+ 0 - 28
armorsculpt/sources/base_ext.ts

@@ -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() {
-
-}

+ 0 - 101
armorsculpt/sources/export_obj.ts

@@ -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[]) {
-}

+ 0 - 240
armorsculpt/sources/import_mesh.ts

@@ -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();
-}

+ 0 - 30
armorsculpt/sources/make_brush.ts

@@ -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; }");
-}

+ 0 - 323
armorsculpt/sources/make_material.ts

@@ -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);
-}

+ 0 - 349
armorsculpt/sources/make_mesh.ts

@@ -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;
-}

+ 0 - 160
armorsculpt/sources/make_mesh_preview.ts

@@ -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;
-}

+ 0 - 94
armorsculpt/sources/make_sculpt.ts

@@ -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;
-}

+ 0 - 6
armorsculpt/sources/manifest.ts

@@ -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 = "";

+ 0 - 163
armorsculpt/sources/nodes/brush_output_node_ext.ts

@@ -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; ////
-	}
-}

+ 0 - 86
armorsculpt/sources/render_path_sculpt.ts

@@ -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);
-	}
-}

+ 0 - 423
armorsculpt/sources/tab_layers.ts

@@ -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<i32, i32>) {
-	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<slot_layer_t, i32> {
-	let res: map_t<slot_layer_t, i32> = 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<slot_layer_t, i32>): map_t<i32, i32> {
-	let res: map_t<i32, i32> = 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) {
-}

+ 0 - 29
armorsculpt/sources/ui_base_ext.ts

@@ -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;
-}

+ 0 - 13
armorsculpt/sources/ui_header_ext.ts

@@ -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<string, string> = 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));
-		}
-	}
-}

+ 0 - 5
armorsculpt/sources/ui_toolbar_ext.ts

@@ -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);
-}

+ 1 - 1
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
 

+ 2 - 2
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
 

+ 2 - 2
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;

+ 6 - 6
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";

+ 2 - 6
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);

+ 9 - 12
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";

+ 6 - 6
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;

+ 3 - 7
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];

+ 2 - 2
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");

+ 13 - 21
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

+ 1 - 22
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
 

+ 0 - 23
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);
 }
 

+ 1 - 1
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 () {

+ 1 - 1
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();
 		}

+ 1 - 1
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

+ 1 - 1
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]);
 						}

+ 4 - 4
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);

+ 15 - 15
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

+ 1 - 1
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
 										}

+ 4 - 4
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"),

+ 4 - 4
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

+ 30 - 30
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);

+ 1 - 1
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

+ 17 - 17
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);

+ 3 - 3
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

+ 1 - 1
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);

+ 0 - 1
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"
 ];
 

+ 0 - 1
readme.md

@@ -7,7 +7,6 @@ armortools
 
 [armorpaint/](https://github.com/armory3d/armortools/tree/main/armorpaint)<br>
 [armorlab/](https://github.com/armory3d/armortools/tree/main/armorlab)<br>
-[armorsculpt/](https://github.com/armory3d/armortools/tree/main/armorsculpt)<br>
 [armorforge/](https://github.com/armory3d/armortools/tree/main/armorforge)
 
 **Generating a locale file**