User guide
103
mainLayout.addWidget(widget)
# Apply the layout to the widget
self.setLayout(mainLayout)
Examples
The following code examples illustrate various Super Tool concepts and can be used for reference.
NOTE: The Super Tool code examples are shipped with Katana and can be found in the following directory:
$KATANA_ROOT/plugins/Resources/Examples/SuperTools
Pony Stack
This Super Tool example manages a network of PonyCreate nodes all wired into a Merge node. You can create and
delete ponies, change the parent path of all the ponies, and modify the transform for the currently selected pony.
Interesting things to note are (in no particular order):
• The UI listens to change events and syncs itself automatically when the internal network changes (important for
undo/redo).
• There's a hidden node reference parameter on the Super Tool node itself that gives us a reference to the internal
Merge node (which tracks node renames).
• The internal PonyCreate nodes are linked by expression to the Super Tool location parameter to determine where
the ponies appear in the scenegraph
• We are using FormWidgets to expose a standard widget for the location parameter, a custom UI for the pony list,
and FormItems to expose the transform parameter of the currently selected pony's internal node.
EXPERIMENT: Extend this Super Tool, for example by implementing the ability to rename the pony in the
tree widget and having drag/drop reordering of the ponies inside the tree widget.
Shadow Manager
The ShadowManager shows a more complex example of a Super Tool that can be used to manage (PRMan) shadow
passes. It takes an input scene and allows a user to define render passes. For each render pass the available lights in
the scene can be added to create shadow maps. The user is able to specify settings like resolution and material
pruning on a render pass level (in the Shadow Branch) and further adjust resolution, shadow type and output
location for each light pass. The user need not set the Shadow_File attribute on the light's material as this is handled
internally by the ShadowManager.
13 GROUPS, MACROS, AND SUPER TOOLS | SUPER TOOLS