-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DependencyNode::affects() is now called for output plugs too.
It's becoming a common pattern to have internal plugs which hold the result of some intermediate computation which is worth caching in its own right. This was achievable in two ways : - By having two internal plugs. The first, an output, holds the computed intermediate value. The second, an input, receives this value by a connection and allows its use in further computations. GafferScene::Group was using this method. This method was correct, but fiddly to set up and had extra overhead in the form of the second plug and connection. - By having a single internal output plug, which holds the intermediate value and is accessed directly in further computations. Because affects() was not called for this output plug, implementations had to cheat and directly have inputs affect the final outputs, bypassing the internal plug during dirty propagation. GafferOSL::OSLImage was using this method. This method was slightly dodgy, but easier to implement and understand. By calling affects() for output plugs as well, we can now implement the simpler second mechanism without having to resort to naughtiness in affects(). Note that it is possible for lazy affects() methods which were not checking the identity of the input plug appropriately to be tripped up by this - it's worth checking any node implementations in external packages before accepting this commit.
- Loading branch information
1 parent
234524e
commit f1e9cb3
Showing
9 changed files
with
89 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters