-
Notifications
You must be signed in to change notification settings - Fork 207
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
Serialise connections to children of ScenePlug/ImagePlug #3986
Comments
The more I think about it, the more I think we should disable serialisation of inputs for |
Disabling serialization of I don't entirely understand why it relates to this though ... I would hope that we would only be serializing the child connections in the case where they aren't already implied by the parent connection, like what happens currently with shader color connections? And I would think that the internal connections to "out" would be whole plug connections anyway, so I don't understand why this would affect them? But standardizing no serialization for the out plug sounds good anyway. |
It's really common to pass through some children directly via connections and then implement compute for the remaining unconnected outputs. |
This implements the ScenePlug half of GafferHQ#3986.
This implements the ScenePlug half of GafferHQ#3986.
This means we also need to disable serialisation for `ImageProcessor.out` to avoid unwanted serialisation of internal connections. This _could_ have been achieved by removing the Serialisable flag, but that caused problems for things like `Dot::setup()`, which _do_ force the added plug to be serialisable, but _not_ its children. We could have modified all those locations to set flags recursively, but since we want to remove flags entirely in future it makes more sense to use a custom serialiser instead. The Dot setup problem demonstrates the problem with flags in the first place - they get copied from place to place, but they may only have made sense on the node they originated from. In conjunction with the previous commit, this fixes GafferHQ#3986.
Summary
Some advanced users would benefit from being able to manage connections to the individual children of ScenePlug and ImagePlug. This is trivially achieved when writing a Python or C++ subclass of SceneProcessor/ImageProcessor as the connections can be made in the constructor. But if the connections are made manually in a regular node graph, they are not serialised because the Serialisable flag has been turned off for the children.
User story
A common use is to use an expression to drive the globals or metadata, while passing everything else through via pass-through connections.
Implementation notes
This is trivially achieved by modifying the ScenePlug and ImagePlug constructors to keep the Serialisable flag for the children. But doing this leads to test failures because we end up serialising internal connections for regular SceneProcessor/ImageProcessor subclasses. I think ideally we should make
SceneProcessor.out
andImageProcessor.out
non-serialisable by default as it has continually tripped us up, but this is a breaking change and we don't know the consequences for custom nodes in the wild. Perhaps it is sufficient just to document the change and say "turn serialisation back on in your constructor if you need it"?The text was updated successfully, but these errors were encountered: