Skip to content
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

Custom metadata-driven Gadgets in NoduleLayouts #2043

Merged
merged 11 commits into from
Apr 12, 2017

Conversation

johnhaddon
Copy link
Member

These are equivalent to the custom widgets that can be registered with the PlugLayout. This allows us to remove a couple of custom NodeGadget registrations, and also opens up the possibility of allowing drag 'n' drop nodule layout in the UIEditor since internally it uses a similar API to the one in the PlugLayout.

The immediate motivation though is simply to allow PlugAdders to live in the nodule layout so they share the same metadata-driven spacing as the nodules themselves. This will get me one step closer to being able to finally finish up on my BoxIO work.

This allows the internal map to store a mapping from custom gadget name to custom gadget, in addition to the mapping from `Plug *` to Nodule. Nothing is changing about the logic here, we're just preparing the ground for subsequent commits where we'll actually add custom gadgets.
This brings the structure closer to what we do in PlugLayout, making it easier to implement custom gadgets, and raising the possibility of one day allowing nodule layouts to be edited in the NodeEditor (`PlugLayout.layoutOrder()` is the primary interface the UIEditor uses to do its work).
This means we can drop the "is it a ShaderSwitch?" hack, remove another NodeGadget creator, and get one step closer to an entirely metadata-driven UI.
It not longer registers a NodeGadget.
It no longer registers a NodeGadget.
@andrewkaufman andrewkaufman merged commit 555a3f0 into GafferHQ:master Apr 12, 2017
@johnhaddon johnhaddon mentioned this pull request Apr 18, 2017
@johnhaddon johnhaddon deleted the noduleLayoutCustomGadgets branch May 3, 2017 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants