User guide

229
NODES_SELECTED
NODES_ALL
The function GetNodeList() retrieves the nodes specified by the nodeScope, if IsSceneValid() was successful. For
example:
eligibleForSubmission = FarmAPI.IsSceneValid(
nodeScope = FarmAPI.NODES_ALL,
allowUnsavedChanges=False,
allowCapitalLetters=False,
allowDigits=False,
unwantedSymbols=["_"]
)
if eligibleForSubmission:
nodesForFarm = FarmAPI.GetNodeList()
If a scene fails the IsSceneValid() check, any errors and warnings are retrieved using GetErrorMessages() and
GetWarningMessages(). The following example displays any errors in a message box:
errorText = FarmAPI.GetErrorMessages()
if len(errorText) > 0:
UI4.Widgets.MessageBox.Warning('Error', \
' '.join(errorText))
return
The functions AddErrorMessage() and AddWarningMessage() are used to issue additional error messages. These
are only used when writing a custom dialog.
Additional Utils
The following table details the utility functions that the Farm API provides. Refer to the Python help function for
more information on these functions:
Name Type Description
GetKatanaFileName() String Returns the Asset ID of the currently open Katana
recipe.
GetSelectedNodes() Node[ ] Returns a list of the currently selected nodes.
GetCurrentNode() Node Returns the node currently under the mouse, if the
mouse has been clicked. If there is no qualifying node,
returns the first element in the list of selected nodes.
28 RENDER FARM API | ERRORS, WARNINGS AND SCENE VALIDATION