vue-blocks icon indicating copy to clipboard operation
vue-blocks copied to clipboard

Need an easy way to dynamically add outputs

Open AlanGreyjoy opened this issue 3 years ago • 2 comments

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!

AlanGreyjoy avatar Apr 16 '21 02:04 AlanGreyjoy

So I commented out the deletes in clonedBlocks.map inside exportScene. Everything seems to work fine. Will this cause any problems?

AlanGreyjoy avatar Apr 16 '21 12:04 AlanGreyjoy

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.

ghostiam avatar Apr 16 '21 15:04 ghostiam