User guide
216
Configuring the Asset Browser
The entry point for extending the Katana asset browser is the method configureAssetBrowser(), which must be
implemented in your AssetWidgetDelegate plug-in. configureAssetBrowser() takes a single browser argument,
which is the Katana Asset Browser to configure. At its core the Asset Browser is a QT dialog window (QDialog) with
additional utility methods. The most useful of these are:
• addBrowserTab()
Add a new tab to the Asset Browser.
• addFileBrowserTab()
Add a standard file browser tab to the Asset Browser.
• getCurrentIndex()
Return the index of the currently open tab.
• setCurrentIndex()
Set the currently open tab.
The base implementation of configureAssetBrowser() sets the window title from the given hints and creates a file
browser tab. If you want to avoid creating a file browser tab, implement a shouldAddFileTabToAssetBrowser()
method with a return value of False.
The following methods exist but need minimal implementation:
• setSaveMode()
Tells us whether the browser is invoked for opening a file or for saving one. If the saveMode is True, then the
browser has been opened for saving a file.
• selectionValid()
Checks whether the current asset path refers to a valid asset. For a file browser dialog window this returns false if
a chosen path does not exist.
• setLocation()
Sets the default location with which to open the browser.
• getExtraOptions()
This is used to support a versionUp and a publish option for LookFileBake and create a new Katana file. If those
options are displayed in the custom user interface Katana will retrieve them using this method:
{"versionup" : "False" / "True", "publish" : "False" / "True" }
NOTE: The function getExtraOptions() should return a dict.
27 ASSET MANAGEMENT SYSTEM PLUG-IN API | EXTENDING THE USER INTERFACE WITH ASSET