this repo has no description

copy / paste copies links between outputs / inputs now

phaz.uk 5fa4928e 6f864cfb

verified
Changed files
+40 -1
src
utils
+40 -1
src/utils/clipboard.ts
··· 7 8 for(let node of selectedNodes){ 9 arr.push({ 10 type_id: node.typeId, 11 statics: node.statics, 12 x: node.x - mousePos[0], 13 - y: node.y - mousePos[1] 14 }) 15 } 16 17 return 'VRCMACRO' + btoa(JSON.stringify(arr)); 18 } 19 ··· 35 await n.onStaticsUpdate(n); 36 37 nodes.push(n); 38 } 39 40 return nodes;
··· 7 8 for(let node of selectedNodes){ 9 arr.push({ 10 + id: node.id, 11 type_id: node.typeId, 12 statics: node.statics, 13 x: node.x - mousePos[0], 14 + y: node.y - mousePos[1], 15 + outputs: node.outputs.map(x => { 16 + return x.connections.map(x => { 17 + return { node: x.parent.id, index: x.index } }) }) 18 }) 19 } 20 21 + for(let node of arr){ 22 + for(let output of node.outputs){ 23 + for(let i in output){ 24 + let indx = arr.findIndex(x => x.id === output[i].node); 25 + if(indx === -1) 26 + delete output[i]; 27 + else 28 + output[i].node = indx; 29 + } 30 + } 31 + } 32 + 33 + for(let node of arr)delete node.id; 34 + 35 + console.log(arr); 36 return 'VRCMACRO' + btoa(JSON.stringify(arr)); 37 } 38 ··· 54 await n.onStaticsUpdate(n); 55 56 nodes.push(n); 57 + } 58 + 59 + for(let i in nodes){ 60 + let outputs: { node: number, index: number }[][] = json[i].outputs; 61 + let node = nodes[i]; 62 + 63 + for(let j in outputs){ 64 + let output = node.outputs[j]; 65 + 66 + for(let k in outputs[j]){ 67 + let connection = outputs[j][k]; 68 + if(!connection)continue; 69 + 70 + let peerNode = nodes[connection.node]; 71 + let input = peerNode.inputs[connection.index]; 72 + 73 + output.connections.push(input); 74 + input.connections.push(output); 75 + } 76 + } 77 } 78 79 return nodes;