luboslenco пре 1 година
родитељ
комит
50c41be64b

+ 2 - 2
armorlab/Sources/nodes/ImageTextureNode.ts

@@ -35,7 +35,7 @@ class ImageTextureNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			}
 		],
 		outputs: [
@@ -45,7 +45,7 @@ class ImageTextureNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			},
 			{
 				id: 0,

+ 2 - 2
armorlab/Sources/nodes/InpaintNode.ts

@@ -188,7 +188,7 @@ class InpaintNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([1.0, 1.0, 1.0, 1.0])
+				default_value: new Float32Array([1.0, 1.0, 1.0, 1.0])
 			}
 		],
 		outputs: [
@@ -198,7 +198,7 @@ class InpaintNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		buttons: [

+ 2 - 2
armorlab/Sources/nodes/PhotoToPBRNode.ts

@@ -183,7 +183,7 @@ class PhotoToPBRNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		outputs: [
@@ -193,7 +193,7 @@ class PhotoToPBRNode extends LogicNode {
 				name: _tr("Base Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			},
 			{
 				id: 0,

+ 2 - 2
armorlab/Sources/nodes/RGBNode.ts

@@ -46,7 +46,7 @@ class RGBNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+				default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 			}
 		],
 		buttons: [
@@ -54,7 +54,7 @@ class RGBNode extends LogicNode {
 				name: _tr("default_value"),
 				type: "RGBA",
 				output: 0,
-				default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+				default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 			}
 		]
 	};

+ 1 - 1
armorlab/Sources/nodes/TextToPhotoNode.ts

@@ -257,7 +257,7 @@ class TextToPhotoNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		buttons: [

+ 2 - 2
armorlab/Sources/nodes/TilingNode.ts

@@ -100,7 +100,7 @@ class TilingNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		outputs: [
@@ -110,7 +110,7 @@ class TilingNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		buttons: [

+ 2 - 2
armorlab/Sources/nodes/UpscaleNode.ts

@@ -134,7 +134,7 @@ class UpscaleNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		outputs: [
@@ -144,7 +144,7 @@ class UpscaleNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		buttons: []

+ 2 - 2
armorlab/Sources/nodes/VarianceNode.ts

@@ -90,7 +90,7 @@ class VarianceNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			},
 			{
 				id: 0,
@@ -108,7 +108,7 @@ class VarianceNode extends LogicNode {
 				name: _tr("Color"),
 				type: "RGBA",
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			}
 		],
 		buttons: [

+ 1 - 1
armorpaint/Assets/plugins/embed/import_fbx.js

@@ -19,7 +19,7 @@ let import_fbx = function(path, done) {
 		let posa = new Int16Array(r.buffer, a._get_positions(), vertex_count * 4);
 		let nora = new Int16Array(r.buffer, a._get_normals(), vertex_count * 2);
 		let texa = a._get_uvs() > 0 ? new Int16Array(r.buffer, a._get_uvs(), vertex_count * 2) : null;
-		let cola = a._get_colors() > 0 ? new Int16Array(r.buffer, a._get_colors(), vertex_count * 4) : null;
+		let cola = a._get_colors() > 0 ? new Int16Array(r.buffer, a._get_colors(), vertex_count * 3) : null;
 
 		// Use .slice() for now as the next mesh will overwrite buffer data corrupting the old vertex data
 		done({

+ 5 - 7
armorpaint/Plugins/Sources/io_fbx/io_fbx.c

@@ -60,7 +60,7 @@ void io_fbx_parse_mesh(ufbx_mesh *mesh) {
 	float *posa32 = (float *)malloc(sizeof(float) * numtri * 3 * 3);
 	float *nora32 = (float *)malloc(sizeof(float) * numtri * 3 * 3);
 	float *texa32 = has_tex ? (float *)malloc(sizeof(float) * numtri * 3 * 2) : NULL;
-	float *cola32 = has_col ? (float *)malloc(sizeof(float) * numtri * 3 * 4) : NULL;
+	float *cola32 = has_col ? (float *)malloc(sizeof(float) * numtri * 3 * 3) : NULL;
 	int pi = 0;
 	int ni = 0;
 	int ti = 0;
@@ -89,7 +89,6 @@ void io_fbx_parse_mesh(ufbx_mesh *mesh) {
 				cola32[ci++] = ufbx_get_vertex_vec4(&mesh->vertex_color, a).x;
 				cola32[ci++] = ufbx_get_vertex_vec4(&mesh->vertex_color, a).y;
 				cola32[ci++] = ufbx_get_vertex_vec4(&mesh->vertex_color, a).z;
-				cola32[ci++] = ufbx_get_vertex_vec4(&mesh->vertex_color, a).w;
 			}
 		}
 	}
@@ -155,13 +154,12 @@ void io_fbx_parse_mesh(ufbx_mesh *mesh) {
 	else texaOff = 0;
 
 	if (cola32 != NULL) {
-		colaOff = allocate(sizeof(short) * vertex_count * 4);
+		colaOff = allocate(sizeof(short) * vertex_count * 3);
 		short *cola = (short *)&buffer[colaOff];
 		for (int i = 0; i < vertex_count; ++i) {
-			cola[i * 4    ] = cola32[i * 4    ] * 32767;
-			cola[i * 4 + 1] = cola32[i * 4 + 1] * 32767;
-			cola[i * 4 + 2] = cola32[i * 4 + 2] * 32767;
-			cola[i * 4 + 3] = cola32[i * 4 + 3] * 32767;
+			cola[i * 3    ] = cola32[i * 3    ] * 32767;
+			cola[i * 3 + 1] = cola32[i * 3 + 1] * 32767;
+			cola[i * 3 + 2] = cola32[i * 3 + 2] * 32767;
 		}
 		free(cola32);
 	}

+ 2 - 2
armorpaint/Sources/nodes/TEX_IMAGE.ts

@@ -28,7 +28,7 @@ class TEX_IMAGE extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			}
 		],
 		outputs: [
@@ -38,7 +38,7 @@ class TEX_IMAGE extends LogicNode {
 				name: _tr("Color"),
 				type: "VALUE", // Match brush output socket type
 				color: 0xffc7c729,
-				default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 			},
 			{
 				id: 0,

+ 114 - 120
base/Sources/NodesMaterial.ts

@@ -21,7 +21,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -29,7 +29,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -62,7 +62,7 @@ class NodesMaterial {
 						name: _tr("View Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -107,7 +107,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -137,7 +137,7 @@ class NodesMaterial {
 						name: _tr("Position"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -145,7 +145,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -153,7 +153,7 @@ class NodesMaterial {
 						name: _tr("Tangent"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -161,7 +161,7 @@ class NodesMaterial {
 						name: _tr("True Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -169,7 +169,7 @@ class NodesMaterial {
 						name: _tr("Incoming"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -177,7 +177,7 @@ class NodesMaterial {
 						name: _tr("Parametric"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -221,7 +221,7 @@ class NodesMaterial {
 						name: _tr("Base Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -261,7 +261,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					},
 					{
 						id: 0,
@@ -346,7 +346,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -384,7 +384,7 @@ class NodesMaterial {
 						name: _tr("Base Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -424,7 +424,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					},
 					{
 						id: 0,
@@ -475,7 +475,7 @@ class NodesMaterial {
 						name: _tr("Location"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -483,7 +483,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -527,7 +527,7 @@ class NodesMaterial {
 						name: _tr("Base Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -567,7 +567,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					},
 					{
 						id: 0,
@@ -611,7 +611,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.5, 0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 0.5, 1.0])
 					}
 				],
 				buttons: [
@@ -689,7 +689,7 @@ class NodesMaterial {
 						name: _tr("Tangent"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -709,7 +709,7 @@ class NodesMaterial {
 						name: _tr("Generated"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -717,7 +717,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -725,7 +725,7 @@ class NodesMaterial {
 						name: _tr("UV"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -733,7 +733,7 @@ class NodesMaterial {
 						name: _tr("Object"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -741,7 +741,7 @@ class NodesMaterial {
 						name: _tr("Camera"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -749,7 +749,7 @@ class NodesMaterial {
 						name: _tr("Window"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -757,7 +757,7 @@ class NodesMaterial {
 						name: _tr("Reflection"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -777,7 +777,7 @@ class NodesMaterial {
 						name: _tr("UV"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -825,7 +825,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -891,7 +891,7 @@ class NodesMaterial {
 		// 				name: _tr("Base Color"),
 		// 				type: "RGBA",
 		// 				color: 0xffc7c729,
-		// 				default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+		// 				default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 		// 			},
 		// 			{
 		// 				id: 0,
@@ -931,7 +931,7 @@ class NodesMaterial {
 		// 				name: _tr("Normal Map"),
 		// 				type: "VECTOR",
 		// 				color: -10238109,
-		// 				default_value: array_f32([0.5, 0.5, 1.0])
+		// 				default_value: new Float32Array([0.5, 0.5, 1.0])
 		// 			},
 		// 			{
 		// 				id: 0,
@@ -977,7 +977,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -985,7 +985,7 @@ class NodesMaterial {
 						name: _tr("Color 1"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8])
+						default_value: new Float32Array([0.8, 0.8, 0.8])
 					},
 					{
 						id: 0,
@@ -993,7 +993,7 @@ class NodesMaterial {
 						name: _tr("Color 2"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.2, 0.2, 0.2])
+						default_value: new Float32Array([0.2, 0.2, 0.2])
 					},
 					{
 						id: 0,
@@ -1001,7 +1001,7 @@ class NodesMaterial {
 						name: _tr("Mortar"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1021,7 +1021,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1048,7 +1048,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1056,7 +1056,7 @@ class NodesMaterial {
 						name: _tr("Color 1"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8])
+						default_value: new Float32Array([0.8, 0.8, 0.8])
 					},
 					{
 						id: 0,
@@ -1064,7 +1064,7 @@ class NodesMaterial {
 						name: _tr("Color 2"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.2, 0.2, 0.2])
+						default_value: new Float32Array([0.2, 0.2, 0.2])
 					},
 					{
 						id: 0,
@@ -1084,7 +1084,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1162,7 +1162,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -1172,7 +1172,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1208,7 +1208,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -1218,7 +1218,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -1258,7 +1258,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1278,7 +1278,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1305,7 +1305,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1344,7 +1344,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1364,7 +1364,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1391,7 +1391,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1411,7 +1411,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1446,7 +1446,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1466,7 +1466,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1495,7 +1495,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1513,7 +1513,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1532,7 +1532,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1558,7 +1558,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1577,7 +1577,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1595,7 +1595,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1646,7 +1646,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				outputs: [
@@ -1656,7 +1656,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1683,7 +1683,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					}
 				],
 				outputs: [
@@ -1693,7 +1693,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1720,7 +1720,7 @@ class NodesMaterial {
 						name: _tr("Color 1"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.5, 0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 0.5, 1.0])
 					},
 					{
 						id: 0,
@@ -1728,7 +1728,7 @@ class NodesMaterial {
 						name: _tr("Color 2"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.5, 0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 0.5, 1.0])
 					}
 				],
 				outputs: [
@@ -1738,7 +1738,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: [
@@ -1781,7 +1781,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					}
 				],
 				outputs: [
@@ -1791,7 +1791,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1810,7 +1810,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -1840,7 +1840,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -1885,7 +1885,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -1895,7 +1895,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -1914,7 +1914,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -1922,7 +1922,7 @@ class NodesMaterial {
 						name: _tr("Location"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0]),
+						default_value: new Float32Array([0.0, 0.0, 0.0]),
 						display: 1
 					},
 					{
@@ -1931,7 +1931,7 @@ class NodesMaterial {
 						name: _tr("Rotation"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0]),
+						default_value: new Float32Array([0.0, 0.0, 0.0]),
 						max: 360.0,
 						display: 1
 					},
@@ -1941,7 +1941,7 @@ class NodesMaterial {
 						name: _tr("Scale"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([1.0, 1.0, 1.0]),
+						default_value: new Float32Array([1.0, 1.0, 1.0]),
 						display: 1
 					}
 				],
@@ -1952,7 +1952,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -1971,7 +1971,7 @@ class NodesMaterial {
 						name: _tr("Normal Map 1"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					},
 					{
 						id: 0,
@@ -1979,7 +1979,7 @@ class NodesMaterial {
 						name: _tr("Normal Map 2"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					}
 				],
 				outputs: [
@@ -1989,7 +1989,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					}
 				],
 				buttons: [
@@ -2016,7 +2016,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -2026,7 +2026,7 @@ class NodesMaterial {
 						name: _tr("Normal"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -2041,7 +2041,7 @@ class NodesMaterial {
 					{
 						name: _tr("Vector"),
 						type: "VECTOR",
-						default_value: array_f32([0.0, 0.0, 0.0]),
+						default_value: new Float32Array([0.0, 0.0, 0.0]),
 						output: 0
 					}
 				]
@@ -2070,7 +2070,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					}
 				],
 				outputs: [
@@ -2080,7 +2080,7 @@ class NodesMaterial {
 						name: _tr("Normal Map"),
 						type: "VECTOR",
 						color: -10238109,
-						default_value: array_f32([0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 1.0])
 					}
 				],
 				buttons: []
@@ -2107,7 +2107,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -2117,14 +2117,14 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: [
 					{
 						name: "arm.NodesMaterial.vectorCurvesButton",
 						type: "CUSTOM",
-						default_value: [[array_f32([0.0, 0.0]), array_f32([0.0, 0.0])], [array_f32([0.0, 0.0]), array_f32([0.0, 0.0])], [array_f32([0.0, 0.0]), array_f32([0.0, 0.0])]],
+						default_value: [[new Float32Array([0.0, 0.0]), new Float32Array([0.0, 0.0])], [new Float32Array([0.0, 0.0]), new Float32Array([0.0, 0.0])], [new Float32Array([0.0, 0.0]), new Float32Array([0.0, 0.0])]],
 						output: 0,
 						height: 8.5
 					}
@@ -2209,7 +2209,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 1.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 1.0])
 					},
 					{
 						id: 0,
@@ -2224,7 +2224,7 @@ class NodesMaterial {
 					{
 						name: "arm.NodesMaterial.colorRampButton",
 						type: "CUSTOM",
-						default_value: [array_f32([1.0, 1.0, 1.0, 1.0, 0.0])],
+						default_value: [new Float32Array([1.0, 1.0, 1.0, 1.0, 0.0])],
 						data: 0,
 						output: 0,
 						height: 4.5
@@ -2245,7 +2245,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -2253,7 +2253,7 @@ class NodesMaterial {
 						name: _tr("Mask Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					},
 					{
 						id: 0,
@@ -2326,7 +2326,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -2371,7 +2371,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				buttons: []
@@ -2416,7 +2416,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				buttons: []
@@ -2554,7 +2554,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.0, 0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -2583,7 +2583,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.5, 0.5, 0.5, 1.0])
+						default_value: new Float32Array([0.5, 0.5, 0.5, 1.0])
 					}
 				],
 				outputs: [
@@ -2628,7 +2628,7 @@ class NodesMaterial {
 						name: _tr("Color"),
 						type: "RGBA",
 						color: 0xffc7c729,
-						default_value: array_f32([0.8, 0.8, 0.8, 1.0])
+						default_value: new Float32Array([0.8, 0.8, 0.8, 1.0])
 					}
 				],
 				outputs: [
@@ -2673,7 +2673,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -2718,7 +2718,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -2726,7 +2726,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					}
 				],
 				outputs: [
@@ -2736,7 +2736,7 @@ class NodesMaterial {
 						name: _tr("Vector"),
 						type: "VECTOR",
 						color: 0xff6363c7,
-						default_value: array_f32([0.0, 0.0, 0.0])
+						default_value: new Float32Array([0.0, 0.0, 0.0])
 					},
 					{
 						id: 0,
@@ -2796,9 +2796,9 @@ class NodesMaterial {
 		// Edit
 		ui.row([1 / 5, 1 / 5, 3 / 5]);
 		if (ui.button("+")) {
-			let array_f32 = new Float32Array(2);
-			array_f32[0] = 0; array_f32[1] = 0;
-			val.push(array_f32);
+			let f32a = new Float32Array(2);
+			f32a[0] = 0; f32a[1] = 0;
+			val.push(f32a);
 		}
 		if (ui.button("-")) {
 			if (val.length > 2) val.pop();
@@ -2834,13 +2834,13 @@ class NodesMaterial {
 		ui.row([1 / 4, 1 / 4, 2 / 4]);
 		if (ui.button("+")) {
 			let last = vals[vals.length - 1];
-			let array_f32 = new Float32Array(5);
-			array_f32[0] = last[0];
-			array_f32[1] = last[1];
-			array_f32[2] = last[2];
-			array_f32[3] = last[3];
-			array_f32[4] = 1.0;
-			vals.push(array_f32);
+			let f32a = new Float32Array(5);
+			f32a[0] = last[0];
+			f32a[1] = last[1];
+			f32a[2] = last[2];
+			f32a[3] = last[3];
+			f32a[4] = 1.0;
+			vals.push(f32a);
 			ihandle.value += 1;
 		}
 		if (ui.button("-") && vals.length > 1) {
@@ -3008,7 +3008,7 @@ class NodesMaterial {
 	}
 
 	static get_socket_default_value = (type: string): any => {
-		return type == "RGBA" ? array_f32([0.8, 0.8, 0.8, 1.0]) : type == "VECTOR" ? array_f32([0.0, 0.0, 0.0]) : 0.0;
+		return type == "RGBA" ? new Float32Array([0.8, 0.8, 0.8, 1.0]) : type == "VECTOR" ? new Float32Array([0.0, 0.0, 0.0]) : 0.0;
 	}
 
 	static get_socket_name = (type: string): string => {
@@ -3042,10 +3042,4 @@ class NodesMaterial {
 		canvas.nodes.push(node);
 		return node;
 	}
-
-	static array_f32 = (ar: f32[]): Float32Array => {
-		let res = new Float32Array(ar.length);
-		for (let i = 0; i < ar.length; ++i) res[i] = ar[i];
-		return res;
-	}
 }

+ 0 - 6
base/Sources/ParserLogic.ts

@@ -205,10 +205,4 @@ class ParserLogic {
 		let dynamic_class = eval(`${className}`);
 		return new dynamic_class(args);
 	}
-
-	// static array_f32 = (ar: f32[]): Float32Array => {
-	// 	let res = new Float32Array(ar.length);
-	// 	for (let i = 0; i < ar.length; ++i) res[i] = ar[i];
-	// 	return res;
-	// }
 }

+ 2 - 8
base/Sources/UINodes.ts

@@ -153,14 +153,14 @@ class UINodes {
 											ui.floatInput(hval1, tr("G"));
 											ui.floatInput(hval2, tr("B"));
 											ui.floatInput(hval3, tr("A"));
-											default_value = array_f32([hval0.value, hval1.value, hval2.value, hval3.value]);
+											default_value = new Float32Array([hval0.value, hval1.value, hval2.value, hval3.value]);
 										}
 										else if (type == 1) {
 											ui.row([1 / 3, 1 / 3, 1 / 3]);
 											hval0.value = ui.floatInput(hval0, tr("X"));
 											hval1.value = ui.floatInput(hval1, tr("Y"));
 											hval2.value = ui.floatInput(hval2, tr("Z"));
-											default_value = array_f32([hval0.value, hval1.value, hval2.value]);
+											default_value = new Float32Array([hval0.value, hval1.value, hval2.value]);
 										}
 										else {
 											default_value = ui.floatInput(hval0, tr("default_value"));
@@ -213,12 +213,6 @@ class UINodes {
 		}
 	}
 
-	static array_f32 = (ar: f32[]): Float32Array => {
-		let res = new Float32Array(ar.length);
-		for (let i = 0; i < ar.length; ++i) res[i] = ar[i];
-		return res;
-	}
-
 	onCanvasReleased = () => {
 		if (this.ui.inputReleasedR && Math.abs(this.ui.inputX - this.ui.inputStartedX) < 2 && Math.abs(this.ui.inputY - this.ui.inputStartedY) < 2) {
 			// Node selection

+ 1 - 7
base/Sources/UtilParticle.ts

@@ -1,12 +1,6 @@
 
 class UtilParticle {
 
-	static array_f32 = (ar: f32[]): Float32Array => {
-		let res = new Float32Array(ar.length);
-		for (let i = 0; i < ar.length; ++i) res[i] = ar[i];
-		return res;
-	}
-
 	static initParticle = () => {
 		if (Context.raw.particleMaterial != null) return;
 
@@ -20,7 +14,7 @@ class UtilParticle {
 			lifetime: 400,
 			lifetime_random: 0.5,
 			emit_from: 1,
-			object_align_factor: array_f32([0, 0, -40]),
+			object_align_factor: new Float32Array([0, 0, -40]),
 			factor_random: 2.0,
 			physics_type: 0,
 			particle_size: 1.0,

+ 0 - 6
base/Sources/index.ts

@@ -2,9 +2,3 @@
 
 let tr = Translator.tr;
 let _tr = Translator._tr;
-
-let array_f32 = (ar: f32[]): Float32Array => {
-    let res = new Float32Array(ar.length);
-    for (let i = 0; i < ar.length; ++i) res[i] = ar[i];
-    return res;
-}

+ 1 - 1
base/Sources/nodes/SeparateVectorNode.ts

@@ -28,7 +28,7 @@ class SeparateVectorNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			}
 		],
 		outputs: [

+ 3 - 3
base/Sources/nodes/VectorMathNode.ts

@@ -148,7 +148,7 @@ class VectorMathNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			},
 			{
 				id: 0,
@@ -156,7 +156,7 @@ class VectorMathNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			}
 		],
 		outputs: [
@@ -166,7 +166,7 @@ class VectorMathNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			},
 			{
 				id: 0,

+ 1 - 1
base/Sources/nodes/VectorNode.ts

@@ -92,7 +92,7 @@ class VectorNode extends LogicNode {
 				name: _tr("Vector"),
 				type: "VECTOR",
 				color: 0xff6363c7,
-				default_value: array_f32([0.0, 0.0, 0.0])
+				default_value: new Float32Array([0.0, 0.0, 0.0])
 			}
 		],
 		buttons: []