User guide
222
initialization is complete:
from Katana import Callbacks
def onStartup(**kwargs):
pass
Callbacks.addCallback(Callbacks.Type.onStartup, onStartup)
The onStartup callback handler is used to add Farm menu options to the UI and register Farm specific node
parameters.
Farm Menu Options
A Render Farm menu option is a UI hook for triggering a custom Render Farm Submission tool, which in turn could
launch a File Browser or a custom dialog.
Two UI menus can be extended by the Farm API. The Util menu in the top menu bar and the Render Farm menu,
which appears in a pop-up when you right-click on a node in the Node Graph.
The Util Menu
The function AddFarmMenuOption() adds a new menu item to the Util menu.
It's arguments are a menu item title and a callback function to invoke when the menu item is chosen. For example:
from Katana import FarmAPI, Callbacks
def runMyOption(**kwargs):
print("My Render Farm Util Menu Option has been clicked")
def onStartup(**kwargs):
FarmAPI.AddFarmMenuOption("My Render Farm Util Menu
Option", runMyOption)
Callbacks.addCallback(Callbacks.Type.onStartup, onStartup)
Render Farm Pop-Up Menu Option
The function AddFarmPopupMenuOption() adds a new item to the Render
Farm section of a supported node’s right-click menu. Like the Util menu, its arguments are an item title and a
callback function to invoke when the item is chosen. For example:
from Katana import FarmAPI, Callbacks
28 RENDER FARM API | FARM MENU OPTIONS