-
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
Collect : Add new node for collecting arbitrary values #5424
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! A lot of potential here for both ad-hoc and reusable scene inspection setups. A few minor comments inline, but nothing particularly stands out.
I can do a final review next week once those other changes you have pending are pushed...
@@ -0,0 +1,122 @@ | |||
////////////////////////////////////////////////////////////////////////// | |||
// | |||
// Copyright (c) 2022, Cinesite VFX Ltd. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt this say 2023?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno, but I don't think so. Believe it or not, I started working on this on a train journey back in 2022, and pushed it to GitHub ("publishing" it) the same year.
// If `plug` is a supported type, downcasts it to its true type and | ||
// calls `functor( plug, args )`. Otherwise, does nothing. | ||
template<typename F> | ||
void dispatchPlugFunction( const ValuePlug *plug, F &&functor ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think this might be useful elsewhere like IECore::dispatch? Perhaps this could be in PlugAlgo or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we might end up with something like that at some point - I did something similar in RandomChoice as well. A generic PlugAlgo function would be slightly different in that it would need to support all plug types though, and then Collect and RandomChoice would need to be adapted to filter out the ones they don't support. I expect we'll do that at some point, but I don't see any harm in waiting for another use case or two to see if it changes the requirements.
Thanks for the review Murray - I've pushed commits to address your comments, and replied to each comment pointing to the appropriate commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks John! Looks good to merge once the conflicts are sorted.
Like CollectScenes, CollectImages and others, this allows the repeated collection of the same inputs across a range of contexts. Unlike the others, it is designed to collect completely generic values from any plug, outputting the results as arrays of values. This is all parallelised within a
parallel_for
across the range of contexts. We anticipate it being a useful utility node with a variety of uses. In the example below I'm using it to query scene attributes from a range of locations, presenting the results in a handy spreadsheet form - a sort of build-it-yourself scene inspector.