nodeeditor icon indicating copy to clipboard operation
nodeeditor copied to clipboard

Dynamic port nodes with saving and loading

Open willys0 opened this issue 5 years ago • 1 comments

Small fix to the dynamic port nodes PR https://github.com/paceholder/nodeeditor/pull/209 by @signmotion to work with loading and saving of scenes.

Input/Output connection vectors in NodeState would go out of range when loading scenes containing nodes with dynamically set number of ports. I added additional key/value pairs to the saved JSON files which will determine the number of connections of the restored nodes.

willys0 avatar Aug 12 '20 12:08 willys0

For some reason with this PR the node fails to update connection end positions if the width of the node changes when port is added.

skarndev avatar Dec 14 '20 23:12 skarndev

I think this PR is no longer needed as of version 3.

The possible workflow would be to save the model's state to json and then all the connection ids. Upon restoring we would first load the models back, it would restore the proper count of In and Out ports and then we load the serialized ConnectionIds.

See the example examples/dynamic_ports. Saving and restoring is implemented there.

paceholder avatar Dec 09 '22 22:12 paceholder