luboslenco vor 2 Wochen
Ursprung
Commit
53ec3068a2

+ 0 - 10
base/sources/ts/base.ts

@@ -396,7 +396,6 @@ function base_update() {
 				base_drop_x = mouse_x;
 				base_drop_y = mouse_y;
 
-				///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
@@ -405,11 +404,6 @@ function base_update() {
 						base_material_dropped();
 					}
 				});
-				///end
-
-				///if is_lab
-				import_asset_run(base_drag_file, base_drop_x, base_drop_y);
-				///end
 			}
 			base_drag_file = null;
 			base_drag_file_icon = null;
@@ -672,10 +666,6 @@ function base_is_combo_selected(): bool {
 }
 
 function base_is_decal_layer(): bool {
-	///if is_lab
-	return false;
-	///end
-
 	let is_painting: bool = context_raw.tool != tool_type_t.MATERIAL && context_raw.tool != tool_type_t.BAKE;
 	return is_painting && context_raw.layer.fill_layer != null && context_raw.layer.uv_type == uv_type_t.PROJECT;
 }

+ 1 - 5
base/sources/ts/box_export.ts

@@ -49,12 +49,10 @@ function box_export_show_textures() {
 		box_export_tab_export_textures(tr("Export Textures"));
 		box_export_tab_presets();
 
-		///if is_paint
 		box_export_tab_atlases();
 		///if (arm_android || arm_ios)
 		box_export_tab_export_mesh(box_export_htab);
 		///end
-		///end
 
 	}, 540, 310);
 }
@@ -94,7 +92,7 @@ function box_export_tab_export_textures(title: string, bake_material: bool = fal
 			layers_on_resized();
 		}
 
-		///if (is_lab || arm_android || arm_ios)
+		///if (arm_android || arm_ios)
 		let base_bits_combo: string[] = ["8bit"];
 		///else
 		let base_bits_combo: string[] = ["8bit", "16bit", "32bit"];
