Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jan 20, 2024
1 parent 2863959 commit 50c41be
Show file tree
Hide file tree
Showing 19 changed files with 145 additions and 177 deletions.
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/ImageTextureNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/InpaintNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/PhotoToPBRNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/RGBNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ 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: [
{
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])
}
]
};
Expand Down
2 changes: 1 addition & 1 deletion armorlab/Sources/nodes/TextToPhotoNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/TilingNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: [
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/UpscaleNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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: []
Expand Down
4 changes: 2 additions & 2 deletions armorlab/Sources/nodes/VarianceNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion armorpaint/Assets/plugins/embed/import_fbx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
12 changes: 5 additions & 7 deletions armorpaint/Plugins/Sources/io_fbx/io_fbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions armorpaint/Sources/nodes/TEX_IMAGE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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,
Expand Down
Loading

0 comments on commit 50c41be

Please sign in to comment.