Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Need an easy way to dynamically add outputs #15

Open
AlanGreyjoy opened this issue Apr 16, 2021 · 2 comments
Open

Need an easy way to dynamically add outputs #15

AlanGreyjoy opened this issue Apr 16, 2021 · 2 comments

Comments

@AlanGreyjoy
Copy link

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
Copy link
Author

AlanGreyjoy commented Apr 16, 2021

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

@ghostiam
Copy link
Owner

ghostiam commented Apr 16, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants