Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Multi-Node Copy and Paste Functionality #119

Closed
LinsCodes opened this issue Jul 8, 2024 · 4 comments
Closed

[Feature] Multi-Node Copy and Paste Functionality #119

LinsCodes opened this issue Jul 8, 2024 · 4 comments
Assignees
Labels
enhancement New feature or enhancement

Comments

@LinsCodes
Copy link

Hi,

First of all, I would like to express my gratitude for creating such a wonderful open-source project like Nodify. It has been incredibly helpful in my work and I truly appreciate the effort and dedication put into it.

I was wondering if it would be possible to implement a feature that allows for the copy and paste of multiple nodes. This functionality would greatly enhance the usability and efficiency of the tool, especially for complex projects involving numerous nodes.

Thank you for considering this request. I look forward to your feedback.

Best regards,

@LinsCodes LinsCodes added the enhancement New feature or enhancement label Jul 8, 2024
@hendrikp
Copy link

hendrikp commented Jul 9, 2024

There is a seperate branch in the PRs where such function exists, in the main one its not useful as copy&paste depend on a data model being present. The library being view model only, thus doesnt have much sense to have such function. From experience i can say its doable pretty easy once datamodel and serialization is in place (just serialize Selected nodes, and deserialize them while offseting and switching selection).

@LinsCodes
Copy link
Author

Thank you for your response. I appreciate the clarification regarding the separate branch and the rationale behind not including the copy & paste functionality in the main branch. It makes sense given the view model-only nature of the library.

I am currently working on implementing this feature as well. Serializing the selected nodes has been straightforward, but I am encountering an issue with restoring the connections when pasting. I am seeking advice on how to effectively manage the connections during the deserialization process. Any insights or suggestions would be greatly appreciated.

@hendrikp
Copy link

e.g. each node and also each connection should have an uuid Serialize list of nodes and connections indepently. connection is start uid + connector index + enduid + connector index.

On deserialize keep track of the node uids, generate new ones for all nodes/connections, replace them in the connections to be recreated. Create then all nodes with some offset on the graph. Then recreate the connections with the exchanged uids.

@LinsCodes
Copy link
Author

Thank you for sharing your approach. I was also looking into the node serialization method on the feature/new-blueprint branch, and your explanation has provided me with a clearer understanding. My previous method of serializing and restoring all connections and nodes was indeed inefficient. Your insights have been very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants