items.asset_items#
Asset items in their simplest sense are file paths made up of server
, job
, root
and asset
components.
1server, job, root, asset = common.active('asset', args=True)
2asset = f'{server}/{job}/{root}/{asset}'
The app considers folders found in the root of a bookmark item assets.
We don’t have any notion of asset types (like how some pipelines make a distinction
between shots and assets), nor do we understand nested assets by default (like a
SEQ010/SH010
structure).
Hint
It is possible to use nested assets with a little workaround. If an asset folder
contains a special .link
file, any relative path defined inside it will be read
and added to the asset items. See get_links()
for
details.
Asset data is queried by AssetItemModel
, and displayed by
AssetItemView
. Any custom logic of how assets are queried should be
implemented in AssetItemModel.item_generator()
.
Asset items have their own bespoke list of attributes, stored in the bookmark item’s
database. See bookmarks.database
for more details.
Classes:
|
The model containing all item information needed to represent assets. |
|
The view used to display |
|
The context menu associated with |
Functions:
Manipulate the given file name to a display friendly name. |
- class bookmarks.items.asset_items.AssetItemModel(parent=None)[source]#
Bases:
ItemModel
The model containing all item information needed to represent assets. Used in conjunction with
AssetItemView
.Methods:
columnCount
(index)Number of columns the model has.
data
(index[, role])Returns and item data associated with the given index.
Model data type.
Returns the default item size.
The custom dictionary key used to save filter settings to the user settings file.
flags
(index)Overrides the flag behaviour to disable drag if the alt modifier is not pressed.
headerData
(self, section, orientation[, role])init_data
(**kwargs)Function wrapper.
item_generator
(path)Yields the asset items to be processed by
init_data()
.Saves the active item.
The model's parent folder path.
- data(index, role=QtCore.Qt.DisplayRole)[source]#
Returns and item data associated with the given index.
- filter_setting_dict_key()[source]#
The custom dictionary key used to save filter settings to the user settings file.
- flags(index)[source]#
Overrides the flag behaviour to disable drag if the alt modifier is not pressed.
- headerData(self, section: int, orientation: PySide2.QtCore.Qt.Orientation, role: int = PySide2.QtCore.Qt.ItemDataRole.DisplayRole) Any [source]#
- init_data(**kwargs)#
Function wrapper.
- item_generator(path)[source]#
Yields the asset items to be processed by
init_data()
.- Yields:
DirEntry – Entry instances of valid asset folders.
- class bookmarks.items.asset_items.AssetItemView(parent=None)[source]#
Bases:
ThreadedItemView
The view used to display
AssetItemModel
item.Classes:
alias of
AssetItemViewContextMenu
alias of
AssetItemViewDelegate
Methods:
adapt_horizontal_header
(*args, **kwargs)Slot connected to the resized signal is used to hide the progress columns when the window size is small.
add_item_action
(index)Action to execute when the add item icon is clicked.
edit_item_action
(index)Action to execute when the edit item icon is clicked.
Returns an informative hint text.
Returns the model class associated with this view.
init_model
(*args, **kwargs)The methods responsible for connecting the associated item model with the view.
Tweaks the horizontal header.
Restore the previous state of the inline icon buttons.
Inline buttons count.
mouseReleaseEvent
(event)Concludes InlineIconView's multi-item toggle operation, and resets the associated variables.
set_progress_hidden
(val)Sets the visibility of the progress tracker columns.
showEvent
(event)Show event handler.
- ContextMenu#
alias of
AssetItemViewContextMenu
Methods:setup
()Creates the context menu.
- Delegate#
alias of
AssetItemViewDelegate
Methods:paint
(painter, option, index)Paints a
bookmarks.items.asset_items.AssetItemView
item.sizeHint
(option, index)Returns the item's size hint.
Attributes:
fallback_thumb
The item's default thumbnail image
- adapt_horizontal_header(*args, **kwargs)[source]#
Slot connected to the resized signal is used to hide the progress columns when the window size is small.
- init_model(*args, **kwargs)[source]#
The methods responsible for connecting the associated item model with the view.
Restore the previous state of the inline icon buttons.
- mouseReleaseEvent(event)[source]#
Concludes InlineIconView’s multi-item toggle operation, and resets the associated variables.
The inline icon buttons are also triggered here. We’re using the delegate’s
get_rectangles
function to determine which icon was clicked.
Sets the visibility of the progress tracker columns.
- class bookmarks.items.asset_items.AssetItemViewContextMenu(index, parent=None)[source]#
Bases:
BaseContextMenu
The context menu associated with
AssetItemView
.Methods:
setup
()Creates the context menu.