User guide

228
renderNodeInfo = FarmAPI.GetSortedDependencyList()
farmFilePath = UI4.Util.AssetId.BrowseForAsset
(
'', 'Specify a filename', \
True,{'fileTypes':'json','acceptDir': False}
)
with open(farmFilePath, "w") as farmFile:
farmFile.write(
json.dumps(
renderNodeInfo
)
)
def onStartup(**kwargs):
FarmAPI.AddFarmMenuOption("Display Out", \
writeRenderInfo)
Callbacks.addCallback(Callbacks.Type.onStartup, onStartup)
Custom Dialog
The default dialog is a starting point for a farm plug-in dialogue window, but for a custom plug-in, it may be
necessary to create a custom dialog window. In this case PyQT and the UI4 module should be used.
Errors, Warnings and Scene Validation
It is useful to check particular conditions of a recipes state before submitting it to a render-farm. For example, the
recipe should have no unsaved changes, so that what is rendered is consistent with what is displayed in Katana.
The utility IsSceneValid() checks for unsaved changes, and returns a boolean with a value of True if the recipe is
eligible for submission. For example:
eligibleForSubmission = FarmAPI.IsSceneValid(
nodeScope = FarmAPI.NODES_ALL,
allowUnsavedChanges=False,
allowCapitalLetters=False,
allowDigits=False,
unwantedSymbols=["_"]
)
The nodeScope argument specifies which nodes are submitted. The argument value is stored in the internal state of
the Farm API and can be retrieved with GetNodeProcessType(), which returns one of the following:
NODES_SINGLE
28 RENDER FARM API | ERRORS, WARNINGS AND SCENE VALIDATION