jchanvfx / NodeGraphQt

Node graph framework that can be re-implemented into applications that supports PySide2
http://chantonic.com/NodeGraphQt/
MIT License
1.27k stars 257 forks source link

Same node in multiple graphs - retain connections #294

Open aljazjelen opened 1 year ago

aljazjelen commented 1 year ago

Hi! Lets say I have Node A and Node B. They are connected via simple connection. Then lets assume I make another graph, where I would like to display those two Nodes inside (A and B). My goal is, to retain the connections between A and B.

Issue is however, if you "add a node" to additional graph, it deletes it from the previous graph. I was thinking to change existing code, so that Node model supports more than one graph per node... but it seems way too complicated for someone like me.

Has someone tried something similar?

jchanvfx commented 1 year ago

Hi @aljazjelen,

Does the GroupNode class work for you? it's a node that can expand into a SubGraph.

https://jchanvfx.github.io/NodeGraphQt/api/nodes/GroupNode.html https://jchanvfx.github.io/NodeGraphQt/api/graph.html#subgraph

aljazjelen commented 1 year ago

Hi @jchanvfx thanks for reply!

I dont think it does. I played around with it but its not what I have in mind. Perhaps I coded something wrong. What my intention is, if I create NodeA and create NodeB on the graph_1 and then I add NodeA and add NodeB also to the graph_2, I would want the following:

Hopefully I am clear with my intentions :)

jchanvfx commented 1 year ago

Hi @aljazjelen,

Ah yup I think I know what you mean to have multiple instances of the same node graph, currently the frame work wasn't written to work that way. But it might be possible to do I haven't tried before.

With your graph_2 you could initialized it with graph_1 node_factory and then have graph_2 wired up to graph_1 signals but I think even then it might not be working quite right for what you're after.

jchanvfx commented 1 year ago

Having this does sound cool thought 😺. Will look into it implementing this feature request in the future.

aljazjelen commented 1 year ago

@jchanvfx you have done amazing job. The project has huge potential for someone who knows himself good around MVC and QT. Unfortunatelly I am not really expert in such. Looking forward for further features :)