Catalog Widgets

Several types of catalog widgets exist, each showing certain details of a specific item from Katana’s catalog. As a higher-level utility widget type, the UI4.Widgets.CatalogItemWidget class combines instances of several of the other catalog widget types in one container.

Class Inheritance

UI4.Widgets.CatalogItemWidget

class UI4.Widgets.CatalogItemWidget

Bases: PyQt5.QtWidgets.QWidget

Class implementing a widget that represents a catalog item, showing a thumbnail for the catalog item, and various details, namely the item’s name, locked state, channels, resolution, progress, and frame range.

Code example:

catalogItemWidget = UI4.Widgets.CatalogItemWidget()
catalogItemWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogItemWidget.resize(300, 55)
catalogItemWidget.show()

Example Screenshot:

Screenshot of a CatalogItemWidget widget

__init__(parent=None)

Initializes an instance of the class.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

catalogItemDropped
getLockLayout()
Return type

QtWidgets.QHBoxLayout

Returns

The layout that includes widgets that show the catalog item’s locked state, channels, and resolution.

getNameLayout()
Return type

QtWidgets.QHBoxLayout

Returns

The layout that includes widgets that show the catalog item’s name and frame range.

setCatalogItem(item)

Sets or resets the catalog item whose thumbnail, name, locked state, channels, resolution, progress, and frame range to show in this widget.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose thumbnail, name, locked state, channels, resolution, progress, and frame range to show in this widget.

UI4.Widgets.CatalogChannelsWidget

