User guide

218
Asset Render Widget
The Asset Widget Delegate allows customization of the display of the render output location shown in a Render
node’s Parameters tab. This is useful for when rendering to a location in a custom asset management system.
This output location could be an automatically generated temporary path or one set explicitly using a Render Output
Define node. It is set on a Render Node and therefore the Asset Render Widget is read-only.
Implementing an Asset Render Widget
Implementing an Asset Render Widget is optional. The Asset Management user interface does not require this. The
entry point for a custom widget delegate is similar to that of the Asset Control Widget.
The Asset Widget Delegate must implement createAssetRenderWidget() which in turn must return a class that
inherits from baseAssetWidgetDelegate() and implements two methods, buildWidgets() and updateWidgets().
createAssetRenderWidget() has an additional outputInfo argument which is a dictionary of output information
and must be passed to the BaseAssetRenderWidget constructor. The outputInfo dictionary contains the output
location’s Asset ID along with additional information (such as the image file type and resolution).
BaseAssetRenderWidget provides a utility method, getOutputInfo() for accessing this dictionary.
The key for the Asset ID of the output location is outputLocation.
Additional Asset Widget Delegate Methods
There are several methods used to make small customizations to the Asset Management UI. These are implemented
as overridable methods on the Asset Widget Delegate.
addAssetFromWidgetMenuItems()
Allows you to extend the menu item to the right of an Asset ID in the Parameters tab with additional items.
def addAssetFormWidgetMenuItems(self, menu):
menu.addAction("Custom Action",
self.__customCallback)
def __customCallback(self, *args):
print args
27 ASSET MANAGEMENT SYSTEM PLUG-IN API | THE ASSET CONTROL WIDGET