Skip to content

Conversation

@GRAYgoose124
Copy link
Contributor

@GRAYgoose124 GRAYgoose124 commented Mar 24, 2023

Nodes which depend on on_input_connected being called are not properly initialized after a load_session.

I simply added BaseNode.on_input_connected call to base.graph._deserialize() (graph.py:1615, see diff) to fix this issue. Theoretically, when loading a session, I would imagine a graph should behave just as it does when created with set_input and set_output, this is my justification for believing on_input_connected should be called. (Personlly, rather than internally updating node connection dicts, I perhaps would use the API methods to build the session to unify the functionality in the first place.)

I had a situation which motivated this, several nodes which were using on_input_connected visually looked initialized, but were not behaving exactly as they do on first startup / creation until I manually reconnected them. My use case could be a result of bad design choices, I could grab the only node on the input connection dynamically - that did work - rather than setting it on connection. (Maybe someone has a stern lecture for me on this design choice...) However, I do think this would be a bugfix regardless of my personal motivation. It seems to work robustly and I hope you consider including this change or a variation of it.

… did not have their connections initialized correctly.

Added BaseNode.on_input_connected call to base.graph._deserialize() (graph.py:1615) to fix this issue.
@jchanvfx
Copy link
Owner

jchanvfx commented Apr 2, 2023

thanks 😺

@jchanvfx jchanvfx merged commit 77c7070 into jchanvfx:master Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants