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

Links copy not implemented? #240

Open
lyd405121 opened this issue Jun 30, 2023 · 1 comment
Open

Links copy not implemented? #240

lyd405121 opened this issue Jun 30, 2023 · 1 comment

Comments

@lyd405121
Copy link

Background

  • I am wrting a node editor to render my scene graph data
  • Here is the early version video:
output.mp4

Question

  • But I met a quetion which is how to copy and paste node and link togather
  • I found imgui-node-editor can't catch both selected links and nodes
  • Here is demo:
demo.mp4
  • And I found there is a series of shortcut function in imgui-node-editor, but not used in any samples

My solution

  • So I should do my own data-structure to store the relationship for all selected nodes,
  • Like sub-graph in a graph, eavluate the relationship for all possible outputs/inputs
  • Is that right? or there is more easy way in the framework of imgui-node-editor
@thedmd
Copy link
Owner

thedmd commented Sep 1, 2023

You're correct that selection can contain only nodes or links but not both.

Inteded way to make copy is to:

  • get selected nodes
  • clone them on the user side
  • clone links between cloned nodes (if possible)

That was done because Node Editor cannot say if connection between cloned nodes are valid.

You're also correct that it had to be done on the user side.


It should be possible to create Copy/Duplicate actions on the node editor side and use same API as for user interaction.
I will keep this issue open to keep track of the idea.

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

No branches or pull requests

2 participants