@@ -134,7 +132,6 @@ function box_export_tab_export_textures(title: string, bake_material: bool = fal
 
 		ui.enabled = true;
 
-		///if is_paint
 		ui_row2();
 		ui.enabled = !bake_material;
 		let layers_export_handle: ui_handle_t = ui_handle(__ID__);
@@ -142,7 +139,6 @@ function box_export_tab_export_textures(title: string, bake_material: bool = fal
 		let layers_export_combo: string[] = [tr("Visible"), tr("Selected"), tr("Per Object"), tr("Per Udim Tile")];
 		context_raw.layers_export = ui_combo(layers_export_handle, layers_export_combo, tr("Layers"), true);
 		ui.enabled = true;
-		///end
 
 		ui_combo(box_export_hpreset, box_export_files, tr("Preset"), true);
 		if (box_export_hpreset.changed) {

+ 2 - 22
base/sources/ts/box_preferences.ts

@@ -341,7 +341,6 @@ function box_preferences_show() {
 				draw_begin(current);
 			}
 
-			///if is_paint
 			let h_dilate_radius: ui_handle_t = ui_handle(__ID__);
 			if (h_dilate_radius.init) {
 				h_dilate_radius.value = config_raw.dilate_radius;
@@ -360,19 +359,6 @@ function box_preferences_show() {
 			if (dilate_handle.changed) {
 				config_raw.dilate = dilate_handle.position;
 			}
-			///end
-
-			///if is_lab
-			let workspace_handle: ui_handle_t = ui_handle(__ID__);
-			if (workspace_handle.init) {
-				workspace_handle.position = config_raw.workspace;
-			}
-			let workspace_combo: string[] = [tr("3D View"), tr("2D View")];
-			ui_combo(workspace_handle, workspace_combo, tr("Default Workspace"), true);
-			if (workspace_handle.changed) {
-				config_raw.workspace = workspace_handle.position;
-			}
-			///end
 
 			let camera_controls_handle: ui_handle_t = ui_handle(__ID__);
 			if (camera_controls_handle.init) {
@@ -416,7 +402,6 @@ function box_preferences_show() {
 			}
 			config_raw.server = ui_text_input(server_handle, tr("Cloud Server"));
 
-			///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;
@@ -478,18 +463,15 @@ function box_preferences_show() {
 				make_material_parse_paint_material();
 			}
 			ui.enabled = true;
-			///end
 
-			///if is_lab
 			let h_gpu_inference: ui_handle_t = ui_handle(__ID__);
 			if (h_gpu_inference.init) {
 				h_gpu_inference.selected = config_raw.gpu_inference;
 			}
-			config_raw.gpu_inference = ui_check(h_gpu_inference, tr("Use GPU"));
+			config_raw.gpu_inference = ui_check(h_gpu_inference, tr("GPU Inference"));
 			if (ui.is_hovered) {
-				ui_tooltip(tr("Use GPU to accelerate node graph processing"));
+				ui_tooltip(tr("Use GPU to accelerate neural node processing"));
 			}
-			///end
 		}
 
 		let pen_name: string;
@@ -513,7 +495,6 @@ function box_preferences_show() {
 			}
 			config_raw.pressure_sensitivity = ui_slider(h_pressure_sensitivity, tr("Sensitivity"), 0.0, 10.0, true);
 
-			///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;
@@ -531,7 +512,6 @@ function box_preferences_show() {
 				h_pressure_angle.selected = config_raw.pressure_angle;
 			}
 			config_raw.pressure_angle = ui_check(h_pressure_angle, tr("Brush Angle"));
-			///end
 
 			ui_end_element();
 			let row: f32[] = [0.5];

+ 0 - 16
base/sources/ts/context.ts

@@ -595,10 +595,6 @@ function context_select_paint_object(o: mesh_object_t) {
 }
 
 function context_main_object(): mesh_object_t {
-	///if is_lab
-	return project_paint_objects[0];
-	///end
-
 	for (let i: i32 = 0; i < project_paint_objects.length; ++i) {
 		let po: mesh_object_t = project_paint_objects[i];
 		if (po.base.children.length > 0) {
@@ -609,18 +605,10 @@ function context_main_object(): mesh_object_t {
 }
 
 function context_layer_filter_used(): bool {
-	///if is_lab
-	return true;
-	///end
-
 	return context_raw.layer_filter > 0 && context_raw.layer_filter <= project_paint_objects.length;
 }
 
 function context_object_mask_used(): bool {
-	///if is_lab
-	return false;
-	///end
-
 	return slot_layer_get_object_mask(context_raw.layer) > 0 && slot_layer_get_object_mask(context_raw.layer) <= project_paint_objects.length;
 }
 
@@ -630,10 +618,6 @@ function context_in_viewport(): bool {
 }
 
 function context_in_paint_area(): bool {
-	///if is_lab
-	return context_in_viewport();
-	///end
-
 	let right: i32 = sys_w();
 	if (ui_view2d_show) {
 		right += ui_view2d_ww;

+ 0 - 33
base/sources/ts/export_arm.ts

@@ -18,7 +18,6 @@ function export_arm_run_mesh(path: string, paint_objects: mesh_object_t[]) {
 }
 
 function export_arm_run_project() {
-	///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];
@@ -35,15 +34,6 @@ function export_arm_run_project() {
 		let b: slot_brush_t = project_brushes[i];
 		array_push(bnodes, b.canvas);
 	}
-	///end
-
-	///if is_lab
-	let c: ui_node_canvas_t = util_clone_canvas(project_canvas);
-	for (let i: i32 = 0; i < c.nodes.length; ++i) {
-		let n: ui_node_t = c.nodes[i];
-		export_arm_export_node(n);
-	}
-	///end
 
 	let mgroups: ui_node_canvas_t[] = null;
 	if (project_material_groups.length > 0) {
@@ -59,21 +49,14 @@ function export_arm_run_project() {
 		}
 	}
 
-	///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];
 		array_push(md, p.data);
 	}
-	///end
-
-	///if is_lab
-	let md: mesh_data_t = project_paint_objects[0].data;
-	///end
 
 	let texture_files: string[] = export_arm_assets_to_files(project_filepath, project_assets);
 
-	///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);
 
@@ -98,7 +81,6 @@ function export_arm_run_project() {
 			blending: l.blending,
 			parent: l.parent != null ? array_index_of(project_layers, l.parent) : -1,
 			visible: l.visible,
-			///if is_paint
 			texpaint_nor: l.texpaint_nor != null ? lz4_encode(gpu_get_texture_pixels(l.texpaint_nor)) : null,
 			texpaint_pack: l.texpaint_pack != null ? lz4_encode(gpu_get_texture_pixels(l.texpaint_pack)) : null,
 			paint_base: l.paint_base,
@@ -112,11 +94,9 @@ function export_arm_run_project() {
 			paint_height_blend: l.paint_height_blend,
 			paint_emis: l.paint_emis,
 			paint_subs: l.paint_subs
-			///end
 		};
 		array_push(ld, d);
 	}
-	///end
 
 	let packed_assets: packed_asset_t[] = (project_raw.packed_assets == null || project_raw.packed_assets.length == 0) ? null : project_raw.packed_assets;
 	///if arm_ios
@@ -140,7 +120,6 @@ 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
 	// project_raw.mesh_datas = md; // TODO: fix GC ref
 	if (project_raw.mesh_datas == null) {
 		project_raw.mesh_datas = md;
@@ -159,12 +138,6 @@ function export_arm_run_project() {
 	project_raw.mesh_assets = mesh_files;
 	project_raw.atlas_objects = project_atlas_objects;
 	project_raw.atlas_names = project_atlas_names;
-	///end
-
-	///if is_lab
-	project_raw.mesh_data = md;
-	project_raw.material = c;
-	///end
 
 	///if IRON_BGRA
 	project_raw.is_bgra = true;
@@ -201,12 +174,10 @@ function export_arm_run_project() {
 	iron_delete_texture(mesh_icon);
 	///end
 
-	///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);
 	}
-	///end
 
 	let buffer: buffer_t = util_encode_project(project_raw);
 	iron_file_save_bytes(project_filepath, buffer, buffer.length + 1);
@@ -230,11 +201,7 @@ function export_arm_run_project() {
 }
 
 function export_arm_texture_node_name(): string {
-	///if is_paint
 	return "TEX_IMAGE";
-	///else
-	return "image_texture_node";
-	///end
 }
 
 function export_arm_export_node(n: ui_node_t, assets: asset_t[] = null) {

+ 0 - 16
base/sources/ts/export_texture.ts

@@ -3,7 +3,6 @@ let export_texture_gamma: f32 = 1.0 / 2.2;
 
 function export_texture_run(path: string, bake_material: bool = false) {
 
-	///if is_paint
 	if (bake_material) {
 		export_texture_run_bake_material(path);
 	}
@@ -94,12 +93,6 @@ function export_texture_run(path: string, bake_material: bool = false) {
 			export_texture_run_layers(path, layers);
 		}
 	}
-	///end
-
-	///if is_lab
-	let layers: slot_layer_t[] = [context_raw.brush_output_node_inst];
-	export_texture_run_layers(path, layers);
-	///end
 
 	///if arm_ios
 	console_info(tr("Textures exported") + " (\"Files/On My iPad/" + manifest_title + "\")");
@@ -169,7 +162,6 @@ function export_texture_run_layers(path: string, layers: slot_layer_t[], object_
 		f = substring(f, 0, f.length - 4);
 	}
 
-	///if is_paint
 	let is_udim: bool = context_raw.layers_export == export_mode_t.PER_UDIM_TILE;
 	if (is_udim) {
 		ext = object_name + ext;
@@ -299,18 +291,10 @@ function export_texture_run_layers(path: string, layers: slot_layer_t[], object_
 		}
 	}
 
-	///end
-
 	let texpaint: gpu_texture_t = layers_expa;
 	let texpaint_nor: gpu_texture_t = layers_expb;
 	let texpaint_pack: gpu_texture_t = layers_expc;
 
-	///if is_lab
-	texpaint = context_raw.brush_output_node_inst.texpaint;
-	texpaint_nor = context_raw.brush_output_node_inst.texpaint_nor;
-	texpaint_pack = context_raw.brush_output_node_inst.texpaint_pack;
-	///end
-
 	let pixpaint: buffer_t = null;
 	let pixpaint_nor: buffer_t = null;
 	let pixpaint_pack: buffer_t = null;

+ 0 - 20
base/sources/ts/history.ts

@@ -609,7 +609,6 @@ function history_push(name: string): step_t {
 		history_redos = 0;
 	}
 
-	///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);
@@ -627,13 +626,6 @@ function history_push(name: string): step_t {
 		layer_object: context_raw.layer.object_mask,
 		layer_blending: context_raw.layer.blending
 	};
-	///end
-
-	///if is_lab
-	let step: step_t = {
-		name: name
-	};
-	///end
 
 	array_push(history_steps, step);
 
@@ -698,10 +690,6 @@ function history_copy_to_undo(from_id: i32, to_id: i32, is_mask: bool) {
 }
 
 function history_get_canvas(step: step_t): ui_node_canvas_t {
-	///if is_lab
-	return null;
-	///end
-
 	if (step.canvas_group == -1) {
 		return project_materials[step.material].canvas;
 	}
@@ -720,7 +708,6 @@ function history_set_canvas(step: step_t, canvas: ui_node_canvas_t) {
 }
 
 function history_swap_canvas(step: step_t) {
-	///if is_paint
 	if (step.canvas_type == 0) {
 		let _canvas: ui_node_canvas_t = history_get_canvas(step);
 		history_set_canvas(step, step.canvas);
@@ -733,13 +720,6 @@ function history_swap_canvas(step: step_t) {
 		step.canvas = _canvas;
 		context_raw.brush = project_brushes[step.brush];
 	}
-	///end
-
-	///if is_lab
-	let _canvas: ui_node_canvas_t = history_get_canvas(step);
-	history_set_canvas(step, step.canvas);
-	step.canvas = _canvas;
-	///end
 
 	ui_nodes_canvas_changed();
 	ui_nodes_hwnd.redraws = 2;

+ 0 - 41
base/sources/ts/import_arm.ts

@@ -20,7 +20,6 @@ function import_arm_run_project(path: string) {
 		project = armpack_decode(b);
 	}
 
-	///if is_paint
 	if (project.version != null && project.layer_datas == null) {
 		// Import as material
 		if (project.material_nodes != null) {
@@ -38,7 +37,6 @@ function import_arm_run_project(path: string) {
 	}
 	context_raw.layers_preview_dirty = true;
 	context_raw.layer_filter = 0;
-	///end
 
 	project_new(import_as_mesh);
 	project_filepath = path;
@@ -49,13 +47,11 @@ function import_arm_run_project(path: string) {
 	sys_title_set(ui_files_filename + " - " + manifest_title);
 	///end
 
-	///if is_paint
 	// Import as mesh instead
 	if (import_as_mesh) {
 		import_arm_run_mesh(project);
 		return;
 	}
-	///end
 
 	// Save to recent
 	///if arm_ios
@@ -73,14 +69,12 @@ function import_arm_run_project(path: string) {
 
 	project_raw = project;
 
-	///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;
 	base_bits_handle.position = bits_pos;
 	let bytes_per_pixel: i32 = math_floor(l0.bpp / 8);
 	let format: tex_format_t = l0.bpp == 8 ? tex_format_t.RGBA32 : l0.bpp == 16 ? tex_format_t.RGBA64 : tex_format_t.RGBA128;
-	///end
 
 	let base: string = path_base_dir(path);
 	if (project_raw.envmap != null) {
@@ -117,7 +111,6 @@ function import_arm_run_project(path: string) {
 		import_texture_run(abs, hdr_as_envmap);
 	}
 
-	///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];
@@ -133,15 +126,8 @@ function import_arm_run_project(path: string) {
 			}
 		}
 	}
-	///end
 
-	///if is_paint
 	let md: mesh_data_t = mesh_data_create(project.mesh_datas[0]);
-	///end
-
-	///if is_lab
-	let md: mesh_data_t = mesh_data_create(project.mesh_data);
-	///end
 
 	mesh_object_set_data(context_raw.paint_object, md);
 	context_raw.paint_object.base.transform.scale = vec4_create(1, 1, 1);
@@ -149,7 +135,6 @@ 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
 	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);
@@ -165,27 +150,23 @@ function import_arm_run_project(path: string) {
 		project_mesh_assets = [abs];
 	}
 
-	///if is_paint
 	if (project.atlas_objects != null) {
 		project_atlas_objects = project.atlas_objects;
 	}
 	if (project.atlas_names != null) {
 		project_atlas_names = project.atlas_names;
 	}
-	///end
 
 	// No mask by default
 	if (context_raw.merged_object == null) {
 		util_mesh_merge();
 	}
-	///end
 
 	context_select_paint_object(context_main_object());
 	viewport_scale_to_bounds();
 	context_raw.paint_object.skip_context = "paint";
 	context_raw.merged_object.base.visible = true;
 
-	///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) {
@@ -218,10 +199,7 @@ function import_arm_run_project(path: string) {
 	for (let i: i32 = 0; i < project.layer_datas.length; ++i) {
 		let ld: layer_data_t = project.layer_datas[i];
 		let is_group: bool = ld.texpaint == null;
-
-		///if is_paint
 		let is_mask: bool = ld.texpaint != null && ld.texpaint_nor == null;
-		///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) {
@@ -253,7 +231,6 @@ function import_arm_run_project(path: string) {
 				draw_set_pipeline(null);
 				draw_end();
 
-				///if is_paint
 				_texpaint_nor = gpu_create_texture_from_bytes(lz4_decode(ld.texpaint_nor, ld.res * ld.res * 4 * bytes_per_pixel), ld.res, ld.res, format);
 				draw_begin(l.texpaint_nor);
 				draw_set_pipeline(project.is_bgra ? pipes_copy_bgra : pipes_copy);
@@ -267,7 +244,6 @@ function import_arm_run_project(path: string) {
 				draw_image(_texpaint_pack, 0, 0);
 				draw_set_pipeline(null);
 				draw_end();
-				///end
 			}
 
 			l.scale = ld.uv_scale;
@@ -280,7 +256,6 @@ function import_arm_run_project(path: string) {
 			l.object_mask = ld.object_mask;
 			l.blending = ld.blending;
 
-			///if is_paint
 			l.paint_base = ld.paint_base;
 			l.paint_opac = ld.paint_opac;
 			l.paint_occ = ld.paint_occ;
@@ -292,18 +267,15 @@ function import_arm_run_project(path: string) {
 			l.paint_height_blend = ld.paint_height_blend;
 			l.paint_emis = ld.paint_emis;
 			l.paint_subs = ld.paint_subs;
-			///end
 
 			iron_delete_texture(_texpaint);
 
-			///if is_paint
 			if (_texpaint_nor != null) {
 				iron_delete_texture(_texpaint_nor);
 			}
 			if (_texpaint_pack != null) {
 				iron_delete_texture(_texpaint_pack);
 			}
-			///end
 		}
 	}
 
@@ -327,7 +299,6 @@ function import_arm_run_project(path: string) {
 		context_raw.material = slot_material_create(m0, n);
 		array_push(project_materials, context_raw.material);
 	}
-	///end
 
 	ui_nodes_hwnd.redraws = 2;
 	ui_nodes_group_stack = [];
@@ -343,7 +314,6 @@ function import_arm_run_project(path: string) {
 		}
 	}
 
-	///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;
@@ -373,13 +343,6 @@ function import_arm_run_project(path: string) {
 
 	ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2;
 	ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2;
-	///end
-
-	///if is_lab
-	import_arm_init_nodes(project.material.nodes);
-	project_canvas = project.material;
-	parser_logic_parse(project_canvas);
-	///end
 
 	context_raw.ddirty = 4;
 	data_delete_blob(path);
@@ -625,11 +588,7 @@ function import_arm_make_pink(abs: string) {
 }
 
 function import_arm_texture_node_name(): string {
-	///if is_paint
 	return "TEX_IMAGE";
-	///else
-	return "image_texture_node";
-	///end
 }
 
 function import_arm_init_nodes(nodes: ui_node_t[]) {

+ 0 - 18
base/sources/ts/import_mesh.ts

@@ -2,13 +2,7 @@
 let import_mesh_clear_layers: bool = true;
 let import_mesh_meshes_to_unwrap: any[] = null;
 
-///if is_paint
 function import_mesh_run(path: string, _clear_layers: bool = true, replace_existing: bool = true) {
-///end
-
-///if is_lab
-function import_mesh_run(path: string, replace_existing: bool = true) {
-///end
 
 	if (!path_is_mesh(path)) {
 		if (!context_enable_import_plugin(path)) {
@@ -17,10 +11,8 @@ function import_mesh_run(path: string, replace_existing: bool = true) {
 		}
 	}
 
-	///if is_paint
 	import_mesh_clear_layers = _clear_layers;
 	context_raw.layer_filter = 0;
-	///end
 
 	import_mesh_meshes_to_unwrap = null;
 
@@ -97,12 +89,8 @@ function import_mesh_finish_import() {
 	make_material_parse_paint_material();
 	make_material_parse_mesh_material();
 
-	///if is_paint
 	ui_view2d_hwnd.redraws = 2;
-	///end
-
 	render_path_raytrace_ready = false;
-
 	context_raw.paint_body = null;
 }
 
@@ -139,15 +127,12 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) {
 
 	context_raw.ddirty = 4;
 
-	///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;
 	util_uv_trianglemap_cached = false;
 	util_uv_dilatemap_cached = false;
-	///end
 
-	///if is_paint
 	if (import_mesh_clear_layers) {
 		while (project_layers.length > 0) {
 			let l: slot_layer_t = array_pop(project_layers);
@@ -157,7 +142,6 @@ function _import_mesh_make_mesh(mesh: raw_mesh_t) {
 		sys_notify_on_next_frame(layers_init);
 		history_reset();
 	}
-	///end
 
 	// Wait for add_mesh calls to finish
 	if (import_mesh_meshes_to_unwrap != null) {
@@ -243,12 +227,10 @@ function _import_mesh_add_mesh(mesh: raw_mesh_t) {
 
 	context_raw.ddirty = 4;
 
-	///if is_paint
 	ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2;
 	util_uv_uvmap_cached = false;
 	util_uv_trianglemap_cached = false;
 	util_uv_dilatemap_cached = false;
-	///end
 }
 
 function import_mesh_add_mesh(mesh: raw_mesh_t) {

+ 0 - 41
base/sources/ts/layers.ts

@@ -21,32 +21,7 @@ let _layers_roughness: f32;
 let _layers_metallic: f32;
 
 function layers_init() {
-	///if is_paint
 	slot_layer_clear(project_layers[0], color_from_floats(layers_default_base, layers_default_base, layers_default_base, 1.0));
-	///end
-
-	///if is_lab
-	let texpaint: render_target_t = map_get(render_path_render_targets, "texpaint");
-	let texpaint_nor: render_target_t = map_get(render_path_render_targets, "texpaint_nor");
-	let texpaint_pack: render_target_t = map_get(render_path_render_targets, "texpaint_pack");
-	draw_begin(texpaint._image);
-	draw_scaled_image(resource_get("placeholder.k"), 0, 0, config_get_texture_res_x(), config_get_texture_res_y()); // Base
-	draw_end();
-	// Nor
-	_gpu_begin(texpaint_nor._image, null, null, clear_flag_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
-	gpu_end();
-	// Occ, rough, met
-	_gpu_begin(texpaint_pack._image, null, null, clear_flag_t.COLOR, color_from_floats(1.0, 0.4, 0.0, 0.0));
-	gpu_end();
-	let texpaint_nor_empty: render_target_t = map_get(render_path_render_targets, "texpaint_nor_empty");
-	let texpaint_pack_empty: render_target_t = map_get(render_path_render_targets, "texpaint_pack_empty");
-	// Nor
-	_gpu_begin(texpaint_nor_empty._image, null, null, clear_flag_t.COLOR, color_from_floats(0.5, 0.5, 1.0, 0.0));
-	gpu_end();
-	// Occ, rough, met
-	_gpu_begin(texpaint_pack_empty._image, null, null, clear_flag_t.COLOR, color_from_floats(1.0, 0.4, 0.0, 0.0));
-	gpu_end();
-	///end
 }
 
 function layers_resize() {
@@ -119,12 +94,7 @@ function layers_set_bits() {
 }
 
 function layers_make_temp_img() {
-	///if is_paint
 	let l: slot_layer_t = project_layers[0];
-	///end
-	///if is_lab
-	let l: brush_output_node_t = context_raw.brush_output_node_inst;
-	///end
 
 	if (layers_temp_image != null && (layers_temp_image.width != l.texpaint.width || layers_temp_image.height != l.texpaint.height || layers_temp_image.format != l.texpaint.format)) {
 		let _temptex0: render_target_t = map_get(render_path_render_targets, "temptex0");
@@ -136,9 +106,6 @@ function layers_make_temp_img() {
 		let format: string = base_bits_handle.position == texture_bits_t.BITS8  ? "RGBA32" :
 							 base_bits_handle.position == texture_bits_t.BITS16 ? "RGBA64" :
 																				  "RGBA128";
-		///if is_lab
-		format = "RGBA32";
-		///end
 
 		let t: render_target_t = render_target_create();
 		t.name = "temptex0";
@@ -162,12 +129,7 @@ function layers_make_temp_mask_img() {
 }
 
 function layers_make_export_img() {
-	///if is_paint
 	let l: slot_layer_t = project_layers[0];
-	///end
-	///if is_lab
-	let l: brush_output_node_t = context_raw.brush_output_node_inst;
-	///end
 
 	if (layers_expa != null && (layers_expa.width != l.texpaint.width || layers_expa.height != l.texpaint.height || layers_expa.format != l.texpaint.format)) {
 		let _expa: gpu_texture_t = layers_expa;
@@ -188,9 +150,6 @@ function layers_make_export_img() {
 							 base_bits_handle.position == texture_bits_t.BITS16 ? "RGBA64" :
 																				  "RGBA128";
 
-		///if is_lab
-		format = "RGBA32";
-		///end
 
 		{
 			let t: render_target_t = render_target_create();

+ 0 - 58
base/sources/ts/pipes.ts

@@ -69,7 +69,6 @@ function _pipes_make_merge(red: bool, green: bool, blue: bool, alpha: bool): gpu
 }
 
 function pipes_init() {
-	///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);
@@ -82,7 +81,6 @@ function pipes_init() {
 	pipes_opac = pipes_get_constant_location("float");
 	pipes_blending = pipes_get_constant_location("int");
 	pipes_tex1w = pipes_get_constant_location("float");
-	///end
 
 	{
 		pipes_copy = gpu_create_pipeline();
@@ -140,7 +138,6 @@ function pipes_init() {
 		gpu_pipeline_compile(pipes_copy128);
 	}
 
-	///if is_paint
 	{
 		pipes_invert8 = gpu_create_pipeline();
 		pipes_invert8.vertex_shader = sys_get_shader("layer_invert.vert");
@@ -191,61 +188,6 @@ function pipes_init() {
 		pipes_texpaint_colorid = 0;
 		pipes_tex_colorid = 1;
 	}
-	///end
-
-	///if is_lab
-	{
-		pipes_copy_r = gpu_create_pipeline();
-		pipes_copy_r.vertex_shader = sys_get_shader("layer_copy.vert");
-		pipes_copy_r.fragment_shader = sys_get_shader("layer_copy.frag");
-		let vs: gpu_vertex_structure_t = {};
-		gpu_vertex_struct_add(vs, "pos", vertex_data_t.F32_2X);
-		pipes_copy_r.input_layout = vs;
-		ARRAY_ACCESS(pipes_copy_r.color_write_mask_green, 0) = false;
-		ARRAY_ACCESS(pipes_copy_r.color_write_mask_blue, 0) = false;
-		ARRAY_ACCESS(pipes_copy_r.color_write_mask_alpha, 0) = false;
-		gpu_pipeline_compile(pipes_copy_r);
-	}
-
-	{
-		pipes_copy_g = gpu_create_pipeline();
-		pipes_copy_g.vertex_shader = sys_get_shader("layer_copy.vert");
-		pipes_copy_g.fragment_shader = sys_get_shader("layer_copy.frag");
-		let vs: gpu_vertex_structure_t = {};
-		gpu_vertex_struct_add(vs, "pos", vertex_data_t.F32_2X);
-		pipes_copy_g.input_layout = vs;
-		ARRAY_ACCESS(pipes_copy_g.color_write_mask_red, 0) = false;
-		ARRAY_ACCESS(pipes_copy_g.color_write_mask_blue, 0) = false;
-		ARRAY_ACCESS(pipes_copy_g.color_write_mask_alpha, 0) = false;
-		gpu_pipeline_compile(pipes_copy_g);
-	}
-
-	{
-		pipes_inpaint_preview = gpu_create_pipeline();
-		pipes_inpaint_preview.vertex_shader = sys_get_shader("inpaint_preview.vert");
-		pipes_inpaint_preview.fragment_shader = sys_get_shader("inpaint_preview.frag");
-		let vs: gpu_vertex_structure_t = {};
-		gpu_vertex_struct_add(vs, "pos", vertex_data_t.F32_2X);
-		pipes_inpaint_preview.input_layout = vs;
-		gpu_pipeline_compile(pipes_inpaint_preview);
-		pipes_tex0_inpaint_preview = 0;
-		pipes_texa_inpaint_preview = 1;
-	}
-
-	{
-		pipes_copy_a = gpu_create_pipeline();
-		pipes_copy_a.vertex_shader = sys_get_shader("layer_copy_rrrr.vert");
-		pipes_copy_a.fragment_shader = sys_get_shader("layer_copy_rrrr.frag");
-		let vs: gpu_vertex_structure_t = {};
-		gpu_vertex_struct_add(vs, "pos", vertex_data_t.F32_2X);
-		pipes_copy_a.input_layout = vs;
-		ARRAY_ACCESS(pipes_copy_a.color_write_mask_red, 0) = false;
-		ARRAY_ACCESS(pipes_copy_a.color_write_mask_green, 0) = false;
-		ARRAY_ACCESS(pipes_copy_a.color_write_mask_blue, 0) = false;
-		gpu_pipeline_compile(pipes_copy_a);
-		pipes_copy_a_tex = 0;
-	}
-	///end
 
 	{
 		pipes_copy_rgb = gpu_create_pipeline();

+ 0 - 44
base/sources/ts/project.ts

@@ -100,7 +100,6 @@ function project_save_as(save_and_quit: bool = false) {
 }
 
 function project_new_box() {
-	///if is_paint
 	ui_box_show_custom(function () {
 		if (ui_tab(ui_handle(__ID__), tr("New Project"))) {
 			if (project_mesh_list == null) {
@@ -139,12 +138,6 @@ function project_new_box() {
 			}
 		}
 	});
-	///end
-
-	///if is_lab
-	project_new();
-	viewport_scale_to_bounds();
-	///end
 }
 
 function project_new(reset_layers: bool = true) {
@@ -219,43 +212,30 @@ function project_new(reset_layers: bool = true) {
 	let in_use: bool = gpu_in_use;
 	if (in_use) draw_end();
 
-	///if is_paint
 	context_raw.picker_mask_handle.position = picker_mask_t.NONE;
-	///end
 
 	mesh_object_set_data(context_raw.paint_object, md);
 	context_raw.paint_object.base.transform.scale = vec4_create(1, 1, 1);
 	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
 	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
 	array_push(project_materials, slot_material_create(m));
-	///end
-	///if is_lab
-	project_material_data = m;
-	///end
 
-	///if is_paint
 	context_raw.material = project_materials[0];
-	///end
 
 	ui_nodes_hwnd.redraws = 2;
 	ui_nodes_group_stack = [];
 	project_material_groups = [];
 
-	///if is_paint
 	project_brushes = [slot_brush_create()];
 	context_raw.brush = project_brushes[0];
 
 	project_fonts = [slot_font_create("default.ttf", base_font)];
 	context_raw.font = project_fonts[0];
-	///end
 
 	project_set_default_swatches();
 	context_raw.swatch = project_raw.swatches[0];
@@ -267,9 +247,7 @@ function project_new(reset_layers: bool = true) {
 	make_material_parse_paint_material();
 	make_material_parse_brush();
 
-	///if is_paint
 	util_render_make_material_preview();
-	///end
 
 	for (let i: i32 = 0; i < project_assets.length; ++i) {
 		let a: asset_t = project_assets[i];
@@ -282,14 +260,11 @@ function project_new(reset_layers: bool = true) {
 	project_raw.packed_assets = [];
 	context_raw.ddirty = 4;
 
-	///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
 		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));
@@ -300,7 +275,6 @@ function project_new(reset_layers: bool = true) {
 		if (aspect_ratio_changed) {
 			sys_notify_on_next_frame(layers_resize);
 		}
-		///end
 
 		sys_notify_on_next_frame(layers_init);
 	}
@@ -309,9 +283,7 @@ function project_new(reset_layers: bool = true) {
 
 	project_set_default_envmap();
 
-	///if is_paint
 	context_init_tool();
-	///end
 
 	render_path_raytrace_ready = false;
 }
@@ -432,7 +404,6 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl
 				}
 			}
 
-			///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;
@@ -445,7 +416,6 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl
 			if (ends_with(to_lower_case(path), ".blend")) {
 				import_blend_mesh_ui();
 			}
-			///end
 
 			let row: f32 [] = [0.45, 0.45, 0.1];
 			ui_row(row);
@@ -459,12 +429,7 @@ function project_import_mesh_box(path: string, replace_existing: bool = true, cl
 				console_toast(tr("Importing mesh"));
 				///end
 
-				///if is_paint
 				import_mesh_run(path, clear_layers, replace_existing);
-				///end
-				///if is_lab
-				import_mesh_run(path, replace_existing);
-				///end
 				if (done != null) {
 					done();
 				}
@@ -601,19 +566,15 @@ 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
 	if (context_raw.texture == old_asset) {
 		context_raw.texture = project_assets[i];
 	}
-	///end
 
 	sys_notify_on_next_frame(function () {
 		make_material_parse_paint_material();
 
-		///if is_paint
 		util_render_make_material_preview();
 		ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2;
-		///end
 	});
 }
 
@@ -836,11 +797,6 @@ type project_format_t = {
 	mesh_icons?: buffer_t[];
 	atlas_objects?: i32[];
 	atlas_names?: string[];
-	///if is_lab
-	material?: ui_node_canvas_t;
-	mesh_data?: mesh_data_t;
-	mesh_icon?: buffer_t;
-	///end
 };
 
 type asset_t = {

+ 0 - 6
base/sources/ts/render_path_deferred.ts

@@ -97,18 +97,12 @@ function render_path_deferred_init() {
 	render_path_load_shader("shader_datas/supersample_resolve/supersample_resolveRGBA64");
 
 	render_path_paint_init();
-
-	///if is_paint
 	render_path_preview_init();
-	///end
-
 	render_path_raytrace_init();
 }
 
 function render_path_deferred_commands() {
-	///if is_paint
 	render_path_paint_live_brush_dirty();
-	///end
 	render_path_base_commands(render_path_deferred_draw_deferred);
 }
 

+ 0 - 2
base/sources/ts/render_path_forward.ts

@@ -3,9 +3,7 @@ function render_path_forward_init() {
 }
 
 function render_path_forward_commands() {
-	///if is_paint
 	render_path_paint_live_brush_dirty();
-	///end
 	render_path_base_commands(render_path_forward_draw_forward);
 }
 

+ 0 - 20
base/sources/ts/render_path_raytrace.ts

@@ -63,19 +63,6 @@ function render_path_raytrace_commands(use_live_layer: bool) {
 	}
 	////
 
-	///if is_lab
-	let l: slot_layer_t = layers_flatten(true);
-	if (l.texpaint != render_path_raytrace_last_texpaint) {
-		render_path_raytrace_last_texpaint = l.texpaint;
-
-		let bnoise_sobol: gpu_texture_t = map_get(scene_embedded, "bnoise_sobol.k");
-		let bnoise_scramble: gpu_texture_t = map_get(scene_embedded, "bnoise_scramble.k");
-		let bnoise_rank: gpu_texture_t = map_get(scene_embedded, "bnoise_rank.k");
-
-		iron_raytrace_set_textures(l.texpaint, l.texpaint_nor, l.texpaint_pack, saved_envmap, bnoise_sobol, bnoise_scramble, bnoise_rank);
-	}
-	///end
-
 	if (context_raw.pdirty > 0 || render_path_raytrace_dirty > 0) {
 		layers_flatten(true);
 	}
@@ -118,9 +105,6 @@ function render_path_raytrace_commands(use_live_layer: bool) {
 	}
 	render_path_raytrace_f32a[21] = context_raw.envmap_angle;
 	render_path_raytrace_f32a[22] = render_path_raytrace_uv_scale;
-	///if is_lab
-	render_path_raytrace_f32a[22] *= scene_meshes[0].data.scale_tex;
-	///end
 
 	let framebuffer: render_target_t = map_get(render_path_render_targets, "buf");
 	iron_raytrace_dispatch_rays(framebuffer._image, render_path_raytrace_f32a);
@@ -186,11 +170,7 @@ function render_path_raytrace_build_data() {
 		util_mesh_merge();
 	}
 
-	///if is_paint
 	let mo: mesh_object_t = !context_layer_filter_used() ? context_raw.merged_object : context_raw.paint_object;
-	///else
-	let mo: mesh_object_t = scene_meshes[0];
-	///end
 
 	if (context_raw.tool == tool_type_t.GIZMO) {
 		render_path_raytrace_transform = mo.base.transform.world_unpack;

+ 0 - 2
base/sources/ts/slot_layer.ts

@@ -89,7 +89,6 @@ function slot_layer_create(ext: string = "", type: layer_slot_type_t = layer_slo
 			raw.texpaint = render_path_create_render_target(t)._image;
 		}
 
-		///if is_paint
 		{
 			let t: render_target_t = render_target_create();
 			t.name = "texpaint_nor" + ext;
@@ -108,7 +107,6 @@ function slot_layer_create(ext: string = "", type: layer_slot_type_t = layer_slo
 		}
 
 		raw.texpaint_preview = gpu_create_render_target(util_render_layer_preview_size, util_render_layer_preview_size, tex_format_t.RGBA32);
-		///end
 	}
 
 	else { // Mask

+ 0 - 4
base/sources/ts/tab_browser.ts

@@ -154,7 +154,6 @@ function tab_browser_draw(htab: ui_handle_t) {
 						});
 					}
 
-					///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 () {
@@ -173,9 +172,7 @@ function tab_browser_draw(htab: ui_handle_t) {
 							});
 						});
 					}
-					///end
 
-					///if is_paint
 					if (ui_menu_button(tr("Set as Color ID Map"))) {
 						import_asset_run(file, -1.0, -1.0, true, true, function () {
 							sys_notify_on_next_frame(function () {
@@ -200,7 +197,6 @@ function tab_browser_draw(htab: ui_handle_t) {
 							});
 						});
 					}
-					///end
 				}
 				if (ui_menu_button(tr("Open Externally"))) {
 					file_start(file);

+ 0 - 4
base/sources/ts/tab_materials.ts

@@ -127,11 +127,9 @@ function tab_materials_draw_slots(mini: bool) {
 			if (state == ui_state_t.STARTED && ui.input_y > ui._window_y) {
 				if (context_raw.material != project_materials[i]) {
 					context_select_material(i);
-					///if is_paint
 					if (context_raw.tool == tool_type_t.MATERIAL) {
 						sys_notify_on_next_frame(layers_update_fill_layers);
 					}
-					///end
 				}
 				base_drag_off_x = -(mouse_x - uix - ui._window_x - 3);
 				base_drag_off_y = -(mouse_y - uiy - ui._window_y + 1);
@@ -164,12 +162,10 @@ function tab_materials_draw_slots(mini: bool) {
 						box_export_show_material();
 					}
 
-					///if is_paint
 					if (ui_menu_button(tr("Bake"))) {
 						context_select_material(i);
 						box_export_show_bake_material();
 					}
-					///end
 
 					if (ui_menu_button(tr("Duplicate"))) {
 						sys_notify_on_next_frame(function () {

+ 0 - 7
base/sources/ts/tab_meshes.ts

@@ -57,14 +57,7 @@ function tab_meshes_draw(htab: ui_handle_t) {
 				}
 
 				if (ui_menu_button(tr("Apply Displacement"))) {
-					///if is_paint
 					util_mesh_apply_displacement(project_layers[0].texpaint_pack);
-					///end
-					///if is_lab
-					let displace_strength: f32 = config_raw.displace_strength > 0 ? config_raw.displace_strength : 1.0;
-					let uv_scale: f32 = scene_meshes[0].data.scale_tex * context_raw.brush_scale;
-					util_mesh_apply_displacement(context_raw.brush_output_node_inst.texpaint_pack, 0.05 * displace_strength, uv_scale);
-					///end
 
 					util_mesh_calc_normals();
 					context_raw.ddirty = 2;

+ 0 - 6
base/sources/ts/tab_plugins.ts

@@ -4,14 +4,8 @@ function tab_plugins_draw(htab: ui_handle_t) {
 
 		ui_begin_sticky();
 
-		///if is_paint
 		let row: f32[] = [1 / 4];
 		ui_row(row);
-		///end
-		///if is_lab
-		let row: f32[] = [1 / 14];
-		ui_row(row);
-		///end
 
 		if (ui_button(tr("Manager"))) {
 			box_preferences_htab.position = 6; // Plugins

+ 0 - 2
base/sources/ts/tab_swatches.ts

@@ -204,7 +204,6 @@ 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
 						else if (ui_menu_button(tr("Create Material"))) {
 							tab_materials_accept_swatch_drag(project_raw.swatches[i]);
 						}
@@ -213,7 +212,6 @@ function tab_swatches_draw(htab: ui_handle_t) {
 							color = color_set_ab(color, project_raw.swatches[i].opacity * 255);
 							layers_create_color_layer(color, project_raw.swatches[i].occlusion, project_raw.swatches[i].roughness, project_raw.swatches[i].metallic);
 						}
-						///end
 					});
 				}
 				if (ui.is_hovered) {

+ 0 - 13
base/sources/ts/tab_textures.ts

@@ -38,12 +38,7 @@ function tab_textures_draw(htab: ui_handle_t) {
 
 		if (project_assets.length > 0) {
 
-			///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
-			let statusw: i32 = iron_window_width();
-			///end
 
 			let slotw: i32 = math_floor(52 * UI_SCALE());
 			let num: i32 = math_floor(statusw / slotw);
@@ -165,13 +160,11 @@ function tab_textures_draw(htab: ui_handle_t) {
 								project_reimport_texture(_tab_textures_draw_asset);
 							}
 
-							///if is_paint
 							if (ui_menu_button(tr("To Mask"))) {
 								sys_notify_on_next_frame(function () {
 									layers_create_image_mask(_tab_textures_draw_asset);
 								});
 							}
-							///end
 
 							if (ui_menu_button(tr("Set as Envmap"))) {
 								sys_notify_on_next_frame(function () {
@@ -179,7 +172,6 @@ function tab_textures_draw(htab: ui_handle_t) {
 								});
 							}
 
-							///if is_paint
 							if (ui_menu_button(tr("Set as Color ID Map"))) {
 								context_raw.colorid_handle.position = _tab_textures_draw_i;
 								context_raw.colorid_picked = false;
@@ -189,7 +181,6 @@ function tab_textures_draw(htab: ui_handle_t) {
 									context_raw.ddirty = 2;
 								}
 							}
-							///end
 
 							if (ui_menu_button(tr("Delete"), "delete")) {
 								tab_textures_delete_texture(_tab_textures_draw_asset);
@@ -275,13 +266,10 @@ function tab_textures_delete_texture(asset: asset_t) {
 	sys_notify_on_next_frame(function () {
 		make_material_parse_paint_material();
 
-		///if is_paint
 		util_render_make_material_preview();
 		ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2;
-		///end
 	});
 
-	///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);
@@ -291,5 +279,4 @@ function tab_textures_delete_texture(asset: asset_t) {
 		let b: slot_brush_t = project_brushes[i];
 		tab_textures_update_texture_pointers(b.canvas.nodes, i);
 	}
-	///end
 }

+ 0 - 131
base/sources/ts/ui_base.ts

@@ -16,14 +16,8 @@ let ui_base_hwnds: ui_handle_t[] = ui_base_init_hwnds();
 let ui_base_htabs: ui_handle_t[] = ui_base_init_htabs();
 let ui_base_hwnd_tabs: tab_draw_array_t[] = ui_base_init_hwnd_tabs();
 let ui_base_viewport_col: i32;
-
-///if is_lab
-let ui_base_default_sidebar_mini_w: i32 = 0;
-let ui_base_default_sidebar_full_w: i32 = 0;
-///else
 let ui_base_default_sidebar_mini_w: i32 = 56;
 let ui_base_default_sidebar_full_w: i32 = 280;
-///end
 
 ///if (arm_android || arm_ios)
 let ui_base_default_sidebar_w: i32 = ui_base_default_sidebar_mini_w;
@@ -56,10 +50,8 @@ function ui_base_init_hwnd_tabs(): tab_draw_array_t[] {
 }
 
 function ui_base_init() {
-	///if is_paint
 	ui_toolbar_init();
 	context_raw.text_tool_text = tr("Text");
-	///end
 
 	ui_header_init();
 	ui_status_init();
@@ -68,7 +60,6 @@ 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
 	if (project_materials == null) {
 		project_materials = [];
 		let m: material_data_t = data_get_material("Scene", "Material");
@@ -94,27 +85,6 @@ function ui_base_init() {
 		array_push(project_layers, slot_layer_create());
 		context_raw.layer = project_layers[0];
 	}
-	///end
-
-	///if is_lab
-	if (project_material_data == null) {
-		let m: material_data_t = data_get_material("Scene", "Material");
-		project_material_data = m;
-	}
-
-	if (project_default_canvas == null) { // Synchronous
-		let b: buffer_t = data_get_blob("default_brush.arm");
-		project_default_canvas = b;
-	}
-
-	project_nodes = ui_nodes_create();
-	project_canvas = armpack_decode(project_default_canvas);
-	project_canvas.name = "Brush 1";
-
-	brush_output_node_parse_inputs();
-
-	parser_logic_parse(project_canvas);
-	///end
 
 	if (project_raw.swatches == null) {
 		project_set_default_swatches();
@@ -159,14 +129,8 @@ 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
 	let resources: string[] = ["cursor.k", "icons.k"];
-	///end
-	///if is_lab
-	let resources: string[] = ["cursor.k", "icons.k", "placeholder.k"];
-	///end
 
-	///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");
@@ -177,7 +141,6 @@ function ui_base_init() {
 	context_raw.gizmo_rotate_x = object_get_child(context_raw.gizmo, ".RotateX");
 	context_raw.gizmo_rotate_y = object_get_child(context_raw.gizmo, ".RotateY");
 	context_raw.gizmo_rotate_z = object_get_child(context_raw.gizmo, ".RotateZ");
-	///end
 
 	resource_load(resources);
 
@@ -221,23 +184,14 @@ function ui_base_update() {
 
 	if (!ui.is_typing) {
 		if (operator_shortcut(map_get(config_keymap, "toggle_node_editor"))) {
-			///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
-			ui_base_show_material_nodes();
-			///end
 		}
 		else if (operator_shortcut(map_get(config_keymap, "toggle_browser"))) {
 			ui_base_toggle_browser();
 		}
 
 		else if (operator_shortcut(map_get(config_keymap, "toggle_2d_view"))) {
-			///if is_paint
 			ui_base_show_2d_view(view_2d_type_t.LAYER);
-			///else
-			ui_base_show_2d_view(view_2d_type_t.ASSET);
-			///end
 		}
 	}
 
@@ -294,7 +248,6 @@ function ui_base_update() {
 	}
 	///end
 
-	///if is_paint
 	let decal: bool = context_is_decal();
 	let decal_mask: bool = context_is_decal_mask();
 
@@ -338,29 +291,9 @@ function ui_base_update() {
 			}
 		}
 	}
-	///end
-
-	///if is_lab
-	if ((context_raw.brush_can_lock || context_raw.brush_locked) && mouse_moved) {
-		if (operator_shortcut(map_get(config_keymap, "brush_radius"), shortcut_type_t.DOWN)) {
-			if (context_raw.brush_locked) {
-				context_raw.brush_radius += mouse_movement_x / 150;
-				context_raw.brush_radius = math_max(0.01, math_min(4.0, context_raw.brush_radius));
-				context_raw.brush_radius = math_round(context_raw.brush_radius * 100) / 100;
-				context_raw.brush_radius_handle.value = context_raw.brush_radius;
-				ui_header_handle.redraws = 2;
-			}
-			else if (context_raw.brush_can_lock) {
-				context_raw.brush_can_lock = false;
-				context_raw.brush_locked = true;
-			}
-		}
-	}
-	///end
 
 	let is_typing: bool = ui.is_typing;
 
-	///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;
@@ -379,12 +312,10 @@ function ui_base_update() {
 			}
 		}
 	}
-	///end
 
 	// Viewport shortcuts
 	if (context_in_paint_area() && !is_typing) {
 
-		///if is_paint
 		if (!mouse_down("right")) { // Fly mode off
 			if (operator_shortcut(map_get(config_keymap, "tool_brush"))) {
 				context_select_tool(tool_type_t.BRUSH);
@@ -484,38 +415,6 @@ function ui_base_update() {
 		if (decal_mask && (operator_shortcut(map_get(config_keymap, "decal_mask"), shortcut_type_t.STARTED) || operator_shortcut(map_get(config_keymap, "decal_mask"), shortcut_type_t.RELEASED))) {
 			ui_header_handle.redraws = 2;
 		}
-		///end
-
-		///if is_lab
-		if (ui_header_worktab.position == space_type_t.SPACE3D) {
-			// Radius
-			if (context_raw.tool == tool_type_t.ERASER ||
-				context_raw.tool == tool_type_t.CLONE  ||
-				context_raw.tool == tool_type_t.BLUR   ||
-				context_raw.tool == tool_type_t.SMUDGE) {
-				if (operator_shortcut(map_get(config_keymap, "brush_radius"))) {
-					context_raw.brush_can_lock = true;
-					if (!pen_connected) {
-						mouse_lock();
-					}
-					context_raw.lock_started_x = mouse_x;
-					context_raw.lock_started_y = mouse_y;
-				}
-				else if (operator_shortcut(map_get(config_keymap, "brush_radius_decrease"), shortcut_type_t.REPEAT)) {
-					context_raw.brush_radius -= ui_base_get_radius_increment();
-					context_raw.brush_radius = math_max(math_round(context_raw.brush_radius * 100) / 100, 0.01);
-					context_raw.brush_radius_handle.value = context_raw.brush_radius;
-					ui_header_handle.redraws = 2;
-				}
-				else if (operator_shortcut(map_get(config_keymap, "brush_radius_increase"), shortcut_type_t.REPEAT)) {
-					context_raw.brush_radius += ui_base_get_radius_increment();
-					context_raw.brush_radius = math_round(context_raw.brush_radius * 100) / 100;
-					context_raw.brush_radius_handle.value = context_raw.brush_radius;
-					ui_header_handle.redraws = 2;
-				}
-			}
-		}
-		///end
 
 		// Viewpoint
 		if (mouse_view_x() < sys_w()) {
@@ -579,7 +478,6 @@ function ui_base_update() {
 						tr("Metallic"),
 						tr("Opacity"),
 						tr("Height"),
-						///if is_paint
 						tr("Emission"),
 						tr("Subsurface"),
 						tr("TexCoord"),
@@ -587,7 +485,6 @@ function ui_base_update() {
 						tr("Material ID"),
 						tr("Object ID"),
 						tr("Mask")
-						///end
 					];
 
 					let shortcuts: string[] = ["l", "b", "n", "o", "r", "m", "a", "h", "e", "s", "t", "1", "2", "3", "4"];
@@ -626,17 +523,11 @@ function ui_base_update() {
 			context_raw.brush_can_unlock = false;
 		}
 
-		///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) &&
 			!operator_shortcut(map_get(config_keymap, "brush_angle"), shortcut_type_t.DOWN) &&
 			!(decal_mask && operator_shortcut(map_get(config_keymap, "decal_mask") + "+" + map_get(config_keymap, "brush_radius"), shortcut_type_t.DOWN));
-		///end
-		///if is_lab
-		let b: bool = (context_raw.brush_can_lock || context_raw.brush_locked) &&
-			!operator_shortcut(map_get(config_keymap, "brush_radius"), shortcut_type_t.DOWN);
-		///end
 
 		if (b) {
 			mouse_unlock();
@@ -960,19 +851,11 @@ function ui_base_update_ui() {
 	let decal: bool = context_is_decal();
 	let decal_mask: bool = context_is_decal_mask_paint();
 
-	///if is_paint
 	let down: bool = operator_shortcut(map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) ||
 					 decal_mask ||
 					 set_clone_source ||
 					 operator_shortcut(map_get(config_keymap, "brush_ruler") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) ||
 					 (pen_down() && !keyboard_down("alt"));
-	///end
-	///if is_lab
-	let down: bool = operator_shortcut(map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) ||
-					 set_clone_source ||
-					 operator_shortcut(map_get(config_keymap, "brush_ruler") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN) ||
-					 (pen_down() && !keyboard_down("alt"));
-	///end
 
 	if (config_raw.touch_ui) {
 		if (pen_down()) {
@@ -1143,9 +1026,7 @@ function ui_base_update_ui() {
 		history_redo();
 	}
 
-	///if is_paint
 	gizmo_update();
-	///end
 }
 
 function ui_base_render() {
@@ -1180,18 +1061,11 @@ function ui_base_render() {
 	}
 
 	ui_begin(ui);
-
-	///if is_paint
 	ui_toolbar_render_ui();
-	///end
 	ui_menubar_render_ui();
 	ui_header_render_ui();
 	ui_status_render_ui();
-
-	///if is_paint
 	ui_base_draw_sidebar();
-	///end
-
 	ui_end();
 
 	ui.input_enabled = true;
@@ -1427,13 +1301,8 @@ function ui_base_show_material_nodes() {
 	// Clear input state as ui receives input events even when not drawn
 	ui_end_input();
 
-	///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
-	///if is_lab
-	ui_nodes_show = !ui_nodes_show;
-	///end
 
 	///if (arm_ios || arm_android)
 	if (ui_view2d_show) {

+ 0 - 10
base/sources/ts/ui_files.ts

@@ -217,10 +217,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
 										let icon: gpu_texture_t = gpu_create_render_target(data.image.width, data.image.height);
 										if (ends_with(data.f, ".arm")) { // Used for material sphere alpha cutout
 											draw_begin(icon);
-
-											///if is_paint
 											draw_image(project_materials[0].image, 0, 0);
-											///end
 										}
 										else {
 											draw_begin(icon, true, 0xffffffff);
@@ -285,13 +282,6 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
 						icon = gpu_create_texture_from_bytes(lz4_decode(bytes_icon, 256 * 256 * 4), 256, 256);
 					}
 
-					///if is_lab
-					if (raw.mesh_icon != null) {
-						let bytes_icon: buffer_t = raw.mesh_icon;
-						icon = gpu_create_texture_from_bytes(lz4_decode(bytes_icon, 256 * 256 * 4), 256, 256);
-					}
-					///end
-
 					map_set(ui_files_icon_map, key, icon);
 				}
 				if (icon != null) {

+ 0 - 4
base/sources/ts/ui_header.ts

@@ -22,11 +22,7 @@ function ui_header_render_ui() {
 	}
 
 	let nodesw: i32 = (ui_nodes_show || ui_view2d_show) ? config_raw.layout[layout_size_t.NODES_W] : 0;
-	///if is_lab
-	let ww: i32 = iron_window_width() - nodesw;
-	///else
 	let ww: i32 = iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W] - nodesw;
-	///end
 
 	if (ui_window(ui_header_handle, sys_x(), ui_header_h, ww, ui_header_h)) {
 		ui._y += 2;

+ 0 - 114
base/sources/ts/ui_menubar.ts

@@ -20,7 +20,6 @@ function ui_menubar_init() {
 
 function ui_menu_panel_x(): i32 {
 	let panel_x: i32 = sys_x();
-	///if is_paint
 	if (config_raw.layout[layout_size_t.HEADER] == 1) {
 		let item_w: i32 = ui_toolbar_w();
 		panel_x = sys_x() - item_w;
@@ -28,19 +27,16 @@ function ui_menu_panel_x(): i32 {
 	else {
 		panel_x += 5 * UI_SCALE();
 	}
-	///end
 	return panel_x;
 }
 
 function ui_menu_panel_y(): i32 {
 	let panel_y: i32 = 0;
-	///if is_paint
 	if (config_raw.layout[layout_size_t.HEADER] == 1) {
 	}
 	else {
 		panel_y += 5 * UI_SCALE();
 	}
-	///end
 	return panel_y;
 }
 
@@ -55,13 +51,7 @@ function ui_menubar_render_ui() {
 		ui_begin_menu();
 
 		if (config_raw.touch_ui) {
-
-			///if is_paint
 			ui._w = item_w;
-			///end
-			///if is_lab
-			ui._w = 36;
-			///end
 
 			if (ui_menubar_icon_button(0, 2)) box_preferences_show();
 			if (ui_menubar_icon_button(0, 3)) {
@@ -76,11 +66,9 @@ function ui_menubar_render_ui() {
 			if (ui_menubar_icon_button(4, 2)) {
 				project_import_asset();
 			}
-			///if (is_paint || is_lab)
 			if (ui_menubar_icon_button(5, 2)) {
 				box_export_show_textures();
 			}
-			///end
 			let size: i32 = math_floor(ui._w / UI_SCALE());
 			if (ui_menu_show && ui_menubar_category == menubar_category_t.VIEWPORT) {
 				ui_fill(0, -6, size, size - 4, ui.ops.theme.HIGHLIGHT_COL);
@@ -127,10 +115,7 @@ function ui_menubar_render_ui() {
 
 		if (ui_menubar_w < ui._x + 10) {
 			ui_menubar_w = math_floor(ui._x + 10);
-
-			///if is_paint
 			ui_toolbar_handle.redraws = 2;
-			///end
 		}
 
 		ui_end_menu();
@@ -147,13 +132,8 @@ 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
 	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
-	let ww: i32 = iron_window_width() - ui_menubar_w - nodesw;
-	panel_x = (sys_x()) + ui_menubar_w;
-	///end
 
 	if (ui_window(ui_menubar_workspace_handle, panel_x, 0, ww, ui_header_h)) {
 
@@ -163,65 +143,6 @@ function ui_menubar_draw_tab_header() {
 		else {
 			ui_fill(0, 0, ui._window_w, ui._window_h + 4, ui.ops.theme.SEPARATOR_COL);
 		}
-
-		///if is_lab
-		ui_tab(ui_header_worktab, tr("2D View"));
-		if (ui_header_worktab.changed) {
-			context_raw.ddirty = 2;
-			context_raw.brush_blend_dirty = true;
-			ui_header_handle.redraws = 2;
-			context_main_object().skip_context = null;
-
-			if (ui_header_worktab.position == space_type_t.SPACE3D) {
-				if (!mat4_isnan(_ui_menubar_saved_camera)) {
-					transform_set_matrix(scene_camera.base.transform, _ui_menubar_saved_camera);
-					_ui_menubar_saved_camera = mat4_nan();
-				}
-				scene_meshes = [context_main_object()];
-			}
-			else { // Space2D
-				if (_ui_menubar_plane == null) {
-					let mesh: raw_mesh_t = geom_make_plane(1, 1, 2, 2);
-					let raw: mesh_data_t = {
-						name: "2DView",
-						vertex_arrays: [
-							{
-								values: mesh.posa,
-								attrib: "pos",
-								data: "short4norm"
-							},
-							{
-								values: mesh.nora,
-								attrib: "nor",
-								data: "short2norm"
-							},
-							{
-								values: mesh.texa,
-								attrib: "tex",
-								data: "short2norm"
-							}
-						],
-						index_array: mesh.inda,
-						scale_pos: mesh.scale_pos,
-						scale_tex: mesh.scale_tex
-					};
-					let md: mesh_data_t = mesh_data_create(raw);
-					let dot_plane: mesh_object_t = scene_get_child(".Plane").ext;
-					_ui_menubar_plane = mesh_object_create(md, dot_plane.materials);
-					array_remove(scene_meshes, _ui_menubar_plane);
-				}
-
-				if (mat4_isnan(_ui_menubar_saved_camera)) {
-					_ui_menubar_saved_camera = mat4_clone(scene_camera.base.transform.local);
-				}
-				scene_meshes = [_ui_menubar_plane];
-				let m: mat4_t = mat4_identity();
-				m = mat4_translate(m, 0, 0, 1.6);
-				transform_set_matrix(scene_camera.base.transform, m);
-			}
-			render_path_raytrace_ready = false;
-		}
-		///end
 	}
 }
 
@@ -256,7 +177,6 @@ function ui_menubar_draw_category_items() {
 			});
 		}
 
-		///if is_paint
 		if (ui_menu_button(tr("Import Font..."))) {
 			project_import_asset("ttf,ttc,otf");
 		}
@@ -266,13 +186,10 @@ function ui_menubar_draw_category_items() {
 		if (ui_menu_button(tr("Import Brush..."))) {
 			project_import_brush();
 		}
-		///end
 
-		///if (is_paint || is_lab)
 		if (ui_menu_button(tr("Import Swatches..."))) {
 			project_import_swatches();
 		}
-		///end
 		if (ui_menu_button(tr("Import Mesh..."))) {
 			project_import_mesh();
 		}
@@ -283,7 +200,6 @@ function ui_menubar_draw_category_items() {
 			project_reimport_textures();
 		}
 		ui_menu_separator();
-		///if (is_paint || is_lab)
 		if (ui_menu_button(tr("Export Textures..."), map_get(config_keymap, "file_export_textures_as"))) {
 			context_raw.layers_export = export_mode_t.VISIBLE;
 			box_export_show_textures();
@@ -291,17 +207,13 @@ function ui_menubar_draw_category_items() {
 		if (ui_menu_button(tr("Export Swatches..."))) {
 			project_export_swatches();
 		}
-		///end
 		if (ui_menu_button(tr("Export Mesh..."))) {
 			context_raw.export_mesh_index = 0; // All
 			box_export_show_mesh();
 		}
-
-		///if is_paint
 		if (ui_menu_button(tr("Bake Material..."))) {
 			box_export_show_bake_material();
 		}
-		///end
 
 		ui_menu_separator();
 		if (ui_menu_button(tr("Exit"))) {
@@ -379,7 +291,6 @@ function ui_menubar_draw_category_items() {
 			context_raw.ddirty = 2;
 		}
 
-		///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;
@@ -388,21 +299,6 @@ function ui_menubar_draw_category_items() {
 		if (split_view_handle.changed) {
 			base_resize();
 		}
-		///end
-
-		///if is_lab
-		let brush_scale_handle: ui_handle_t = ui_handle(__ID__);
-		if (brush_scale_handle.init) {
-			brush_scale_handle.value = context_raw.brush_scale;
-		}
-		ui_menu_align();
-		context_raw.brush_scale = ui_slider(brush_scale_handle, tr("UV Scale"), 0.01, 5.0, true);
-		if (brush_scale_handle.changed) {
-			make_material_parse_mesh_material();
-			render_path_raytrace_uv_scale = context_raw.brush_scale;
-			render_path_raytrace_ready = false;
-		}
-		///end
 
 		let cull_handle: ui_handle_t = ui_handle(__ID__);
 		if (cull_handle.init) {
@@ -422,7 +318,6 @@ function ui_menubar_draw_category_items() {
 			gpu_use_linear_sampling(context_raw.texture_filter);
 		}
 
-		///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;
@@ -431,14 +326,11 @@ function ui_menubar_draw_category_items() {
 			draw_begin(current);
 			make_material_parse_mesh_material();
 		}
-		///end
 
-		///if is_paint
 		context_raw.draw_texels = ui_check(context_raw.texels_handle, " " + tr("Texels"));
 		if (context_raw.texels_handle.changed) {
 			make_material_parse_mesh_material();
 		}
-		///end
 
 		let compass_handle: ui_handle_t = ui_handle(__ID__);
 		if (compass_handle.init) {
@@ -472,25 +364,19 @@ function ui_menubar_draw_category_items() {
 		let modes: string[] = [
 			tr("Lit"),
 			tr("Base Color"),
-			///if (is_paint || is_lab)
 			tr("Normal"),
 			tr("Occlusion"),
 			tr("Roughness"),
 			tr("Metallic"),
 			tr("Opacity"),
 			tr("Height"),
-			///end
-			///if (is_paint)
 			tr("Emission"),
 			tr("Subsurface"),
-			///end
-			///if is_paint
 			tr("TexCoord"),
 			tr("Object Normal"),
 			tr("Material ID"),
 			tr("Object ID"),
 			tr("Mask")
-			///end
 		];
 		let shortcuts: string[] = ["l", "b", "n", "o", "r", "m", "a", "h", "e", "s", "t", "1", "2", "3", "4"];
 

+ 0 - 155
base/sources/ts/ui_nodes.ts

@@ -1,11 +1,5 @@
 
-///if is_paint
 let ui_nodes_show: bool = false;
-///end
-///if is_lab
-let ui_nodes_show: bool = true;
-///end
-
 let ui_nodes_wx: i32;
 let ui_nodes_wy: i32;
 let ui_nodes_ww: i32;
@@ -125,18 +119,12 @@ function ui_viewnodes_on_link_drag(link_drag_id: i32, is_new_link: bool) {
 				link_drag.from_socket = 0;
 				array_push(ui_nodes_get_canvas(true).links, link_drag);
 			}
-			///if is_lab
-			parser_logic_parse(ui_nodes_get_canvas(true));
-			context_raw.rdirty = 5;
-			///end
 		});
 	}
 	// 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
 		context_raw.node_preview_dirty = true;
-		///end
 	}
 }
 
@@ -257,9 +245,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
 			context_raw.node_preview_dirty = true;
-			///end
 		}
 	}
 }
@@ -303,9 +289,7 @@ function ui_viewnodes_on_canvas_released() {
 
 				ui._y += 1;
 				let is_protected: bool = selected == null ||
-					///if is_paint
 					selected.type == "OUTPUT_MATERIAL_PBR" ||
-					///end
 					selected.type == "GROUP_INPUT" ||
 					selected.type == "GROUP_OUTPUT" ||
 					selected.type == "brush_output_node";
@@ -474,7 +458,6 @@ function ui_nodes_tab_index(): i32 {
 }
 
 function ui_nodes_get_canvas(groups: bool = false): ui_node_canvas_t {
-	///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;
@@ -489,11 +472,6 @@ function ui_nodes_get_canvas(groups: bool = false): ui_node_canvas_t {
 	else {
 		return context_raw.brush.canvas;
 	}
-	///end
-
-	///if is_lab
-	return project_canvas;
-	///end
 }
 
 function ui_nodes_get_canvas_material(): ui_node_canvas_t {
@@ -501,7 +479,6 @@ function ui_nodes_get_canvas_material(): ui_node_canvas_t {
 }
 
 function ui_nodes_get_nodes(): ui_nodes_t {
-	///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;
@@ -516,16 +493,6 @@ function ui_nodes_get_nodes(): ui_nodes_t {
 	else {
 		return context_raw.brush.nodes;
 	}
-	///end
-
-	///if is_lab
-	if (ui_nodes_group_stack.length > 0) {
-		return ui_nodes_group_stack[ui_nodes_group_stack.length - 1].nodes;
-	}
-	else {
-		return project_nodes;
-	}
-	///end
 }
 
 function ui_nodes_update() {
@@ -533,12 +500,7 @@ function ui_nodes_update() {
 		return;
 	}
 
-	///if is_paint
 	ui_nodes_wx = math_floor(sys_w()) + ui_toolbar_w(true);
-	///end
-	///if is_lab
-	ui_nodes_wx = math_floor(sys_w());
-	///end
 	ui_nodes_wy = ui_header_h * 2;
 
 	if (ui_view2d_show) {
@@ -547,10 +509,8 @@ function ui_nodes_update() {
 
 	let ww: i32 = config_raw.layout[layout_size_t.NODES_W];
 	if (!ui_base_show) {
-		///if is_paint
 		ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true);
 		ui_nodes_wx -= ui_toolbar_w(true);
-		///end
 		ui_nodes_wy = 0;
 	}
 
@@ -650,12 +610,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
 		let node_list: node_list_t[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_list : nodes_brush_list;
-		///end
-		///if is_lab
-		let node_list: node_list_t[] = nodes_brush_list;
-		///end
 
 		for (let i: i32 = 0; i < node_list.length; ++i) {
 			let list: ui_node_t[] = node_list[i];
@@ -672,10 +627,6 @@ function ui_nodes_node_search(x: i32 = -1, y: i32 = -1, done: ()=>void = null) {
 						nodes.nodes_selected_id = [ui_nodes_node_search_spawn.id];
 						nodes.nodes_drag = true;
 
-						///if is_lab
-						parser_logic_parse(canvas);
-						///end
-
 						ui_nodes_hwnd.redraws = 2;
 						if (enter) {
 							ui.changed = true;
@@ -714,11 +665,9 @@ 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
 	if (!ui_base_show) {
 		ww += config_raw.layout[layout_size_t.SIDEBAR_W] + ui_toolbar_w(true);
 	}
-	///end
 
 	let wh: i32 = sys_h();
 	let step: f32 = ui_nodes_grid_cell_w * zoom;
@@ -772,7 +721,6 @@ let _ui_nodes_render_tmp: (col: i32)=>void;
 
 function ui_nodes_recompile() {
 	if (ui_nodes_recompile_mat) {
-		///if is_paint
 		if (ui_nodes_canvas_type == canvas_type_t.BRUSH) {
 			make_material_parse_brush();
 			util_render_make_brush_preview();
@@ -801,16 +749,10 @@ function ui_nodes_recompile() {
 		if (context_raw.split_view) {
 			context_raw.ddirty = 2;
 		}
-		///end
-
-		///if is_lab
-		parser_logic_parse(project_canvas);
-		///end
 
 		ui_nodes_recompile_mat = false;
 	}
 	else if (ui_nodes_recompile_mat_final) {
-		///if is_paint
 		make_material_parse_paint_material();
 
 		if (ui_nodes_canvas_type == canvas_type_t.MATERIAL && layers_is_fill_material()) {
@@ -825,7 +767,6 @@ function ui_nodes_recompile() {
 
 		ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2;
 		context_raw.node_preview_dirty = true;
-		///end
 
 		ui_nodes_recompile_mat_final = false;
 	}
@@ -838,13 +779,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
 		context_raw.node_preview_dirty = true;
-		///end
-		///if is_lab
-		context_raw.ddirty = 2; // Show selected node texture in viewport
-		ui_header_handle.redraws = 2;
-		///end
 		context_raw.node_preview_socket = 0;
 	}
 
@@ -871,33 +806,22 @@ function ui_nodes_render() {
 		ui_nodes_grid_redraw = false;
 	}
 
-	///if is_paint
 	if (config_raw.node_preview && context_raw.node_preview_dirty) {
 		ui_nodes_make_node_preview();
 	}
-	///end
 
 	// Start with UI
 	ui_begin(ui);
 
 	// Make window
 	ui_nodes_ww = config_raw.layout[layout_size_t.NODES_W];
-
-	///if is_paint
 	ui_nodes_wx = math_floor(sys_w()) + ui_toolbar_w(true);
-	///end
-	///if is_lab
-	ui_nodes_wx = math_floor(sys_w());
-	///end
-
 	ui_nodes_wy = 0;
 
-	///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);
 	}
-	///end
 
 	let ew: i32 = math_floor(UI_ELEMENT_W() * 0.7);
 	ui_nodes_wh = sys_h();
@@ -936,11 +860,9 @@ function ui_nodes_render() {
 				}
 			}
 
-			///if is_paint
 			if (ui_tab(ui_nodes_htab, tr("+"))) {
 				array_push(ui_nodes_tabs, context_raw.material);
 			}
-			///end
 		}
 
 		// Grid
@@ -960,9 +882,7 @@ function ui_nodes_render() {
 		let header_h: i32 = UI_ELEMENT_H() * 2 + UI_ELEMENT_OFFSET() * 2;
 		let header_hover: bool = ui.input_y < ui._window_y + header_h;
 		ui.input_enabled = _input_enabled && !ui_nodes_show_menu && !header_hover;
-		///if is_paint
 		ui.window_border_right = config_raw.layout[layout_size_t.SIDEBAR_W];
-		///end
 		ui.window_border_top = ui_header_h * 2;
 		ui.window_border_bottom = config_raw.layout[layout_size_t.STATUS_H];
 
@@ -978,13 +898,7 @@ function ui_nodes_render() {
 				_ui_nodes_render_tmp(color.base);
 				ui_nodes_hwnd.redraws = 2;
 
-				///if is_paint
 				let material_live: bool = config_raw.material_live;
-				///end
-				///if is_lab
-				let material_live: bool = true;
-				///end
-
 				if (material_live) {
 					ui_nodes_canvas_changed();
 				}
@@ -994,12 +908,7 @@ function ui_nodes_render() {
 
 		// Remove nodes with unknown id for this canvas type
 		if (ui_is_paste) {
-			///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
-			let node_list: node_list_t[] = nodes_brush_list;
-			///end
 
 			let i: i32 = 0;
 			while (i++ < c.nodes.length) {
@@ -1041,12 +950,7 @@ function ui_nodes_render() {
 
 		// Recompile material on change
 		if (ui.changed) {
-			///if is_paint
 			ui_nodes_recompile_mat = (ui.input_dx != 0 || ui.input_dy != 0 || !ui_nodes_uichanged_last) && config_raw.material_live; // Instant preview
-			///end
-			///if is_lab
-			ui_nodes_recompile_mat = (ui.input_dx != 0 || ui.input_dy != 0 || !ui_nodes_uichanged_last); // Instant preview
-			///end
 		}
 		else if (ui_nodes_uichanged_last) {
 			ui_nodes_canvas_changed();
@@ -1059,15 +963,11 @@ 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
-
 			let single_channel: bool = sel.type == "LAYER_MASK";
 			if (sel.type == "LAYER" || sel.type == "LAYER_MASK") {
 				let id: i32 = sel.buttons[0].default_value[0];
 				if (id < project_layers.length) {
-					///if is_paint
 					img = project_layers[id].texpaint_preview;
-					///end
 				}
 			}
 			else if (sel.type == "MATERIAL") {
@@ -1086,40 +986,25 @@ function ui_nodes_render() {
 				img = context_raw.node_preview;
 			}
 
-			///else
-
-			let brush_node: logic_node_ext_t = parser_logic_get_logic_node(sel);
-			if (brush_node != null) {
-				img = logic_node_get_cached_image(brush_node.base);
-			}
-
-			///end
-
 			if (img != null) {
 				let tw: f32 = 128 * UI_SCALE();
 				let th: f32 = tw * (img.height / img.width);
 				let tx: f32 = ui_nodes_ww - tw - 8 * UI_SCALE();
 				let ty: f32 = ui_nodes_wh - th - 8 * UI_SCALE();
-
 				let invert_y: bool = false;
-
-				///if is_paint
 				if (single_channel) {
 					draw_set_pipeline(ui_view2d_pipe);
 					gpu_set_int(ui_view2d_channel_loc, 1);
 				}
-				///end
 
 				draw_set_color(0xffffffff);
 				invert_y ?
 					draw_scaled_image(img, tx, ty + th, tw, -th) :
 					draw_scaled_image(img, tx, ty, tw, th);
 
-				///if is_paint
 				if (single_channel) {
 					draw_set_pipeline(null);
 				}
-				///end
 			}
 		}
 
@@ -1133,22 +1018,10 @@ function ui_nodes_render() {
 	ui_end();
 
 	if (ui_nodes_show_menu) {
-		///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
-		let list: node_list_t[] = nodes_brush_list;
-		///end
-
 		let category: ui_node_t[] = list[ui_nodes_menu_category];
 		let num_nodes: i32 = category.length;
-
-		///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
-		let is_group_category: bool = nodes_material_categories[ui_nodes_menu_category] == "Group";
-		///end
 
 		if (is_group_category) {
 			num_nodes += project_material_groups.length;
@@ -1182,9 +1055,6 @@ function ui_nodes_render() {
 				array_push(canvas.nodes, node);
 				nodes.nodes_selected_id = [node.id];
 				nodes.nodes_drag = true;
-				///if is_lab
-				parser_logic_parse(canvas);
-				///end
 			}
 			// Next column
 			if (ui._y - ui_nodes_wy + UI_ELEMENT_H() / 2 > ui_nodes_wh) {
@@ -1208,13 +1078,11 @@ function ui_nodes_render() {
 					nodes.nodes_drag = true;
 				}
 
-				///if is_paint
 				ui.enabled = !project_is_material_group_in_use(g);
 				if (ui_button("x", ui_align_t.CENTER)) {
 					history_delete_material_group(g);
 					array_remove(project_material_groups, g);
 				}
-				///end
 
 				ui.enabled = true;
 			}
@@ -1252,7 +1120,6 @@ function ui_nodes_draw_menubar() {
 	ui._y = 2 + start_y;
 	ui._w = ew;
 
-	///if is_paint
 	// Editable canvas name
 	let h: ui_handle_t = ui_handle(__ID__);
 	h.text = c.name;
@@ -1299,22 +1166,11 @@ function ui_nodes_draw_menubar() {
 			c.name = new_name;
 		}
 	}
-	///end
-
-	///if is_lab
-	ui.window_border_top = 0;
-	ui_nodes_ext_draw_buttons(ew, start_y);
-	///end
 
 	let _BUTTON_COL: i32 = ui.ops.theme.BUTTON_COL;
 	ui.ops.theme.BUTTON_COL = ui.ops.theme.SEPARATOR_COL;
 
-	///if is_paint
 	let cats: string[] = ui_nodes_canvas_type == canvas_type_t.MATERIAL ? nodes_material_categories : nodes_brush_categories;
-	///end
-	///if is_lab
-	let cats: string[] = nodes_brush_categories;
-	///end
 
 	for (let i: i32 = 0; i < cats.length; ++i) {
 		if ((_ui_menu_button(tr(cats[i]))) || (ui.is_hovered && ui_nodes_show_menu)) {
@@ -1421,22 +1277,13 @@ 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
 	let n: ui_node_t =
 		ui_nodes_canvas_type == canvas_type_t.MATERIAL ?
 			nodes_material_create_node("TEX_IMAGE", g) :
 			nodes_brush_create_node("TEX_IMAGE");
-	///end
-	///if is_lab
-	let n: ui_node_t = nodes_brush_create_node("image_texture_node");
-	///end
 
 	n.buttons[0].default_value[0] = index;
 	ui_nodes_get_nodes().nodes_selected_id = [n.id];
-
-	///if is_lab
-	parser_logic_parse(project_canvas);
-	///end
 }
 
 function ui_nodes_accept_layer_drag(index: i32) {
@@ -1459,7 +1306,6 @@ function ui_nodes_accept_material_drag(index: i32) {
 }
 
 function ui_nodes_accept_swatch_drag(swatch: swatch_color_t) {
-	///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);
@@ -1470,7 +1316,6 @@ function ui_nodes_accept_swatch_drag(swatch: swatch_color_t) {
 		color_get_ab(swatch.base) / 255
 	);
 	ui_nodes_get_nodes().nodes_selected_id = [n.id];
-	///end
 }
 
 function ui_nodes_make_node(n: ui_node_t, nodes: ui_nodes_t, canvas: ui_node_canvas_t): ui_node_t {

+ 0 - 5
base/sources/ts/ui_status.ts

@@ -5,12 +5,7 @@ function ui_status_init() {
 }
 
 function ui_status_width(): i32 {
-	///if is_paint
 	return iron_window_width() - ui_toolbar_w(true) - config_raw.layout[layout_size_t.SIDEBAR_W];
-	///end
-	///if is_lab
-	return iron_window_width();
-	///end
 }
 
 function ui_status_render_ui() {

+ 0 - 7
base/sources/ts/ui_toolbar.ts

@@ -1,10 +1,5 @@
 
-///if is_lab
-let ui_toolbar_default_w: i32 = 0;
-///else
 let ui_toolbar_default_w: i32 = 36;
-///end
-
 let ui_toolbar_handle: ui_handle_t = ui_handle_create();
 let ui_toolbar_last_tool: i32 = 0;
 let ui_toolbar_tool_names: string[] = [
@@ -60,12 +55,10 @@ function ui_toolbar_draw_tool(i: i32, img: gpu_texture_t, icon_accent: i32, keys
 		ui_toolbar_last_tool = i;
 	}
 
-	///if is_paint
 	if (i == tool_type_t.COLORID && context_raw.colorid_picked) {
 		let rt: render_target_t = map_get(render_path_render_targets, "texpaint_colorid");
 		draw_scaled_sub_image(rt._image, 0, 0, 1, 1, 0, _y + 1.5 * UI_SCALE(), 5 * UI_SCALE(), 34 * UI_SCALE());
 	}
-	///end
 
 	if (ui.is_hovered) {
 		ui_tooltip(tr(ui_toolbar_tool_names[i]) + " " + keys[i]);

+ 0 - 69
base/sources/ts/ui_view2d.ts

@@ -5,11 +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
 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;
-///end
 let ui_view2d_show: bool = false;
 let ui_view2d_wx: i32;
 let ui_view2d_wy: i32;
@@ -30,7 +26,6 @@ let ui_view2d_grid: gpu_texture_t = null;
 let ui_view2d_grid_redraw: bool = true;
 
 function ui_view2d_init() {
-	///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");
@@ -46,38 +41,26 @@ function ui_view2d_init() {
 	pipes_get_constant_location("float4");
 	pipes_get_constant_location("float4");
 	ui_view2d_channel_loc = pipes_get_constant_location("int");
-	///end
 
 	// ui.scroll_enabled = false;
 }
 
 function ui_view2d_draw_image(image: gpu_texture_t, dx: f32, dy: f32, dw: f32, dh: f32, channel: i32) {
-	///if is_paint
 	if (ui_view2d_type == view_2d_type_t.LAYER) {
 		gpu_set_int(ui_view2d_channel_loc, channel);
 	}
-	///end
 	draw_scaled_image(image, dx, dy, dw, dh);
 }
 
 function ui_view2d_render() {
-
 	ui_view2d_ww = config_raw.layout[layout_size_t.NODES_W];
-
-	///if is_paint
 	ui_view2d_wx = math_floor(sys_w()) + ui_toolbar_w(true);
-	///else
-	ui_view2d_wx = math_floor(sys_w());
-	///end
-
 	ui_view2d_wy = 0;
 
-	///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);
 	}
-	///end
 
 	if (!ui_view2d_show) {
 		return;
@@ -97,18 +80,14 @@ function ui_view2d_render() {
 	}
 
 	// Ensure UV map is drawn
-	///if is_paint
 	if (ui_view2d_uvmap_show) {
 		util_uv_cache_uv_map();
 	}
-	///end
 
 	// Ensure font image is drawn
-	///if is_paint
 	if (context_raw.font.image == null) {
 		util_render_make_font_preview();
 	}
-	///end
 
 	ui_begin(ui);
 
@@ -148,22 +127,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
-
 			tex = context_raw.node_preview;
-
-			///else
-
-			let nodes: ui_nodes_t = ui_nodes_get_nodes();
-			if (nodes.nodes_selected_id.length > 0) {
-				let sel: ui_node_t = ui_get_node(ui_nodes_get_canvas(true).nodes, nodes.nodes_selected_id[0]);
-				let brush_node: logic_node_ext_t = parser_logic_get_logic_node(sel);
-				if (brush_node != null) {
-					tex = logic_node_get_cached_image(brush_node.base);
-				}
-			}
-
-			///end
 		}
 		else if (ui_view2d_type == view_2d_type_t.LAYER) {
 			let layer: slot_layer_t = l;
@@ -212,12 +176,9 @@ function ui_view2d_render() {
 		if (tex != null) {
 			th = tw * (tex.height / tex.width);
 			ty = apph / 2 - th / 2 + ui_view2d_pan_y;
-
-			///if is_paint
 			if (ui_view2d_type == view_2d_type_t.LAYER) {
 				draw_set_pipeline(ui_view2d_pipe);
 			}
-			///end
 
 			ui_view2d_draw_image(tex, tx, ty, tw, th, channel);
 			if (ui_view2d_tiled_show) {
@@ -231,7 +192,6 @@ function ui_view2d_render() {
 				ui_view2d_draw_image(tex, tx, ty + th, tw, th, channel);
 			}
 
-			///if is_paint
 			if (ui_view2d_type == view_2d_type_t.LAYER) {
 				draw_set_pipeline(null);
 			}
@@ -267,15 +227,12 @@ function ui_view2d_render() {
 					ui_header_handle.redraws = 2;
 				});
 			}
-			///end
 		}
 
-		///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);
 		}
-		///end
 
 		// Menu
 		let ew: i32 = math_floor(UI_ELEMENT_W());
@@ -290,12 +247,7 @@ function ui_view2d_render() {
 
 		// Editable layer name
 		let h: ui_handle_t = ui_handle(__ID__);
-
-		///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;
-		///end
 
 		ui._w = math_floor(math_min(draw_string_width(ui.ops.font, ui.font_size, text) + 15 * UI_SCALE(), 100 * UI_SCALE()));
 
@@ -310,20 +262,8 @@ function ui_view2d_render() {
 			}
 		}
 		else if (ui_view2d_type == view_2d_type_t.NODE) {
-			///if is_paint
-
 			ui_text(context_raw.node_preview_name);
-
-			///else
-
-			let nodes: ui_nodes_t = ui_nodes_get_nodes();
-			if (nodes.nodes_selected_id.length > 0) {
-				ui_text(ui_get_node(ui_nodes_get_canvas(true).nodes, nodes.nodes_selected_id[0]).name);
-			}
-
-			///end
 		}
-		///if is_paint
 		else if (ui_view2d_type == view_2d_type_t.LAYER) {
 			h.text = l.name;
 			l.name = ui_text_input(h, "");
@@ -333,7 +273,6 @@ function ui_view2d_render() {
 			h.text = context_raw.font.name;
 			context_raw.font.name = ui_text_input(h, "");
 		}
-		///end
 
 		if (h.changed) {
 			ui_base_hwnds[0].redraws = 2;
@@ -342,7 +281,6 @@ function ui_view2d_render() {
 		ui._y = 2 + start_y;
 		ui._w = ew;
 
-		///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) {
@@ -381,7 +319,6 @@ function ui_view2d_render() {
 			ui._x += ew * 0.7 + 3;
 			ui._y = 2 + start_y;
 		}
-		///end
 
 		let h_tiled_show: ui_handle_t = ui_handle(__ID__);
 		if (h_tiled_show.init) {
@@ -396,14 +333,12 @@ function ui_view2d_render() {
 		}
 
 		// Picked position
-		///if is_paint
 		if (context_raw.tool == tool_type_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();
 			let size: f32 = hsize * 2;
 			draw_scaled_image(cursor_img, tx + tw * context_raw.uvx_picked - hsize, ty + th * context_raw.uvy_picked - hsize, size, size);
 		}
-		///end
 	}
 	ui_end();
 }
@@ -411,9 +346,7 @@ function ui_view2d_render() {
 function ui_view2d_update() {
 	let headerh: f32 = UI_ELEMENT_H() * 1.4;
 
-	///if is_paint
 	context_raw.paint2d = false;
-	///end
 
 	if (!base_ui_enabled ||
 		!ui_view2d_show ||
@@ -453,7 +386,6 @@ function ui_view2d_update() {
 		ui_view2d_grid_redraw = true;
 	}
 
-	///if is_paint
 	let decal_mask: bool = context_is_decal_mask_paint();
 	let set_clone_source: bool = context_raw.tool == tool_type_t.CLONE &&
 		operator_shortcut(map_get(config_keymap, "set_clone_source") + "+" + map_get(config_keymap, "action_paint"), shortcut_type_t.DOWN);
@@ -492,7 +424,6 @@ function ui_view2d_update() {
 			context_raw.paint2d = true;
 		}
 	}
-	///end
 
 	if (ui.is_typing) {
 		return;

+ 0 - 47
base/sources/ts/uniforms_ext.ts

@@ -20,7 +20,6 @@ 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
 		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;
@@ -40,16 +39,6 @@ function uniforms_ext_f32_link(object: object_t, mat: material_data_t, link: str
 		else {
 			val *= scale2d; // Projection ratio
 		}
-		///end
-
-		///if is_lab
-		let radius: f32 = context_raw.brush_radius;
-		let val: f32 = radius / 15.0;
-		if (config_raw.pressure_radius && pen_down()) {
-			val *= pen_pressure * config_raw.pressure_sensitivity;
-		}
-		val *= 2;
-		///end
 
 		return val;
 	}
@@ -322,28 +311,16 @@ function uniforms_ext_mat4_link(object: object_t, mat: material_data_t, link: st
 
 function uniforms_ext_tex_link(object: object_t, mat: material_data_t, link: string): gpu_texture_t {
 	if (link == "_texpaint_undo") {
-		///if is_lab
-		return null;
-		///end
-
 		let i: i32 = history_undo_i - 1 < 0 ? config_raw.undo_steps - 1 : history_undo_i - 1;
 		let rt: render_target_t = map_get(render_path_render_targets, "texpaint_undo" + i);
 		return rt._image;
 	}
 	else if (link == "_texpaint_nor_undo") {
-		///if is_lab
-		return null;
-		///end
-
 		let i: i32 = history_undo_i - 1 < 0 ? config_raw.undo_steps - 1 : history_undo_i - 1;
 		let rt: render_target_t = map_get(render_path_render_targets, "texpaint_nor_undo" + i);
 		return rt._image;
 	}
 	else if (link == "_texpaint_pack_undo") {
-		///if is_lab
-		return null;
-		///end
-
 		let i: i32 = history_undo_i - 1 < 0 ? config_raw.undo_steps - 1 : history_undo_i - 1;
 		let rt: render_target_t = map_get(render_path_render_targets, "texpaint_pack_undo" + i);
 		return rt._image;
@@ -404,44 +381,20 @@ function uniforms_ext_tex_link(object: object_t, mat: material_data_t, link: str
 	}
 
 	if (starts_with(link, "_texpaint_vert")) {
-		///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
-
-		///if is_lab
-		return context_raw.brush_output_node_inst.texpaint;
-		///end
 	}
 	if (starts_with(link, "_texpaint_nor")) {
-		///if is_paint
 		let tid: i32 = parse_int(substring(link, link.length - 1, link.length));
 		return tid < project_layers.length ? project_layers[tid].texpaint_nor : null;
-		///end
-
-		///if is_lab
-		return context_raw.brush_output_node_inst.texpaint_nor;
-		///end
 	}
 	if (starts_with(link, "_texpaint_pack")) {
-		///if is_paint
 		let tid: i32 = parse_int(substring(link, link.length - 1, link.length));
 		return tid < project_layers.length ? project_layers[tid].texpaint_pack : null;
-		///end
-
-		///if is_lab
-		return context_raw.brush_output_node_inst.texpaint_pack;
-		///end
 	}
 	if (starts_with(link, "_texpaint")) {
-		///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
-
-		///if is_lab
-		return context_raw.brush_output_node_inst.texpaint;
-		///end
 	}
 	if (starts_with(link, "_texblur_")) {
 		let id: string = substring(link, 9, link.length);

+ 0 - 13
base/sources/ts/util_encode.ts

@@ -171,7 +171,6 @@ function util_encode_project(raw: project_format_t): buffer_t {
 		armpack_encode_null();
 	}
 
-	///if is_paint
 	armpack_encode_string("brush_nodes");
 	if (raw.brush_nodes != null) {
 		armpack_encode_array(raw.brush_nodes.length);
@@ -263,7 +262,6 @@ function util_encode_project(raw: project_format_t): buffer_t {
 			armpack_encode_i32(raw.layer_datas[i].parent);
 			armpack_encode_string("visible");
 			armpack_encode_bool(raw.layer_datas[i].visible);
-			///if is_paint
 			armpack_encode_string("texpaint_nor");
 			armpack_encode_array_u8(raw.layer_datas[i].texpaint_nor);
 			armpack_encode_string("texpaint_pack");
@@ -290,7 +288,6 @@ function util_encode_project(raw: project_format_t): buffer_t {
 			armpack_encode_bool(raw.layer_datas[i].paint_emis);
 			armpack_encode_string("paint_subs");
 			armpack_encode_bool(raw.layer_datas[i].paint_subs);
-			///end
 		}
 	}
 	else {
@@ -312,21 +309,11 @@ function util_encode_project(raw: project_format_t): buffer_t {
 	else {
 		armpack_encode_null();
 	}
-	///end
 
-	///if is_paint
 	armpack_encode_string("atlas_objects");
 	armpack_encode_array_i32(raw.atlas_objects);
 	armpack_encode_string("atlas_names");
 	armpack_encode_array_string(raw.atlas_names);
-	///end
-
-	///if is_lab
-	// material?: ui_node_canvas_t;
-	// material_groups?: ui_node_canvas_t[];
-	// mesh_data?: mesh_data_t;
-	// mesh_icon?: buffer_t;
-	///end
 
 	let ei: i32 = armpack_encode_end();
 	encoded.length = ei;

+ 0 - 1
paint/project.js

@@ -5,7 +5,6 @@ flags.package = "org.armorpaint";
 flags.with_video_write = true;
 
 let project = new Project(flags.name);
-project.add_define("is_paint");
 project.add_project("../base");
 
 project.add_tsfiles("sources");

+ 0 - 4
paint/sources/make_paint.ts

@@ -1,6 +1,4 @@
 
-///if is_paint
-
 function make_paint_is_raytraced_bake(): bool {
 	return context_raw.bake_type == bake_type_t.INIT;
 }
@@ -514,5 +512,3 @@ function make_paint_run(data: material_t, matcon: material_context_t): node_shad
 
 	return con_paint;
 }
-
-///end