-
Notifications
You must be signed in to change notification settings - Fork 206
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
Saving the script causes duplicate 'requirements' plugs. #580
Comments
I think this in unrelated to actually executing the node - the problem looks to happen during serialisation, and it just happens that at the moment we save the script before rendering. So it should be sufficient to just save the file again to see the problem. |
This is also happening for the ImageWriter node, and is probably best addressed as part of the Executable/ExecutableNode refactoring being discussed in #681. |
Adding I originally tried solving this by preventing the last array element from being serialised if it is unconnected and set to the default value. I abandoned that idea when I realized that ValuePlug doesn't actually define getValue or defaultValue, and it would require significant binding re-jigging to figure that out. Next I started looking into preventing it on scene open ( Is there a way to detect that we're mid-load inside the ArrayPlug constructor, so we can opt out of adding the default element? Or should I try removing the last element afterwards by hooking into scriptExecutedSignal? |
We were serialising a construct/addChild pair for the first element of the array, even though the element would be provided again via the constructor next time. This led to one additional plug being added each time the ArrayPlug was serialised and unserialised. Fixes GafferHQ#580.
By the time I'd figured out enough to answer your questions I'd figured out a fix anyway, so I've just put in a pull request for this. As an aside, I'm determined to avoid any kind of |
We were serialising a construct/addChild pair for the first element of the array, even though the element would be provided again via the constructor next time. This led to one additional plug being added each time the ArrayPlug was serialised and unserialised. Fixes GafferHQ#580.
To reproduce:
You should see a duplicate line has been added below 109
These duplicates appear to accumulate every time the script is reopened and rendered, so might be worth preventing.
The text was updated successfully, but these errors were encountered: