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.

Note:  The custom browser tab added using addBrowserTab() should emit a selectionValidSignal signal to indicate a change in selection validity and therefore the state of the Asset Browser Accept button, for example:
browserTab.selectionValidSignal.emit(browserTab.selectionValid())
The browser dialog listens for this signal from the currently viewed tab and sets the enabled state of its Accept button accordingly.

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 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 retrieves them using this method:

{"versionUp" : "False" / "True", "publish" : "False" / "True" }

Note:  The function getExtraOptions() should return a dict.