feat: add array and sum node

This commit is contained in:
2024-04-10 23:50:41 +02:00
parent e2940183f1
commit 644bcd6997
26 changed files with 377 additions and 11 deletions

View File

@ -27,7 +27,7 @@
import { Color } from "three/src/math/Color.js";
import { CubicBezierCurve } from "three/src/extras/curves/CubicBezierCurve.js";
import { Vector2 } from "three/src/math/Vector2.js";
import { createEdgeGeometry } from "./createEdgeGeometry";
import { createEdgeGeometry } from "./createEdgeGeometry.js";
export let from: { x: number; y: number };
export let to: { x: number; y: number };

View File

@ -36,8 +36,13 @@ export async function getNode(id: `${string}/${string}/${string}`) {
const wrapper = await getNodeWasm(id);
const outputs = wrapper.get_outputs();
const inputTypes = JSON.parse(wrapper.get_input_types());
const rawInputs = wrapper.get_input_types();
try {
const inputTypes = JSON.parse(rawInputs);
return { id, outputs, inputs: inputTypes }
} catch (e) {
console.log("Failed to parse input types for node", { id, rawInputs });
}
return { id, outputs, inputs: inputTypes }
}