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

Box plug promotion #171

Merged
merged 20 commits into from
Apr 13, 2013
Merged

Box plug promotion #171

merged 20 commits into from
Apr 13, 2013

Conversation

johnhaddon
Copy link
Member

This adds the capability to promote plugs on nodes within Boxes onto the outside of the Box. Hopefully this will provide us with the framework we need for allowing users to build their own "gift boxes" - networks of nodes to be passed on to other users.

  • Added a "user" plug available on all nodes. This provides a safe namespace in which users can create any plugs they want without fear of conflicting with future plugs introduced by the node.
  • Generalised the Metadata class to allow arbitrary key/value pairs to be associated with Nodes and Plugs (formerly only description were supported).
  • Simplified NodeUI into an abstract base class and added StandardNodeUI, which provides the ability to package different plugs into different tabs and a header section. This is controlled via Metadata entries, and the "user" plug is always presented in its own tab.
  • Added API and UI for promoting plugs from the inside to the outside of Boxes. Plugs are always promoted onto the "user" plug of the Box.
  • Added LabelPlugValueWidget to provide plug labels with additional functionality, including the popup menu necessary for promotion, and a tooltip generated from Metadata.
  • Miscellaneous UI additions and bugfixes, several of which deal with attempt to edit plugs which have incoming connections - as they do when they have been promoted.

Fixes #142.

Widgets inside a highlighted tab would incorrectly display an inherited highlight state. This could be seen when dragging a node into the node editor with either nested tabs or a nested VectorData Widget. Fixed this by making the Widget css more specific (not selecting distant children of highlighted widgets) and overriding VectorDataWidget.setHighlighted to store the highlighted state explicity on the QTableView where it could be picked up easily by the stylesheet.
This provides a CompoundPlug where users can safely put any custom plugs they want, without fear of name clashes with existing or future standard gaffer plugs.
Promotion takes a plug on a node inside a Box, creates a matching plug on the Box itself, and uses that to drive the input to the internal plug. Box methods are provided to query whether or not can be promoted, whether or not one has been promoted, and to promote one. Once we have UI support for it this will form the basis for users to build macros/gizmos/thingos.
This just displays the plugs and provides a menu for adding a few plug types. Later we'll need to add a dialogue for specifying new plug properties (min/max/flags etc) and for modifying the layout and widgets.
The right click popup menu for plugs contains a "Promote to Box" entry which allows users to promote the plug to the box level.
It can now store arbitrary key/value pairs for nodes and plugs, rather than just descriptions as before.
Removed the default implementation from NodeUI - this is now an abstract base class. Moved implementation to StandardNodeUI and improved it to support organisation of plugs into tabs via Metadata, and to support a header and a simplified (tabless) view.
It would error while trying to apply the summary to a non-existent collapsible title.
- Using a simplified form of StandardNodeUI when embedding the Filter ui inside FilterPlugValueWidget.
- Placing filter inside its own tab for FilteredSceneProcessors.
- Placing transform inside its own tab for ObjectSource nodes.
- Placing Shader name widget with Reload button in the header of the NodeUI.
- Allowing any callable that yields a NodeUI instance to be passed to NodeUI.registerNodeUI, rather than just NodeUI subclasses.
- Removing user tab from preferences ui.
- Improving ordering of StandardNodeUI tabs - Settings tab now always comes first.
This necessitated rejigging the PlugValueWidget._addPopupMenu() code to use a belts-and-braces approach where it handles both right click events and also context menu events.
Formerly they didn't keep their values correctly when being promoted, because CompoundPlug::setFrom() had not been implemented.
This provides a nice standard means of labelling a plug, providing the standard PlugValueWidget popup menu and creating a tooltip from the Metadata. The menu is of particular importance, as it makes the plug promotion capabilities available for color plugs and other compound plug types.
@johnhaddon
Copy link
Member Author

OK. I'll merge as-is and we can address the name changes separately if you want to bring it up again later.

@johnhaddon johnhaddon merged commit b6cb9bf into GafferHQ:master Apr 13, 2013
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.

Promote plugs to Box level
2 participants