User guide

114
To pass this dictionary of hints to Katana we add a function to our node class:
def addParameterHints(self, attrName, inputDict):
inputDict.update(_ExtraHints.get(attrName, {}) )
inputDict.update(GetTimingParameterHints(attrName))
which is called for each parameter on our node to get the correct hints. At this point, the UI for our node displays
hints. See the image below for an example of the help hint.
At this point, we have a working node displaying an interface to the user. The next step is to add the logic, which is
responsible for calling the SGG plug-in.
Calling the SGG Plug-in
When Katana produces the Scene Graph from a given Node Graph it traverses the Node Graph, calling the _
getGeometryProducer() function on each node.
Our Node's _getGeometryProducer() function needs to perform two tasks:
1. Process the UI's parameters and build the necessary arguments that is passed to the SGG plug-in.
2. Call a helper function in the GeoAPI, which builds and resolves the SGG Plug-in.
For a complete description of Scene Graph generation, please see Help > Technical Guide.
Parsing the UI Parameters
Accessing parameter values is achieved by using the node's member function getParameter(paramName) and
then calling getValue(frameTime) on the returned value, for example:
fps = float(self.getParameter('fps').getValue(frameTime))
When all parameters have been parsed, they need to be aggregated into a dictionary where the key is the argument
name expected by the SGG Plug-in, and the value is an object of type PyScenegraphAttr.Attr.
15 WRAPPING SGG PLUG-INS IN A CUSTOM NODE | SPECIFYING UI HINTS