-
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
Shuffle improvements #5590
Shuffle improvements #5590
Conversation
…ation` And align all widgets to the top, so that everything still lines up if the custom widgets use additional vertical space.
I've read through this in moderate detail, and I think I pretty well understand it, and it all looks pretty good. It will definitely be a great change, I am frequently annoyed by not having these features on Shuffle in my own testing. I don't have any clear ideas on the virtual channel sources, though I can throw one more option on the pile: It's totally reasonable if you want to add a more discoverable option, but if you want a minimal change that would get GafferImage::Shuffle working, I think this would work. |
We're already using the value part to tell us which input channel to map to the output (key part) though. And in the general case (ShuffleAttributes etc), the value part isn't even a string. Something similar would be possible by augmenting the key part with a special suffix instead, something like I've pushed an alternative approach that I think I'm reasonably happy with in the end : replacing |
- Add `ignoreMissingSource` argument to `shuffle()`, defaulting to `true` (the original behaviour). - Add `shuffleWithDefaultSource()` method, specifying a fallback source value to be used when a source is missing. These both forward to the same internal function, whose signature I didn't consider suitable for the public API, because of the four permutations of `ignoreMissingSource` and `defaultSource`-null-ness only three make sense.
This brings it into line with ShuffleAttributes and ShufflePrimitiveVariables, adding a fair bit of functionality over what we had before.
This stuff all worked thanks to `startup/GafferImage/shuffleCompatibility.py`, but we don't want to be relying on that forever. Also add a test that we can load a Shuffle node and its settings from a file saved from Gaffer 1.3.9.0.
This makes the Widget more useful in technical workflows where you might want string substitutions, expressions or wildcards.
I can't see a reason not to use it, now it's a bit more versatile.
Pushed a version with all the fixups squashed in. |
As a side-benefit of a spare-time project I've got going, this improves the channel Shuffle node to use the same standard ShufflesPlug that ShuffleAttributes and ShufflePrimitiveVariables uses. With the following features :
This was all going swimmingly until 6dea107, where I realised the special
__black
and__white
"virtual" source channels we provide could now be matched by wildcards. In that commit I've made a "fix" that is technically a bit sketchy, but has the one virtue of not complicating the ShufflesPlug API any further. I don't think that should be the final solution, but I'm opening the PR to provide a basis for discussion. How should we improve the ShufflesPlug API to do this properly?const T &fallbackContainer
argument for values we want to provide exact matches but be ignored by wildcard matches. We'd need this in bothshuffle()
andshuffleWithDefaultSource()
though.GetDataFunctor
andSetDataFunctor
? This could be quite nice and flexible, but how would we extend it to support wildcard matches?Thoughts welcome!