feat(web): complete Blender route runtime execution
This commit is contained in:
@@ -23,7 +23,7 @@ function uniqueId(base: string, ids: ReadonlySet<string>): string {
|
||||
|
||||
/** Build a valid bounded graph for the source-backed Principled writer. */
|
||||
export const shaderGraphCommands = Object.freeze({
|
||||
addNode(graph: ShaderGraphIR, type: ShaderNodeType, name = type): ShaderGraphIR {
|
||||
addNode(graph: ShaderGraphIR, type: ShaderNodeType, name: string = type): ShaderGraphIR {
|
||||
const next = clone(graph);
|
||||
const id = uniqueId(`node-${type.toLowerCase()}`, new Set(next.nodes.map((node) => node.id)));
|
||||
const node: ShaderNodeIR = { id, type, name: name.trim() || type, sockets: nodeSockets(type), ...(type === "MATH" ? { properties: { operation: "ADD" } } : {}) };
|
||||
|
||||
Reference in New Issue
Block a user