User guide

100
Typically there is a third Python script for common shared utility functions needed by both the nodes and UI
scripts.
Registering and Initialization
The Plug-in Registry is used to register new Super Tools. The registration is performed in the init.py (at base level)
which is also, typically, the place where we check the Katana version to make sure a plug-in is supported.
The following example shows the plug-in registration containing separate calls for the node and editor:
import Katana
import logging
log = logging.getLogger('HelloSuperTool')
try:
import v1 as HelloSuperTool
except Exception as exception:
log.exception('Error importing Super Tool Python
package: %s' % str(exception))
else:
PluginRegistry = [("SuperTool", 2, "HelloSuperTool",
(HelloSuperTool.HelloSuperToolNode,
HelloSuperTool.GetEditor))]
The init.py file inside the v1 folder then provides Katana with a function to receive the editor:
from Node import HelloSuperToolNode
def GetEditor():
from Editor import HelloSuperToolEditor
return HelloSuperToolEditor
Node
The Node class declares internal node graph functionality using the NodegraphAPI.
See the following example of a Node.py file:
from Katana import NodegraphAPI, Utils, PyXmlIO as XIO, UniqueName
class HelloSuperToolNode(NodegraphAPI.SuperTool):
def __init__(self):
self.hideNodegraphGroupControls()
self.getParameters().parseXML("""
13 GROUPS, MACROS, AND SUPER TOOLS | SUPER TOOLS