vue-blocks
vue-blocks copied to clipboard
Need an easy way to dynamically add outputs
So, I have tried to add them in VueBlocksContainer,
this.blocks.find(t => t.id === block.id).outputs.push({ active: false, label: 'New Match', name: 'NewMatch' })
But, as soon as this.updateScene() runs, they are cleared.
Any tips on dynamically adding outputs?
Thanks!
So I commented out the deletes in clonedBlocks.map inside exportScene. Everything seems to work fine. Will this cause any problems?
Hi. Thank you for your interest in the project.
I think your solution with clonedBlocks.map is correct.
The only problem is if you change the inputs/outputs of the block(in "blocksContent" array), they will not be updated in the saved scene.
Perhaps you should write some functionality that adds missing inputs/outputs to the prepareBlocks
function.
Although I can see that there is a merge
of objects happening there, so there is a chance the problem will be solved automatically. Unfortunately, I am not able to verify this at the moment.