class UI4.Widgets.CatalogChannelsWidget(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Class implementing a label that shows the channels of a particular catalog item associated with it.

Code example:

catalogChannelsWidget = UI4.Widgets.CatalogChannelsWidget()
catalogChannelsWidget.setCatalogItem(
     CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogChannelsWidget.show()

Example Screenshot:

Screenshot of a CatalogChannelsWidget widget

__init__(parent=None)

Initializes an instance of the class.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

setCatalogItem(catalogItem)

Sets or resets the catalog item whose channels to show as the text of this label.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose channels to show as the text of this label, or None to reset the label’s text to an empty string.

updateState()

Updates the text of this label to show the channels of the catalog item associated with it, or resets the label’s text to an empty string if no catalog item is associated with this label or if the catalog item associated with this label is invalid.

UI4.Widgets.CatalogFrameRangeWidget

class UI4.Widgets.CatalogFrameRangeWidget(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Class implementing a label that shows the frame range of a particular catalog item associated with it.

Code example:

catalogFrameRangeWidget = UI4.Widgets.CatalogFrameRangeWidget()
catalogFrameRangeWidget.setCatalogItem(
     CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogFrameRangeWidget.show()

Example Screenshot:

Screenshot of a CatalogFrameRangeWidget widget

__init__(parent=None)

Initializes an instance of the class.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

setCatalogItem(catalogItem)

Sets or resets the catalog item whose frame range to show as the text of this label.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose frame range to show as the text of this label, or None to reset the label’s text to an empty string.

updateState()

Updates the text of this label to show the frame range of the catalog item associated with it, or resets the label’s text to an empty string if no catalog item is associated with this label or if the catalog item associated with this label is invalid.

UI4.Widgets.CatalogNameWidget

class UI4.Widgets.CatalogNameWidget(parent=None)

Bases: PyQt5.QtWidgets.QLabel

Class implementing a label that shows the name of a particular catalog item associated with it.

Code example:

catalogNameWidget = UI4.Widgets.CatalogNameWidget()
catalogNameWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogNameWidget.show()

Example Screenshot:

Screenshot of a CatalogNameWidget widget

__init__(parent=None)

Initializes an instance of the class.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

resizeEvent(event)

Handler for widget resize events which are passed in the event parameter.

Updates the label to abbreviate the shown catalog item’s name if not enough space is available to show the entire name.

Parameters

event (QtGui.QResizeEvent) – An object that describes the widget resize event.

setCatalogItem(catalogItem)

Sets or resets the catalog item whose name to show.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose name to show, or None to not show any name.

updateState()

Updates the text and tooltip of this label to show the name of the catalog item associated with it, or resets the label’s text and tooltip to empty strings if no catalog item is associated with this label or if the catalog item associated with this label is invalid.

Abbreviates the name shown if not enough space is available to show the entire name.

UI4.Widgets.CatalogRenderLogWidget

class UI4.Widgets.CatalogRenderLogWidget

Bases: QT4Widgets.LogView.LogView

Class implementing a log view for displaying the render log of a specific catalog item.

Is used in the nested B{Log} tab of the B{Render Log} tab.

Code example:

catalogRenderLogWidget = UI4.Widgets.CatalogRenderLogWidget()
catalogRenderLogWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogRenderLogWidget.resize(400, 85)
catalogRenderLogWidget.show()

Example Screenshot:

Screenshot of a CatalogRenderLogWidget widget

__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s catalog item to None and registers Katana event handlers in order to be able to update the widget when a corresponding catalog item has been updated or deleted.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

getCatalogItem()
Return type

CatalogAPI.CatalogItem.CatalogItem or None

Returns

The catalog item whose render log is shown in this log view, or None if no catalog item has been set for this log view (yet).

setCatalogItem(item)

Sets or resets the catalog item whose render log to show in this log view.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose render log to show in this log view, or None to reset the catalog item.

unlockAutoScrolling()

Deletes scrollbar positions that were cached for the current catalog item, if any, and turns auto-scrolling on.

updateState()

Clears the log view, and fills it with the text of the render log that corresponds to the catalog item that has been set for it, if any.

Is called when setting a catalog item for the log view, and when a catalog item that has been set for the log view has been deleted.

UI4.Widgets.CatalogRenderGlobalsStatsWidget

class UI4.Widgets.CatalogRenderGlobalsStatsWidget

Bases: PyQt5.QtWidgets.QTreeWidget

Class implementing a tree view to show global statistics about a 2D render task that is represented by a particular catalog item. The tree view uses two columns without column headers, showing name/value pairs of statistics.

Is used in the nested B{2D Globals} tab of the B{Render Log} tab.

Code example:

catalogRenderGlobalsStatsWidget = UI4.Widgets.CatalogRenderGlobalsStatsWidget()
catalogRenderGlobalsStatsWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogRenderGlobalsStatsWidget.resize(320, 115)
catalogRenderGlobalsStatsWidget.show()

Example Screenshot:

Screenshot of a CatalogRenderGlobalsStatsWidget widget

__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s catalog item to None and registers Katana event handlers in order to be able to update the widget when a corresponding catalog item has been updated or deleted.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

getStats()
Return type

PyXmlIO.Element or None

Returns

An XML element containing statistics about the 2D render task that is represented by the catalog item associated with this widget, or None if no valid catalog item has been set for this widget.

setCatalogItem(item)

Sets or resets the catalog item whose global render task statistics to show.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose global render task statistics to show, or None to reset the catalog item.

statsPresent
updateState()

Clears the tree widget and recreates tree widget items based on the global statistics about the 2D render task that is represented by the catalog item associated with this widget, if any.

UI4.Widgets.CatalogRenderTaskByTypeStatsWidget

class UI4.Widgets.CatalogRenderTaskByTypeStatsWidget

Bases: PyQt5.QtWidgets.QTreeWidget

Class implementing a tree view to show statistics about a 2D render task that is represented by a particular catalog item. The tree view contains the following columns:

  • Type

  • Num Tiles

  • Time (s)

  • Time / tile (ms)

  • Time (%)

Is used in the nested B{2D Tasks (by type)} tab of the B{Render Log} tab.

Code example:

catalogRenderTaskByTypeStatsWidget = UI4.Widgets.CatalogRenderTaskByTypeStatsWidget()
catalogRenderTaskByTypeStatsWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogRenderTaskByTypeStatsWidget.resize(400, 80)
catalogRenderTaskByTypeStatsWidget.show()

Example Screenshot:

Screenshot of a CatalogRenderTaskByTypeStatsWidget widget

__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s catalog item to None and registers Katana event handlers in order to be able to update the widget when a corresponding catalog item has been updated or deleted.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

getStats()
Return type

PyXmlIO.Element or None

Returns

An XML element containing statistics about the 2D render task that is represented by the catalog item associated with this widget, or None if no valid catalog item has been set for this widget.

setCatalogItem(item)

Sets or resets the catalog item whose render task statistics to show by 2D task type.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose render task statistics to show by 2D task type, or None to reset the catalog item.

statsPresent
updateState()

Clears the tree widget and recreates tree widget items based on the statistics about the 2D render task that is represented by the catalog item associated with this widget, if any.

UI4.Widgets.CatalogRenderTaskByNameStatsWidget

class UI4.Widgets.CatalogRenderTaskByNameStatsWidget

Bases: PyQt5.QtWidgets.QTreeWidget

Class implementing a tree view to show statistics about a 2D render task that is represented by a particular catalog item. The tree view contains the following columns:

  • Node Name

  • Time (s)

  • Time (%)

Is used in the nested B{2D Tasks (by name)} tab of the B{Render Log} tab.

Code example:

catalogRenderTaskByNameStatsWidget = UI4.Widgets.CatalogRenderTaskByNameStatsWidget()
catalogRenderTaskByNameStatsWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogRenderTaskByNameStatsWidget.resize(400, 80)
catalogRenderTaskByNameStatsWidget.show()

Example Screenshot:

Screenshot of a CatalogRenderTaskByNameStatsWidget widget

__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s catalog item to None and registers Katana event handlers in order to be able to update the widget when a corresponding catalog item has been updated or deleted.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

getStats()
Return type

PyXmlIO.Element or None

Returns

An XML element containing statistics about the 2D render task that is represented by the catalog item associated with this widget, or None if no valid catalog item has been set for this widget.

setCatalogItem(item)

Sets or resets the catalog item whose render task statistics to show by 2D node name.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose render task statistics to show by 2D node name, or None to reset the catalog item.

statsPresent
updateState()

Clears the tree widget and recreates tree widget items based on the statistics about the 2D render task that is represented by the catalog item associated with this widget, if any.

UI4.Widgets.ProgressWidget

class UI4.Widgets.ProgressWidget

Bases: PyQt5.QtWidgets.QWidget

Class implementing a horizontal progress bar that paints itself in a color that corresponds to one of four pre-defined states.

Variables
  • STATE_NONE – The default state. In this state, the progress bar is painted in gray.

  • STATE_IN_PROGRESS – A state indicating that an operation is in progress. In this state, the progress bar is painted in blue.

  • STATE_CANCELLED – A state indicating that an operation has been cancelled. In this state, the progress bar is painted in yellow.

  • STATE_ERROR – A state indicating that an operation has failed. In this state, the progress bar is painted in red.

Code example:

progressWidget = UI4.Widgets.ProgressWidget()
progressWidget.resize(200, 8)
progressWidget.setFraction(0.74)
progressWidget.setState(UI4.Widgets.ProgressWidget.STATE_CANCELLED)
progressWidget.show()

Example Screenshot:

Screenshot of a ProgressWidget widget

static GetProgressBarColors(state, indefinite=False)
Return type

2-tuple of QtGui.QColor

Parameters
  • state (int) – The state of an operation represented by a progress bar.

  • indefinite (bool) – Flag that states whether the progress bar should indicate an indefinite process.

Returns

The background color and foreground color to use for a progress bar that indicates a process in the given state that is potentially running forever.

STATE_CANCELLED = 2
STATE_ERROR = 3
STATE_IN_PROGRESS = 1
STATE_NONE = 0
__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s state to STATE_NONE and fraction to 0.0.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

getFraction()
Return type

float

Returns

The percentage of progress in the operation represented by the progress bar.

getState()
Return type

int

Returns

The state of the operation represented by the progress bar.

isIndefinite()
Return type

bool

Returns

True if the progress bar indicates a process that keeps running potentially forever, as opposed to after a certain amount of time, otherwise False.

paintEvent(event)

Event handler for paint events for the widget.

A paint event is a request to repaint all or part of a widget.

Paints a line with a width that corresponds to the fraction that is set for the progress widget in a color that corresponds to the state that is set for the progress widget.

Parameters

event (QtGui.QPaintEvent) – The paint event to process.

setFraction(fraction)

Sets the percentage of the progress bar to paint in a brighter color to the given fraction.

Parameters

fraction (float) – The percentage of progress in the operation represented by the progress bar.

setIndefinite(indefinite)

Sets the value of the flag that states whether the progress bar should indicate a process that keeps running potentially forever to the given value, updating the progress bar when the flag’s value has changed.

Parameters

indefinite (bool) – Flag that states whether the progress bar should indicate an indefinite process.

setState(state)

Sets the state of the progress bar the given state, updating the progress bar when the state has changed.

Parameters

state (int) – The state of the operation represented by the progress bar.

sizeHint()
Return type

QtCore.QSize

Returns

The recommended size for the widget, or an invalid size if no size is recommended.

UI4.Widgets.CatalogProgressWidget

class UI4.Widgets.CatalogProgressWidget

Bases: UI4.Widgets.CatalogProgressWidget.ProgressWidget

Class implementing a horizontal progress bar that represents the render progress and render state of a specific catalog item.

Code example:

catalogProgressWidget = UI4.Widgets.CatalogProgressWidget()
catalogProgressWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogProgressWidget.resize(200, 8)
catalogProgressWidget.show()

Example Screenshot:

Screenshot of a CatalogProgressWidget widget

static GetProgressBarColors(catalogItem)
Return type

2-tuple of QtGui.QColor

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item for which to return the colors to use for a progress bar that indicates the given catalog item’s render progress.

Returns

The background color and foreground color to use for a progress bar that indicates the render progress of the given catalog item.

__init__(parent=None)

Initializes an instance of the class.

Sets the instance’s catalog item to None and registers Katana event handlers in order to be able to update the widget when a corresponding catalog item has been updated or deleted.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

setCatalogItem(item)

Sets or resets the catalog item whose render progress and render state to reflect by this catalog progress widget.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose render progress and render state to reflect by this catalog progress widget, or None to reset the catalog item.

UI4.Widgets.CatalogHistogramWidget

class UI4.Widgets.CatalogHistogramWidget

Bases: QT4Color.Histogram.HistogramWidget

Class implementing a histogram widget that shows the histogram of a particular catalog item associated with it.

Code example:

catalogHistogramWidget = UI4.Widgets.CatalogHistogramWidget()
catalogHistogramWidget.setCatalogItem(
    CatalogManager.CatalogItem.CreateCatalogItemFromID('i_1_0'))
catalogHistogramWidget.setRect((284, 378, 326, 408))
catalogHistogramWidget.setColorspace('linear')
catalogHistogramWidget.resize(300, 55)
catalogHistogramWidget.show()

Example Screenshot:

Screenshot of a CatalogHistogramWidget widget

__init__(parent=None)

Initializes an instance of the class.

Parameters

parent (QtWidgets.QWidget or None) – The parent widget to own the new instance. Passed verbatim to the base class initializer.

setCatalogItem(catalogItem)

Sets or resets the catalog item whose histogram to show.

Parameters

catalogItem (CatalogAPI.CatalogItem.CatalogItem or None) – The catalog item whose histogram to show, or None to clear the histogram.

setColorspace(colorspace)

Sets the name of the color space to use when querying histogram data.

Parameters

colorspace (str) – The name of the color space to use when querying histogram data.

setRect(rect)

Sets the rectangle to use when querying histogram data.

Parameters

rect (tuple or list of int) – A sequence of four integers: left, bottom, right, top.