mari.system

Contains larger chunks of standard Mari functionality.

Script to bake the current paint buffer into a new channel.

mari.system.bake_new_layer.bakeOnNewLayer()

Create a new layer and bake the paint buffer onto it.

Bakery Dialog Mari scripts.

class mari.system.bakery_dialog.AddMeshFromObjectDialog(parent=None)

Bases: QDialog

Dialog for adding meshes from objects in Mari.

__init__(parent=None)

Initialize this instance.

setModel(model)

Set the tree view model and expand all rows.

staticMetaObject = PySide6.QtCore.QMetaObject("AddMeshFromObjectDialog" inherits "QDialog": )
class mari.system.bakery_dialog.AlwaysSelectedTableView(parent=None)

Bases: QTableView

Table view that keeps at least one row selected.

__init__(parent=None)

Initialize this instance.

selectionChanged(selected, deselected)

Ignore deselection to keep at least one row selected.

staticMetaObject = PySide6.QtCore.QMetaObject("AlwaysSelectedTableView" inherits "QTableView": )
class mari.system.bakery_dialog.BakeItemModel(parent=None)

Bases: QStandardItemModel

BakeItemModel.

__init__(parent=None)

Initialize this instance.

addFromDisk(row, path)

Add from disk.

addRenderItem(payload, presetData={})

Add a bake recipe or BakeItem row to the render list.

bakeItemChanged
createBakeItem(name, checkState=CheckState.Checked)

Create a checkable editable bake item with name and state.

createBakeItemData(recipe, presetData={})

Create a BakeItem from a recipe and optional preset data.

createGeoItem(geo)

Create a non-selectable tree item for a geometry entity.

createMeshPathParent()

Create a non-selectable parent item for high-res mesh paths.

createNewHiResMeshItem(name, checkState=CheckState.Checked)

Create a checkable item representing a high-res mesh path.

createPathsTree(presetData={})

Build a tree of high-res mesh file paths from preset data.

createVersionItem(version)

Create a checkable tree item for a geometry version.

createVersionTree(presetData=[])

Build a version tree with all project geo entities.

getBakeFromDiskMeshes(row)

Return bake from disk meshes.

getBakeFromItems(row)

Return bake from items.

getBakeFromVersions(row)

Return bake from versions.

getBakeItemsList()

Return bake items list.

getBakeParametersDict(bakeItem)

Return bake parameters dict.

getBakeToItems(row)

Return bake to items.

getGeoVersionData(bakeFromItem)

Return disk mesh paths and their checked states for the row.

getVersionsFromProject(loadedData=[])

Return versions from project.

setData(index, value, role=ItemDataRole.EditRole)

Set data.

staticMetaObject = PySide6.QtCore.QMetaObject("BakeItemModel" inherits "QStandardItemModel": Methods:   #79 type=Signal, signature=bakeItemChanged(QStandardItem*,int), parameters=QStandardItem*, int )
class mari.system.bakery_dialog.BakerDialog(parent=None)

Bases: QDialog

Main UI Dialog.

__init__(parent=None)

Initialize this instance.

staticMetaObject = PySide6.QtCore.QMetaObject("BakerDialog" inherits "QDialog": )
class mari.system.bakery_dialog.BakerWidget(parent)

Bases: QWidget

BakerWidget.

__init__(parent)

Initialize this instance.

acceptParentDialog()

Call the parent dialog accept function if present.

addFromDisk()

Add from disk.

addRenderItem(payload, presetData={})

Add render item.

applyUpdatedBakeCageSettings()

Apply updated bake cage settings.

bakeSetEnabled
buildBakeParams(bakeItem)

Build bake params.

clearBakeFrom()

Clear bake from.

clearBakeTo()

Clear bake to.

clearPreview()

Clear preview.

clearTempGeoEntities()

Clear temp geo entities.

copyLowResToHiRes()

Copy low res to hi res.

currentPreviewData()

Return current preview data.

currentRow()

Return current row.

deletePressed
devices()

Return devices.

disableAddMesh()

Disable add mesh.

enableAddMesh()

Enable add mesh.

escapePressed
forceUpdatePreview()

Force update preview.

getBakeItemAndGeoVersions(renderItemRow)

Return bake item and geo versions.

getBakerPreviewSettings(bakerSettings)

Return baker preview settings.

getBakerSettings(bakerSettings)

Return baker settings.

getGlobalSettingsDict()

Return global settings dict.

globalModeCheckBoxChanged(newState)

Handle global mode checkbox changed event.

initPreview()

Initialize the preview.

keyPressEvent(event)

Return key press event.

loadBakeList(bakeItemsList)

Load bake list from stored settings.

loadButtonState(button, buttonKey, guiState)

Load button state from stored settings.

loadComboBoxState(comboBox, comboBoxKey, guiState)

Load combo box state from stored settings.

loadDeviceSelection(globalSettings)

Load device selection from stored settings.

loadGlobalSettings(project)

Load global settings from stored settings.

loadPresets(path=None)

Load presets from stored settings.

loadRenderSettings(project)

Load render settings from stored settings.

onBake()

Handle bake event.

onBakeDataChanged(_=None)

Bake data changed event.

onCageDistanceFieldChanged()

Cage distance field changed event.

onCancel()

Handle cancel event.

onClose()

Handle close event.

onExportPathLookupButtonPressed()

Prompts the user to choose a export root path and set it as the text of the export root path combo box.

onHighPolySearchModeComboBoxChanged()

High poly search mode combo box changed event.

onPreviewPauseToggled(paused)

Preview pause toggled event.

onProgressError(error)

Handle progress error event.

onProgressIncrement()

Handle progress increment event.

onProgressStart(name, maximum)

Handle progress start event.

onProgressStop()

Handle progress stop event.

placeholderBakeItem()

Return placeholder bake item.

removeRenderItem()

Remove render item.

removeSelectedMesh()

Remove selected mesh.

renderListColumns

Connect signals

requestPreview()

Perform request preview operation.

saveDeviceSelection()

Save device selection to stored settings.

saveGlobalSettings(globalSettings, project)

Save global settings to stored settings.

savePresets(path=None)

Save presets to stored settings.

saveRenderSettings(renderSettings, project)

Save render settings to stored settings.

setBakeItemCageSettings(bakeItemData)

Set bake item cage settings.

setGlobalMeshSelect(globalSelect)

Set global mesh select.

staticMetaObject = PySide6.QtCore.QMetaObject("BakerWidget" inherits "QWidget": Methods:   #34 type=Signal, signature=bakeSetEnabled(bool), parameters=bool   #35 type=Signal, signature=escapePressed()   #36 type=Signal, signature=deletePressed() )
uncheckChildren(parentItem=None)

Perform uncheck children operation.

updateBakeParams(currentIdx, previousIdx)

Update bake params.

updateHideMessage(newState)

Update hide message.

updateMeshView(currentIdx)

Update mesh view.

updatePreview()

Update preview.

updateSelectedItems(item: QStandardItem, role)

Update selected items.

class mari.system.bakery_dialog.ComboBoxDelegate(parent, comboBoxItems)

Bases: QStyledItemDelegate

Delegate for editing item names with a combo box.

__init__(parent, comboBoxItems)

Initialize this instance.

createEditor(parent, option, index)

Create a combo box editor populated with predefined items.

setModelData(editor, model, index)

Update the model and bake item with the selected combo value.

staticMetaObject = PySide6.QtCore.QMetaObject("ComboBoxDelegate" inherits "QStyledItemDelegate": )
updateEditorGeometry(editor, option, index)

Set the editor geometry to match the item cell rectangle.

class mari.system.bakery_dialog.LineEditDelegate(parent)

Bases: QStyledItemDelegate

Delegate for editing item names with a line edit.

__init__(parent)

Initialize this instance.

setModelData(editor, model, index)

Update the model with the edited item name from the editor.

staticMetaObject = PySide6.QtCore.QMetaObject("LineEditDelegate" inherits "QStyledItemDelegate": )
mari.system.bakery_dialog.addButtonToToolbar()

Add button to toolbar.

mari.system.bakery_dialog.debugLog(msg)

Log debug message to Mari log and console.

mari.system.bakery_dialog.showDialog()

Show dialog.

Base Item Model Classes.

class mari.system.base_item_model.BaseItem(parent=None)

Bases: object

BaseItem should be sub-classed to represent an item in a Qt item model hierarchy.

COLUMN_COUNT = 1
__init__(parent=None)

Initialize this instance.

addChildItem(item, atIndex=None)

Add child item.

Inserts the specified item instance into the child items data member at the specified index, then clears the child count cache.

Parameters:
  • item (object) – Item instance to add as child

  • atIndex (int) – Index to insert item at in child list (Default value = None)

childCount(forceLoad=False)

Return the cached amount of present child items of this instance.

If the forceLoad kwarg is specified, the cache is refreshed before being repopulated and returned.

Parameters:

forceLoad (bool) – Force the load (Default value = False)

Returns:

int – Amount of child items

clear()

Clear the item of its children.

This is done by first making the parent data model emit the remove rows signals in order for the model indicies to be removed as well as the item’s child item instances.

columnCount()

Return the value of BaseItem class’s COLUMN_COUNT data member.

Returns:

int – Amount of columns

data(column=0, role=ItemDataRole.DisplayRole)

Stub for method called when getting data on the model.

Function should return the data for the specified column index and data role.

Parameters:
  • column (int) – Column to get data from (Default value = 0)

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

object – Item data

flags(column)

Stub for method called when requesting the ItemFlags for this instance of the BaseItem class.

This method should be re-implemented.

Parameters:

column (int) – Column to return data for

Returns:

QtCore.Qt.ItemFlags – Flags for this item

getChildItemAtIndex(index)

Return the child item at the specified index.

Parameters:

index (int) – Index of child item required

Returns:

object – Child item

getIndexOfChildItem(childItem)

Return the index of the specified child item.

If the specified child item is not a child of this item, -1 is returned.

Parameters:

childItem (BaseItem) – Child item to get index of

Returns:

int – Index of child item

hasChildItems()

Check if this item has child items.

This function should be overloaded in order to implement per model lazy loading.

Returns:

bool – Item has child items

iterChildItems()

Yield all child items.

Returns:

BaseItem – Child items

loadChildItems()

Stub for method called when initially building model hierarchy.

property model

(QAbstractItemModel) Walks up the hierarchy and returns the data model.

modelIndex(column=0)

Return the model index of the specified column of this item.

Parameters:

column (int) – Column to get model index of (Default value = 0)

Returns:

QModelIndex – Model index of this item and column

property parentItem

(BaseItem) Parent item of this child item instance.

reset()

Replace the child items data member with None.

This will cause the data model to trigger a repopulation of this items children.

setValue(value, column=0)

Stub for method called when setting data on the model.

This method should be re-implemented with code to set the specified value at the specified column, then to return whether or not the data was changed.

Parameters:
  • value (object) – Value to set at column

  • column (int) – Column index where to set value (Default value = 0)

Returns:

bool – Success result

class mari.system.base_item_model.BaseItemModel(parent=None)

Bases: QAbstractItemModel

Base item model to house boiler plate data model functions.

__init__(parent=None)

Initialize this instance.

batchSetData(indices, value, role=ItemDataRole.EditRole)

Set the data of the specified indices to the specified value.

Parameters:
  • indices (list) – Indices to edit

  • value (variant) – Value to set across all indices

  • role (Qt.ItemDataRole) – Qt Item data Role. (Default value = core.Qt.EditRole)

Returns:

Qt.ItemDataRole – Complete success

columnCount(parent=None)

Re-implement from QAbstractItemModel.

Returns the result from the parent index’s represented item’s columnCount method.

Parameters:

parent (QModelIndex) – Index of parent item (Default value = None)

Returns:

int – Column count

data(index, role=ItemDataRole.DisplayRole)

Re-implement from QAbstractItemModel.

Returns the data for the specified model index and data role.

Parameters:
  • index (QModelIndex) – Model index of item to extract data from

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

object – Item data

flags(index)

Return the flags for the specified model index.

Parameters:

index (QModelIndex) – index

Returns:

QtCore.Qt.ItemFlags – Flags for model items

getItemFromIndex(index)

Get the item instance for the specified index.

In the event of an invalid index, the root item instance is returned.

Parameters:

index (QModelIndex) – Index to item to return

Returns:

BaseItem – Instance of object that QModelIndex points to

index(row, column, parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)

Re-implement from QAbstractItemModel.

Returns a QModelIndex for the specified row, column and parent index.

Parameters:
  • row (int) – Row index

  • column (int) – Column index

  • parent (QModelIndex) – Parent model index (Default value = core.QModelIndex())

Returns:

QModelIndex – Model index of row, column

parent(index)

Re-implement from QAbstractItemModel.

Returns the model index of the parent item at the specified model index.

Parameters:

index (QModelIndex) – Model index of child item

Returns:

QModelIndex – Parent item’s model index

rowCount(parent=None)

Re-implement from QAbstractItemModel.

Returns the result from the parent index’s represented item’s rowCount method.

Parameters:

parent (QModelIndex) – Index of parent item (Default value = None)

Returns:

int – Row count

setData(index, value, role=ItemDataRole.EditRole)

Re-implement from QAbstractItemModel.

If setting new data is successful, a data changed signal is emitted for the entire row the item at the specified index represents.

Parameters:
  • index (QModelIndex) – Index where the data will be set.

  • value (object) – Value to set at index.

  • role (Qt.ItemDataRole) – Qt Item data Role. (Default value = core.Qt.EditRole)

Returns:

bool – Setting new data was successful

staticMetaObject = PySide6.QtCore.QMetaObject("BaseItemModel" inherits "QAbstractItemModel": )
class mari.system.base_item_model.BaseItemModelProxy(model, parent=None)

Bases: QSortFilterProxyModel

Base class for models.

__init__(model, parent=None)

Initialize this instance.

getItemFromIndex(index)

Get the item instance for the specified index from the source model.

In the event of an invalid index, the root item instance is returned.

Parameters:

index (QModelIndex) – Index to item to return

Returns:

BaseItem – Instance of object that QModelIndex points to

property model

(BaseItemModel) Returns the source model.

staticMetaObject = PySide6.QtCore.QMetaObject("BaseItemModelProxy" inherits "QSortFilterProxyModel": )

Batch Export Dialog Mari scripts.

class mari.system.batch_export_dialog.AddExportItemDialog(geoEntity, parent=None)

Bases: QDialog

Dialog to allow the creation of additional Export Items to the manager.

__init__(geoEntity, parent=None)

Initialize this instance.

findBakePointNodes(nodeGraph, bakePointList, channelNodeSet, visited)

Find Bake Point nodes.

Recursive function to populates the given bake point list with Bake Point nodes found in the specified node graph.

Parameters:
  • nodeGraph (mari.NodeGraph) – Node graph to walk

  • bakePointList (list) – List of found Bake Point nodes

  • channelNodeSet (set) – Set of found Channel nodes

  • visited (set) – Cache of nodes already inspected

selectedNodes()

Return the nodes selected in the Channel and Bake Point list widgets.

Returns:

list of mari.Node – Nodes selected in the UI

staticMetaObject = PySide6.QtCore.QMetaObject("AddExportItemDialog" inherits "QDialog": )
class mari.system.batch_export_dialog.ComboBoxDelegate

Bases: QStyledItemDelegate

Generic combo box delegate for editing properties of an Export Item.

createEditor(parent, option, index)

Re-implemented from QStyledItemDelegate.

Creates the appropriate widget depending on the model index column.

Parameters:
  • parent (QWidget) – Parent widget for delegate widget

  • option (QStyleOptionViewItem) – Parameters to draw an item in a view widget.

  • index (QModelIndex) – Index of model that this delegate is to edit

Returns:

QWidget – Delegate widget for data editing

finishEdit()

Triggerd on editor combo box current index changed, emits all relevant signals to finish editing.

setEditorData(editor, index)

Re-implemented from QStyledItemDelegate.

Configures the specified editor widget with data from the specified model index.

Parameters:
  • editor (QWidget) – Delegate widget for data editing.

  • index (QModelIndex) – Index of model that this delegate widget is to edit

setModelData(editor, model, index)

Re-implemented from QStyledItemDelegate.

Pushes data to the specfied data model from the given editor widget for the specified model index.

Parameters:
  • editor (QWidget) – Delegate widget for data editing.

  • index (QModelIndex) – Data model to push edited data to.

  • index – Index of model that this delegate widget is to edit.

staticMetaObject = PySide6.QtCore.QMetaObject("ComboBoxDelegate" inherits "QStyledItemDelegate": )
updateEditorGeometry(editor, option, index)

Re-implemented from QStyledItemDelegate.

Updates the delegate editing widget geometry using the given options.

Parameters:
  • editor (QWidget) – Parent widget for delegate widget

  • option (QStyleOptionViewItem) – Parameters to draw an item in a view widget.

  • index (QModelIndex) – Index of model that this delegate is to edit

class mari.system.batch_export_dialog.ExportDialog(parent=None)

Bases: QDialog

Parent dialog for the main Export Manager widget.

__init__(parent=None)

Initialize this instance.

addTabWidgets()

Add tab widgets to the dialog if any are specified.

closeEvent(event)

Re-implemented from QWidget.

Calls the save on close function of the main widget on close event.

Parameters:

event (QEvent) – Close event

closeTabWidgets()

Call the onCloseTab function for each tab widget if it exists.

staticMetaObject = PySide6.QtCore.QMetaObject("ExportDialog" inherits "QDialog": )
class mari.system.batch_export_dialog.ExportItemFilterModel(parent=None)

Bases: QSortFilterProxyModel

Filter model for the Export Item model to hide certain items from the view.

__init__(parent=None)

Initialize this instance.

filterAcceptsRow(sourceRow, sourceParent)

Re-implemented from QSortFilterProxyModel.

itemVisible(item)

Return True if the given item is visible in the filter model, False otherwise.

staticMetaObject = PySide6.QtCore.QMetaObject("ExportItemFilterModel" inherits "QSortFilterProxyModel": )
class mari.system.batch_export_dialog.ExportItemModel(geoEntities, view)

Bases: QAbstractItemModel

Data model for managing the editing of Export Item instances in Mari’s Export Manager.

__init__(geoEntities, view)

Initialize this instance.

columnCount(parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)

Re-implemented from QAbstractItemModel.

Returns the count of child columns for the given model index

Parameters:

parent (QModelIndex) – Data model index to query child row count for (Default value = core.QModelIndex())

Returns:

int – Count of columns for a given model index

data(index, role)

Re-implement from QAbstractItemModel.

Returns the data for the specified model index and data role.

Parameters:
  • index (QModelIndex) – Model index of item to extract data from

  • role (int) – Data role

Returns:

variant – Item data

exportItemList(geoEntity)

Update the internal cache of Export Items for the given GeoEntity and return the list.

Parameters:

geoEntity (mari.GeoEntity) – GeoEntity to query related Export Items

Returns:

list of mari.ExportItem – List of Export Items for a given GeoEntity

flags(index)

Re-implemented from QAbstractItemModel.

Returns the flags for the given model index

Parameters:

index (QModelIndex) – Data model index to query flags for

Returns:

ItemFlags – Item flags for a given model index

generateTokenTemplateTooltip(AddExtra)

Get the text for the token template tooltip with the option of adding extra tokens for post process syntax.

Parameters:

AddExtra (bool) – Include tokens for post process syntax

Returns:

str – Token template tooltip text

headerData(section, orientation, role)

Re-implemented from QAbstractItemModel.

Returns the data for the header at the given section, orientation and role

Parameters:
  • section (int) – Section index

  • orientation (int) – Orientation indentifier

  • role (int) – Data role required

Returns:

variant – Header data for a specific section, orientation and role

index(row, column, parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)

Re-implemented from QAbstractItemModel.

Returns a QModelIndex for the given row, column and parent index.

Parameters:
  • row (int) – Desired row index

  • column (int) – Desired column index

  • parent (QModelIndex) – Parent model index (Default value = core.QModelIndex())

Returns:

QModelIndex – Child model index of row, column and parent

onDataChanged()

Triggered by data or layout changing. Calls for a status update.

parent(index)

Re-implemented from QAbstractItemModel.

Returns the model index of the parent item of the given model index.

Parameters:

index (QModelIndex) – Model index of child item

Returns:

QModelIndex – Parent item’s model index

rowCount(parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)

Re-implemented from QAbstractItemModel.

Returns the count of child rows for the given model index

Parameters:

parent (QModelIndex) – Data model index to query child row count for (Default value = core.QModelIndex())

Returns:

int – Count of rows for a given model index

setData(index, value, role)

Re-implementation from QAbstractItemModel.

If setting new data is successful, a data changed signal is emitted for the entire row the item at the specified index represents.

Parameters:
  • index (QModelIndex) – Index where the data will be set.

  • value (variant) – Value to set at index.

  • role (Qt.ItemDataRole) – Qt Item data Role.

Returns:

bool – Setting new data was successful

setFilterModel(filterModel)

Set the filter model for this data model.

staticMetaObject = PySide6.QtCore.QMetaObject("ExportItemModel" inherits "QAbstractItemModel": )
updateStatus(checkCollisionAcrossObjects=False)

Iterate over all Export Item rows in the data model and validate and update their status.

Parameters:

checkCollisionAcrossObjects (bool) – Include checks for collisions across GeoEntities (Default value = False)

class mari.system.batch_export_dialog.ExportManagerView(parent=None)

Bases: QTableView

Table view for the Export Item model.

__init__(parent=None)

Initialize this instance.

checkSelected()

Set the currently selected Export Item row checkstate to checked.

onCustomContextMenuRequested(pos)

Build a contextual menu for the index where the user right-clicked.

Parameters:

pos (QPoint) – Position of pointer at context menu request

selectionChanged(selected, deselected)

Re-implemented from QAbstactItemView to handle workaround of Qt bug : 39008.

setCheckStatus(checked)

Set the currently selected Export Item row checkstate to checked or unchecked.

setContextMenuActions(actions)

Set the context menu actions specific to the parent widget.

staticMetaObject = PySide6.QtCore.QMetaObject("ExportManagerView" inherits "QTableView": )
uncheckSelected()

Set the currently selected Export Item row checkstate to unchecked.

class mari.system.batch_export_dialog.ExportWidget(parent)

Bases: QWidget

Main Export Manager UI widget.

__init__(parent)

Initialize this instance.

acceptParentDialog()

Call the parent dialog accept function if present.

currentGeoEntity()

Return the GeoEntity currently active in the object name combo box.

Returns:

mari.GeoEntity – Current selected GeoEntity

exportRootPath()

Return the root path for exporting textures.

Returns:

root_path (str) – The root path for exporting textures.

exportSelected()

Export the currently selected items.

getOverrides()

Return a dictionary of overrides from the various UI elements.

Returns:

dict – Override name key and override data values

itemsHaveOverwriteWarnings(exportItems)

Check if any Export Items in the given list have an overwrite warning associated with them.

Parameters:

exportItems (list of mari.ExportItem) – Export Items to check for overwrite warnings

Returns:

bool – Are overwrite warnings present

loadRootPaths()

Return the history of root paths from the user preferences.

Returns:

list of str – Root path history

onAddExportItemButtonPressed()

Prompt the user to pick sources for new Export Items.

Then populate the export item table with new rows and validate the initial file name template.

onCloseTab()

Call the onCloseTab function for each tab widget if it exists and save the root paths.

onCustomContextMenuRequested(pos)

Build a contextual menu for the index where the user right-clicked.

Parameters:

pos (QPoint) – Position of pointer at context menu request

onExportAllButtonPressed()

Export items for all objects in the manager.

onExportCurrentObjectButtonPressed()

Export the items of the currently active object.

onExportRootPathLookupButtonPressed()

Prompts the user to choose a export root path and set it as the text of the export root path combo box.

onLoadExportSettingsButton()

Prompts the user for an XML encoded file with a mei extension.

Then deserializes the data and injects it into the export manager table data.

onObjectNameComboBoxCurrentIndexChanged(index)

Change the export item view root index to match the one given.

Parameters:

index (int) – Current index of object picker combo box

onSaveAndClosePressed()

Save the root paths to user preferences and then call accept on the parent dialog.

onSaveExportSettingsButton()

Serialize the current table data and save it to an XML-encoded file with a .mei extension.

removeSelected()

Remove the currently selected Export Items from the manager table.

saveRootPaths()

Save the current root path history into the user preferences.

staticMetaObject = PySide6.QtCore.QMetaObject("ExportWidget" inherits "QWidget": )
class mari.system.batch_export_dialog.FileOptionsDialog(fileExtensions, parent=None)

Bases: QDialog

Dialog to acquire the file options the users wants for export.

__init__(fileExtensions, parent=None)

Initialize this instance.

getFileExtension()

Return the file extension name from the file extension combo box if available.

Returns:

str – File extension name from the file extension combo box

getFileOptions(file_extension)

Return the dictionary of image file options for the given file extension.

Parameters:

file_extension (str) – File extension

Returns:

dict – Image file type options

getSaveOptions()

Return the dictionary of save options from the UI.

Returns:

dict – Save options

onFileExtensionComboBoxCurrentTextChanged(text)

Update the UI elements when the file extension changes.

Parameters:

text (str) – New file extension name

restoreOriginalFileOptions()

Restores the original global file options state.

This should be called when the dialog is cancelled to prevent the Export Item’s options from affecting the global state.

setFileOptions(item)

Load the Export Item’s file options into the global export options manager.

This ensures the dialog displays the Export Item’s current settings rather than the last-used global settings.

Parameters:

item (mari.ExportItem) – Export Item with source file options to load.

setSaveOptions(item)

Configure the UI elements to match the save options of the specified Export Item.

Parameters:

item (mari.ExportItem) – Export Item with source data to populate Save Options UI elements with.

staticMetaObject = PySide6.QtCore.QMetaObject("FileOptionsDialog" inherits "QDialog": )
mari.system.batch_export_dialog.addButtonToToolbar()

Add the Export Manager toolbar button to the Project toolbar.

mari.system.batch_export_dialog.debugLog(message)

Wrap message in a Export Manager specific log message.

mari.system.batch_export_dialog.deregisterCustomTabWidgetCallback(tab_name)

Deregister a custom tab widget callback.

mari.system.batch_export_dialog.fileExtension(fileTemplate)

Return the name of the file extension specified.

Parameters:

fileTemplate (str) – Filename template

Returns:

str – Name of file extension

mari.system.batch_export_dialog.loadListValueFromSettings(setting_path)

Read the value from the given settings location and ensures there are no empty or duplicate values in the list.

Parameters:

setting_path (str) – Location of setting

Returns:

list. Values at setting location

mari.system.batch_export_dialog.registerCustomTabWidgetCallback(tab_name, tab_widget_callback)

Register a custom tab widget callback.

mari.system.batch_export_dialog.replaceExtension(fileTemplate, extension)

Return the specified filename template with the file extension replaced by the one specified.

Parameters:
  • fileTemplate (str) – Filename template

  • extension (str) – File extension

Returns:

str – Filename template with replace extension

mari.system.batch_export_dialog.resolveSourceIndex(index)

Return the index of the source model if the index belongs to a proxy model.

Parameters:

index (QModelIndex) – Index to resolve

Returns:

QModelIndex – Either the same or source index

mari.system.batch_export_dialog.showExportDialog()

Show the Export Manager dialog.

Shared Device Selection Widgets for Mari Bakery/Transfer UIs.

class mari.system.device_selection.DeviceListModel(parent=None)

Bases: QStandardItemModel

Model representing available compute devices for baking.

Rows are either a single non-checkable item (0/1 device case) or multiple checkable items (multi-device case). Disabled when no devices.

__init__(parent=None)

Initialize this instance.

applySelection(deviceNames: list) → None

Apply a selected device list to the model (multi-device only).

fillFromMari() → None

Populate the model with the current list of devices from Mari.

hasAnyDevices() → bool

Return True if there is at least one enabled device in the model.

hasMultipleDevices() → bool

Return True if there are multiple devices in the model.

selectedDeviceNames() → list

Return a list of selected device names.

singleDeviceNameOrWarning() → str

Return the single device name, or a warning if no devices.

staticMetaObject = PySide6.QtCore.QMetaObject("DeviceListModel" inherits "QStandardItemModel": )
class mari.system.device_selection.DevicePickerDialog(parent=None)

Bases: QDialog

Dialog for selecting devices from a list.

__init__(parent=None)

Initialize this instance.

setModel(model: QStandardItemModel) → None

Set the model for the list view.

staticMetaObject = PySide6.QtCore.QMetaObject("DevicePickerDialog" inherits "QDialog": )
class mari.system.device_selection.DeviceSelector(parent=None)

Bases: QObject

Controller that injects device selection UI into an existing layout.

Avoids adding an extra container widget by creating either a QLabel or a QPushButton directly in the provided layout.

__init__(parent=None)

Initialize this instance.

addToLayout(layout: QHBoxLayout) → None

Add the device UI directly to the given layout.

Caller is responsible for any additional spacers/stretches.

applySelection(deviceNames: list) → None

Apply the given list of device names as the current selection.

selectedDeviceNames() → list

Return a list of selected device names.

selectionChanged
setEnabled(enabled: bool) → None

Enable/disable the injected widgets (label/button and optional count label).

setLabelMinimumHeight(minimumHeight: int) → None

If the injected main widget is a QLabel, set its minimum height.

This helps align the label vertically with adjacent controls (e.g., buttons). No-op when the main widget is a QPushButton.

staticMetaObject = PySide6.QtCore.QMetaObject("DeviceSelector" inherits "QObject": Methods:   #5 type=Signal, signature=selectionChanged(QVariantList), parameters=QVariantList )

Script to turn on Mari’s command port (e.g. for when launching Mari from Nuke).

Material Ingest Core fuctions.

class mari.system.material_ingest.TextureSet(shader_model)

Bases: object

TextureSet class.

Container class for mapping of source texture set image paths to their associated stream and other data to help construct a material in Mari

STREAM_COLOR = 0
STREAM_ENABLED = 1
STREAM_IMAGE_PATH = 2
STREAM_PATTERNS = 3
__init__(shader_model)

Initialize this instance.

static from_dict(texture_set_data)

Create a TextureSet instance from the given data dictionary.

The dictionary needs to match the following structure

{
    "shader_model": "Principled BRDF", # Shader Model ID
    "name": "materialToCreate", # Name of Material to create
    "stream_enabled": { # Dict of stream enabled states
        "BaseColor": True, # bool enabled state of stream
    },
    "stream_colors": { # Dict of stream default colors
        "BaseColor": [0.5, 0.5, 0.5, 1.0], # list of stream RGBA float values
    },
    "stream_image_paths": { # Dict of stream image paths
        "BaseColor": "/path/to/baseColor.exr", # str path to stream texture file
    },
    "stream_naming_patterns": { # Dict of stream naming patterns
        "BaseColor": ["diff", "col"], # list of str naming patterns to search with
    },
}
Parameters:

texture_set_data (dict) – TextureSet data dictionary

Returns:

TextureSet – New TextureSet instance

getStreamData(stream_name, data_type)

Get stream data.

Validates the stream then returns the value of the stream within the dict associated with the specified data type.

Parameters:
  • stream_name (str) – Stream name

  • data_type (int) – Type of stream data to set

Returns:

variant – Stream data

iterStreams(enabled_only=False)

Iterate streams.

Generator that yields all mari.ShaderModelInput instances contained within the mari.ShaderModel instance this class was initialised with.

Parameters:

enabled_only (bool) – Only return streams tagged as enabled (Default value = False)

Returns:

mari.ShaderModelInput – Streams of Shader Model

property name

(str) Name of Texture Set.

printContents()

Print the Texture Set name and found image paths to the console for debugging.

setName(name)

Set the name of the Texture Set.

Parameters:

name (str) – Texture Set name

setStreamData(stream_name, data_type, value)

Validate the stream and set the specified value into the dict associated with the specified data type.

Parameters:
  • stream_name (str) – Stream name

  • data_type (int) – Type of stream data to set

  • value (variant) – Data to set against stream

setThumbnail(thumbnail)

Set the thumbnail of the Texture Set.

Parameters:

thumbnail (str) – Thumbnail of Texture Set

property shaderModel

(mari.ShaderModel) Shader Model of Texture Set.

property thumbnail

(str) Thumbnail path of Texture Set.

to_dict()

Return the contents of the class instance as a dictionary.

Returns:

dict – Dictionary representation of data

mari.system.material_ingest.createMaterialFromTextureSet(texture_set, procedural_type, material_template=None, status_callback=None, interupt_callback=None)

Create a material from a TextureSet.

Creates a Material node from the given TextureSet and creates procedural nodes of the specified type. The images contained within the TextureSet are then imported, set up as scalar depending on its stream attribute then set on the procedurals image attributes. If a stream is enabled an no image path is defined, the stream Color will populate a generated procedural node based on the following critera:

Color - If the stream is non-scalar Constant - If the stream is scalar and the RGB values are identical Vector - If the stream is scalar and the RGB values are unique

Various attributes on the procedural nodes that take images as inputs shall be promoted as knobs and linked together with procedural nodes from sibling streams.

Tiled - Both repeat U and V attributes are promoted as well as rotation. Tri-Planar - All attributes named in the TRI_PLANAR_PROJECTION_ATTRIBUTES constant are promoted and linked.

Once the Material has been constucted, its node and list of mari.Image instances loaded into the project are returned.

Parameters:
  • texture_set (TextureSet) – Texture set to create a Material from

  • procedural_type (int) – Procedural type to build

  • material_template (str) – Path to the material file to use as template (Default value = None)

  • status_callback (callable) – Function to send status updates to (Default value = None)

  • interupt_callback (callable) – Function to check if process interupt triggered (Default value = None)

Returns:

mari.GroupNode – Resuting Material node

mari.system.material_ingest.duplicateTextureSet(reference_texture_set)

Create and return a copy of the specified reference TextureSet.

Parameters:

reference_texture_set (TextureSet) – Reference to duplicate

Returns:

TextureSet – Duplicate TextureSet

mari.system.material_ingest.findTextureSetImages(root_path, texture_set_template, filename_templates, thumbnail_template='', case_sensitive=True, status_callback=None, interupt_callback=None)

Find texture set images.

Function to walk the specified root path and use the given template to attempt to identify texture sets. If patterns are matched the specified Texture Set template is duplicated and populated then added to a list of found TextureSets and returned.

Parameters:
  • root_path (str) – Root path to search from

  • texture_set_template (TextureSet) – Preconfigured Texture Set to duplicate and populate

  • filename_templates (list of str) – Filename templates to use in pattern recognition

  • thumbnail_template (str) – Template to use for finding thumbnails (Default value = “”)

  • case_sensitive (bool) – Use case sensitivity during search (Default value = True)

  • status_callback (callable) – Function to send status updates to (Default value = None)

  • interupt_callback (callable) – Function to check if process interupt triggered (Default value = None)

Returns:

list – Found texture sets

mari.system.material_ingest.findThumbnailFile(pattern, root_path, name, case_sensitive)

Find and return the thumbnail file path specified by the pattern.

Parameters:
  • pattern (str) – Thumbnail file pattern

  • root_path (str) – Root path to search from

  • name (str) – Name to replace the NAME token in the pattern

  • case_sensitive (bool) – Whether to match the pattern case sensitive

Returns:

str – Thumbnail file path

mari.system.material_ingest.generateSupportedImageExtensionList()

Return a list of supported image file extensions from the mari.ExportManager instance.

mari.system.material_ingest.getFilePathToMatch(filename, root_path_parts, path_part_count)

Get file path to match.

Returns a file path string with the specified count of parent folders appended to the start of the given filename.

Parameters:
  • filename (str) – Filename to append parent folders to

  • root_path_parts (list) – List of folder name parts of the filename’s root path

  • path_part_count (int) – Amount of parent folders to append to filename

Returns:

str – File path to use with pattern matching

mari.system.material_ingest.getPathPartCount(filename_template)

Count the number of part separators in the given filename template.

Parameters:

filename_template (str) – Filename template used in pattern recognition

Returns:

int – Amount of path separators found in template

mari.system.material_ingest.getTextureFilenamePattern(template, stream_name_patterns, case_sensitive=True)

Generate regular expression for image filename pattern recognition.

Parameters:
  • template (str) – User filename template

  • stream_name_patterns (list) – List of stream names patterns to match against

  • case_sensitive (bool) – Use case sensitivity during search (Default value = True)

Returns:

str – Regular expression pattern

mari.system.material_ingest.getThumbnailFilenamePattern(template, name)

Generate regular expression for thumbnail filename pattern recognition.

Parameters:
  • template (str) – User filename template

  • name (str) – String to replace $NAME token

Returns:

str – Regular expression pattern

mari.system.material_ingest.isValidImageFile(root, filename)

Run basic validation checks for given image file.

Parameters:
  • root (str) – Root path

  • filename (str) – File name to check

Returns:

bool – Whether the given filename is valid

mari.system.material_ingest.stripVersionFromNodeTypeId(node_type_id)

Remove the version suffix from a node type ID if it exists.

Material Ingest Dialog Mari scripts.

class mari.system.material_ingest_dialog.MaterialIngestDialog(parent=None)

Bases: QDialog

Material Ingest Tool dialog class.

__init__(parent=None)

Initialize this instance.

closeEvent(event)

If the dialog is closed, trigger a clean process shutdown.

Parameters:

event (QEvent) – Event

staticMetaObject = PySide6.QtCore.QMetaObject("MaterialIngestDialog" inherits "QDialog": )
class mari.system.material_ingest_dialog.MaterialIngestWidget(parent=None)

Bases: QWidget

Main widget for Material Ingest Tool.

__init__(parent=None)

Initialize this instance.

asPresetData()

Return the current displayed settings as a dict matching the format for a preset.

createMaterials(failed_to_export, failed_to_import)

Call each of the functions to create, configure, export, import, and clean up after a material.

Parameters:
  • failed_to_export (list) – List to populate with names of export failures

  • failed_to_import (list) – List to populate with names of import failures

Returns:

int – Count of successfully exported Materials

findTemplates()

Return a list of all the recently used templates and the templates found in the search paths.

generateTextureSetTemplate()

Create a TextureSet and populate it with configuration data from the stream view.

Returns:

TextureSet – Populated texture set

getElidedText(text, widget)

Get the elided text.

Returns elided version of the given text based on the desired dimensions of the ingestion options layout

Parameters:

text (str) – Text to elide

getItemFromControl(control, index=None)

Return the full path value set at the specified index.

Parameters:
  • control (int) – Path combo box constant

  • index (int) – Index to return (Default value = None)

Returns:

str – Path at index

isProcessCancelled()

Check if the process has received a cancellation request.

Returns:

bool – process cancelled flag

launchStreamViewContextMenu(event)

Launch the stream view context menu.

Parameters:

event (QEvent) – Custom context menu event

loadItems(control)

Load items saved for the specified control into its corresponding combo box.

Parameters:

control (int) – Item contol type Returns: list of str. List of items for control

onAddShelfComboBoxCurrentIndexChanged(index)

Disables the new shelf name text box if the new shelf.

Option isn’t New Shelf.

onChangeSelectedCheckState(state)

Set the check state on the selected indices to the specified check state.

Parameters:

state (bool) – Check state to set.

onClearPresetButtonClicked()

Clear all edited data from the UI and data model.

onCloseButtonClicked()

Slot for when the Close button is clicked.

onCreateMaterialsClicked()

Manage the process of creating materials from a UI perspective.

onExportPathButtonClicked()

Event handler for when the export path button is clicked.

Get a new export path from the user and insert it as the top and current value of the export path combo box

onIngestMethodComboBoxCurrentIndexChanged(index)

Slot for changing the current index of the ingest method combo box.

Parameters:

index (int) – Current option index of ingest method combo box

onLoadPresetButtonClicked()

Load the content of a specified preset file and populate the stream configuration settings to match.

onMaterialIngestTemplateLoaded(preset_name)

Handle the event when a material ingest template is loaded.

onMaterialIngestTemplateRemoved(preset_name)

Handle the event when a material ingest template is removed.

onMaterialTemplateButtonClicked()

Event handler for when the material template button is clicked.

Get a new file path from the user and insert it as the top and current value of the material template combo box

onMaterialTemplateComboBoxCurrentIndexChanged(index)

Event handler for when the material template combo box index changes.

Lock the UI, validate the material template given, tick the streams that match and untick and lock the ones that don’t. If no template is selected, unlock the UI

Parameters:

index (int) – Index of material template combo box

onNewShelfTextBoxEditingFinished()

Sanitises the new shelf name.

onPresetControlEdited()

Event handler for when a preset populated control has been edited.

Confirms that a preset populated control has been changed from the original preset value, then clears the current preset from the preset combobox as the UI data no longer matches what exists in the source file.

onPresetsComboBoxCurrentIndexChanged(index)

Return the preset path at the specified index of the preset combo box and call a preset load.

Parameters:

index (int) – Index of preset combo box to load

onResetToShortNames(index)

Reset the naming patterns of the selected streams to their respective short names.

Parameters:

index (QModelIndex) – Index where mouse clicked.

onRootPathButtonClicked()

Event handler for when the root path button is clicked.

Get a new search path from the user and insert it as the top and current value of the search path combo box

onSavePresetButtonClicked()

Save the current stream configuration settings to a preset file.

onSetColor(index)

Set the color on the selected indices to the color from the Color Picker dialog.

Parameters:

index (QModelIndex) – Index where mouse clicked.

onShaderModelComboBoxCurrentIndexChanged(index)

Event handler for when the shader model combo box index changes.

Sets the Shader Model at the specified index of the shader model combo box as the root of the stream view. Once set, iterate over the header’s sections and ensure the stream name column fits its contents, the color picker column remains a fixed size and the patterns column stretches to the each of the view.

Parameters:

index (int) – Index of shader model combo box

overwriteCheck(texture_sets)

Check if files could be overwritten and then warn the user.

Parameters:

texture_sets (list) – Texture sets to check

Returns:

list – Filtered list based on overwrite choice

populatePreset(preset_name)

Load the content of a specified preset file and populate the stream configuration settings to match.

Parameters:

preset_path (str) – Path to preset file

Returns:

bool – Success of preset load

populatePresetComboBox()

Populate the ingestion presets combo box.

Returns:

bool – Whether a preset has been loaded from settings

populateShelfComboBox(last_used_shelf)

Populate the list of shelves in the add to shelf combo box.

Selects the last used shelf if it’s found.

Parameters:

last_used_shelf (str) – The name of the shelf that was last used.

refreshPresetComboBox()

Refresh the list of material ingest presets in the combo box.

resizeComboBoxContents()

Resizes the display text of combo box controls to be elided and fit within the current window width.

resizeEvent(event)

Override of resizeEvent to adjust elided text within combo boxs.

Parameters:

event (QEvent) – Event

saveItems(control)

Save items.

Saves the items currently in the specified control’s corresponding combo box to the associated settings key. At the same time, the current index is set as the first item in the saved list so that on next open the last used item in this session becomes the initially set item in the new session.

Parameters:

control (int) – Item contol type

saveSettings()

Save the state of all UI controls into the Mari settings file.

selectPreset(preset_name)

Select the given preset in the combo box.

setBusy()

Set the progress bar into a busy state.

setProgress(value, total)

Set the progress bar to the specified value and total.

Parameters:
  • value (int) – Progress value

  • total (int) – Progress total

setStatus(message)

Set the progress status label to an elided version of the specified message.

Parameters:

message (str) – Status message to display

shelfForImport()

Find the unlocked shelf specified in the UI.

It will attempt to create a new shelf if specified.

Returns:

tuple –

A tuple of (mari.Shelf, str) with the shelf to import to

and any relevant error message. The returned shelf is None upon failure.

staticMetaObject = PySide6.QtCore.QMetaObject("MaterialIngestWidget" inherits "QWidget": )
validateFieldData()

Perform various validation checks on the data entered into the various fields.

Returns:

bool – Whether the UI fields contain valid data

validateNewShelfName()

Validate the new shelf name specified in the text box.

Warns the user of invalid values and offers to correct the value where possible. If it remains invalid, it will be reset to an empty string.

windowClosed()

Slot on parent dialog close event.

class mari.system.material_ingest_dialog.ShaderModelItem(shader_model, parent=None)

Bases: BaseItem

Class to represent a Shader Model.

COLUMN_COUNT = 3
__init__(shader_model, parent=None)

Initialize this instance.

clearData()

Clear any edited data across all child streams.

data(column=0, role=ItemDataRole.DisplayRole)

Return item data for the specified column index and data role.

Parameters:
  • column (int) – Column to get data from (Default value = 0)

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

variant – Item data

flags(column)

Return the flags for the specified column.

Parameters:

column (int) – Column to return data for

Returns:

QtCore.Qt.ItemFlags – Flags for this item

property isEdited

(bool) State of the edited data member.

loadChildItems()

Create child items to represent each shader model in Mari.

setEdited(value)

Set the edited data member to the specified value.

Parameters:

value (bool) – Edited value

property shaderModel

(mari.ShaderModel) Shader Model of the item.

class mari.system.material_ingest_dialog.ShaderModelsRoot(parent=None)

Bases: BaseItem

Class to represent the root item of the stream config model.

loadChildItems()

Create child items to represent each shader model in Mari.

class mari.system.material_ingest_dialog.StreamConfigModel(parent=None)

Bases: BaseItemModel

Data model to drive user stream configurations.

__init__(parent=None)

Initialize this instance.

asPresetData(serialize_color=False)

Return the data in the model formatted as a preset shader mapping dict.

For storing in the settings file, we cannot store the color directly, so we can set serialize_color to True to save it in a settings friendly way.

clearSettings()

Reset the current state of the data model.

headerData(section, orientation, role=ItemDataRole.DisplayRole)

Re-implementation from QAbstractItemModel.

Returns the data of the specified header section, orientation and role.

Parameters:
  • section (int) – Section index of data to return

  • orientation (QtCore.Qt.Orientation) – Orientation flag

  • role (QtCore.Qt.ItemDataRole) – Data role to return (Default value = core.Qt.DisplayRole)

Returns:

variant – Header data

loadSettings()

Load the current state of the data model from the Mari settings file.

parentWidget()

Return the parent widget.

Returns:

QWidget – Parent widget

property rootItem

(BaseItem) BaseItem set as the model’s root item.

saveSettings()

Save the current state of the data model to the Mari settings file.

setDataFromPreset(preset_data)

Populate the model with data from a preset.

Parameters:

preset_data (dict) – Dict of preset values.

staticMetaObject = PySide6.QtCore.QMetaObject("StreamConfigModel" inherits "BaseItemModel": )
class mari.system.material_ingest_dialog.StreamItem(stream, parent=None)

Bases: BaseItem

Class to represent a Shader Stream.

__init__(stream, parent=None)

Initialize this instance.

clearData()

Clear any edited data.

property color

(mari.Color) Stream’s default color.

data(column=0, role=ItemDataRole.DisplayRole)

Return item data for the specified column index and data role.

Parameters:
  • column (int) – Column to get data from (Default value = 0)

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

variant – Item data

property enabled

(bool) Stream’s enabled state.

flags(column)

Return the flags for the specified column.

Parameters:

column (int) – Column to return data for

Returns:

QtCore.Qt.ItemFlags – Flags for this item

property isEdited

(bool) State of the edited data member.

isStreamNamesInList(list_of_names)

Check if any of the stream names exist in the specified list of names.

Parameters:

list_of_names (list) – List of names to compare to the stream names

Returns:

bool – Match found result

property name

(str) Name of stream.

property namingPatterns

(list) Stream’s naming patterns.

setEdited(value)

Set the edited data member to the specified value.

Parameters:

value (bool) – Edited value

setValue(value, column=0)

Validate the specified value for the given column.

If successful the data in the model is changed and successful boolean returned.

Parameters:
  • value (object) – Value to set at column

  • column (int) – Column index where to set value (Default value = 0)

Returns:

bool – Success result

property stream

(mari.ShaderModelInput) Stream.

class mari.system.material_ingest_dialog.StreamView(parent=None)

Bases: QTableView

QTableView sub-class to represent the stream configuration UI.

__init__(parent=None)

Initialize this instance.

contextMenuEvent(event)

Call the context menu callback if it’s been set, passing on the specified event.

Parameters:

event (QEvent) – QEvent that has been triggered

mouseDoubleClickEvent(event)

Override of mouse double click to launch color picker.

selectionChanged(selected, deselected)

Reimplemented function to handle workaround of Qt bug : 39008.

setContextMenuCallback(context_menu_callback)

Set the context menu callback to the specified function.

Parameters:

context_menu_callback (Function) – Callback function

staticMetaObject = PySide6.QtCore.QMetaObject("StreamView" inherits "QTableView": )
class mari.system.material_ingest_dialog.StreamViewMenu(index, parent=None)

Bases: QMenu

Context menu for the stream view.

__init__(index, parent=None)

Initialize this instance.

change_selected_check_state
reset_to_short_names
set_color
staticMetaObject = PySide6.QtCore.QMetaObject("StreamViewMenu" inherits "QMenu": Methods:   #43 type=Signal, signature=change_selected_check_state(bool), parameters=bool   #44 type=Signal, signature=set_color(QModelIndex), parameters=QModelIndex   #45 type=Signal, signature=reset_to_short_names(QModelIndex), parameters=QModelIndex )
class mari.system.material_ingest_dialog.TextureSetItem(texture_set, parent=None)

Bases: BaseItem

Class to represent a found Texture Set.

COLUMN_COUNT = 2
__init__(texture_set, parent=None)

Initialize this instance.

data(column=0, role=ItemDataRole.DisplayRole)

Return item data for the specified column index and data role.

Parameters:
  • column (int) – Column to get data from (Default value = 0)

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

variant – Item data

flags(column)

Return the flags for the specified column.

Parameters:

column (int) – Column to return data for

Returns:

QtCore.Qt.ItemFlags – Flags for this item

loadChildItems()

Create child items to represent each shader model in Mari.

property textureSet

(TextureSet) Texture Set the item.

class mari.system.material_ingest_dialog.TextureSetProxy(model, parent=None)

Bases: BaseItemModelProxy

Proxy view for the texture set table view.

filterAcceptsRow(source_row, source_parent)

Re-implemented from QSortFilterProxyModel.

Controls which source rows are displayed in the proxy view.

Parameters:
  • source_row (int) – Index of source row to query

  • source_parent (QModelIndex) – Model index of source row’s parent item

Returns:

bool – Whether the source row should appear in the view

headerData(section, orientation, role=ItemDataRole.DisplayRole)

Re-implementation from QAbstractItemModel.

Returns the data of the specified header section, orientation and role.

Parameters:
  • section (int) – Section index of data to return

  • orientation (QtCore.Qt.Orientation) – Orientation flag

  • role (QtCore.Qt.ItemDataRole) – Data role to return (Default value = core.Qt.DisplayRole)

Returns:

variant – Header data

staticMetaObject = PySide6.QtCore.QMetaObject("TextureSetProxy" inherits "BaseItemModelProxy": )
class mari.system.material_ingest_dialog.TextureSetResultsModel(parent=None)

Bases: BaseItemModel

Data model to display results of Texture Set search.

__init__(parent=None)

Initialize this instance.

clear()

Clear all data from the model.

parentWidget()

Return the parent widget.

Returns:

QWidget – Parent widget

property rootItem

(BaseItem) BaseItem set as the model’s root item.

property rootPath

(str) Root path of texture set search.

setRootPath(root_path)

Set the root path of all Texture Set image filenames.

Parameters:

root_path (str) – Root path of all Texture Set image filenames

setShowEmptyStreams(state)

Set the show empty streams option to the specified state.

Parameters:

state (bool) – Whether to show streams without filenames or not.

setShowRelativePaths(state)

Set the show relative paths option to the specified state.

Parameters:

state (bool) – Whether to show relative paths or not.

setTextureSets(texture_sets)

Populate the data model with the specified Texture Set instances.

Parameters:

texture_sets (list of TextureSet) – TextureSet instances to display

property showEmptyStreams

(bool) State of whether to show streams with no filename or not.

property showRelativePaths

(bool) State of whether to show relative paths or not.

staticMetaObject = PySide6.QtCore.QMetaObject("TextureSetResultsModel" inherits "BaseItemModel": )
textureSets()

Return the Texture Set instances within the data model.

Returns:

list of TextureSet – Texture Sets instances

class mari.system.material_ingest_dialog.TextureSetSearchResultsDialog(parent=None)

Bases: QDialog

Dialog to display texture set search results.

__init__(parent=None)

Initialize this instance.

accept()

Override the accept method.

classmethod displayResults(texture_sets, texture_set_template, root_path=None, parent=None)

Display the specified texture sets in a TextureSetSearchResultsDialog.

Parameters:
  • texture_sets (list of TextureSet) – TextureSet instances to display

  • parent (QWidget) – Parent widget for dialog (Default value = None)

Returns:

QDialog.DialogCode – User chosen dialog result

saveSettings()

Save the state of UI controls to the Mari settings file.

setRootPath(root_path)

Set the root path of all the images found within the Texture Sets.

Parameters:

root_path (str) – Root path of Texture Set search.

setTextureSetTemplate(texture_set_template)

Set the texture set template originally created from the settings in the UI.

Parameters:

texture_set_template (TextureSet) – TextureSet instance representing texture set template

setTextureSets(texture_sets)

Replace the dialog’s interface data with the specified texture sets.

Parameters:

texture_sets (list of TextureSet) – TextureSet instances to display

staticMetaObject = PySide6.QtCore.QMetaObject("TextureSetSearchResultsDialog" inherits "QDialog": )
textureSetTemplate()

Return the Texture Set template originally created from the settings in the UI.

Returns:

TextureSet – Texture Set template

class mari.system.material_ingest_dialog.TextureSetStreamItem(stream, parent=None)

Bases: BaseItem

Class to represent a Texture Set Stream.

__init__(stream, parent=None)

Initialize this instance.

data(column=0, role=ItemDataRole.DisplayRole)

Return item data for the specified column index and data role.

Parameters:
  • column (int) – Column to get data from (Default value = 0)

  • role (int) – Data role (Default value = core.Qt.DisplayRole)

Returns:

variant – Item data

flags(column)

Return the flags for the specified column.

Parameters:

column (int) – Column to return data for

Returns:

QtCore.Qt.ItemFlags – Flags for this item

getStreamFilename()

Return the matched filename for the stream represented by this item.

Returns:

str – Matched filename for this stream.

class mari.system.material_ingest_dialog.TextureSetsProxy(model, parent=None)

Bases: BaseItemModelProxy

Proxy view for the texture set list tree view.

headerData(section, orientation, role=ItemDataRole.DisplayRole)

Re-implementation from QAbstractItemModel.

Returns the data of the specified header section, orientation and role.

Parameters:
  • section (int) – Section index of data to return

  • orientation (QtCore.Qt.Orientation) – Orientation flag

  • role (QtCore.Qt.ItemDataRole) – Data role to return (Default value = core.Qt.DisplayRole)

Returns:

variant – Header data

lessThan(left_index, right_index)

Re-implemented from QSortFilterProxyModel. Controls the displayed order of items.

Parameters:
  • left_index (QModelIndex) – Index of left data

  • right_index (QModelIndex) – Index of right data

Returns:

bool – Whether the left data is less than the right.

staticMetaObject = PySide6.QtCore.QMetaObject("TextureSetsProxy" inherits "BaseItemModelProxy": )
mari.system.material_ingest_dialog.getColorspaceIcon(colorspace_mode)

Return an icon for the specified colorspace mode.

Parameters:

colorspace_mode (int) – Colorspace mode enumerator

Returns:

QIcon – Colorspace mode icon

mari.system.material_ingest_dialog.sanitiseText(text)

Sanitises the specified text by removing invalid characters and stripping leading/trailing whitespace.

Returns the given text with invalid characters removed and leading/trailing whitespace stripped.

Parameters:

text (str) – Input text

Returns:

str – Sanitised text

mari.system.material_ingest_dialog.savePreferences()

Save the current preferences for the Material Ingest Tool.

mari.system.material_ingest_dialog.showMaterialIngestDialog()

Instantiate and show the Material Ingest Tool dialog.

Megascans viewer and image importer.

class mari.system.megascans.EnterAwareComboBox(parent=None)

Bases: QComboBox

Combo box that emits signals when the Enter or Escape keys are pressed.

__init__(parent=None)

Initialize this instance.

enterPressed
escapePressed
keyPressEvent(event)

Handle key press event.

setCompleter(completer)

Set completer.

staticMetaObject = PySide6.QtCore.QMetaObject("EnterAwareComboBox" inherits "QComboBox": Methods:   #60 type=Signal, signature=enterPressed(QString), parameters=QString   #61 type=Signal, signature=escapePressed() )
class mari.system.megascans.FlowingVerticalLayout(parent=None, margin=0, spacing=-1)

Bases: QLayout

Flowing vertical layout.

This is adapted from the PyQt4 port of the layouts/flowlayout example from Qt v4.x Copied from https://github.com/pyside/Examples/blob/master/examples/layouts/flowlayout.py It has been modified so that the last item would occupy the whole row, if it’s set to expand

__init__(parent=None, margin=0, spacing=-1)

Initialize this instance.

addItem(item)

Append an item to the layout.

count()

Return the number of items in the layout.

doLayout(rect, testOnly)

Perform flow layout and optionally apply item geometry.

expandingDirections()

Return no expanding directions for this layout.

hasHeightForWidth()

Return True as height depends on available width.

heightForWidth(width)

Return the required height for the given width.

itemAt(index)

Return the layout item at the given index, or None.

minimumSize()

Return the minimum size needed to display all items.

setGeometry(rect)

Apply the geometry rect and lay out all child items.

sizeHint()

Return the minimum size as the preferred size hint.

staticMetaObject = PySide6.QtCore.QMetaObject("FlowingVerticalLayout" inherits "QLayout": )
takeAt(index)

Remove and return the item at the given index.

class mari.system.megascans.HoverButton(icon, text, parent=None)

Bases: QPushButton

Push button that emits a signal when the mouse hovers over it.

__init__(icon, text, parent=None)

Initialize this instance.

enterEvent(event)

Handle enter event.

leaveEvent(event)

Handle leave event.

mouseHover
staticMetaObject = PySide6.QtCore.QMetaObject("HoverButton" inherits "QPushButton": Methods:   #46 type=Signal, signature=mouseHover(bool), parameters=bool )
class mari.system.megascans.MegaScansThumbnailDelegate(parent=None, *args)

Bases: QStyledItemDelegate

Delegate for painting megascans thumbnails in the view.

__init__(parent=None, *args)

Initialize this instance.

paint(painter, option, index)

Paint the thumbnail item with its icon and selection state.

staticMetaObject = PySide6.QtCore.QMetaObject("MegaScansThumbnailDelegate" inherits "QStyledItemDelegate": )
class mari.system.megascans.MegascansViewerWidget

Bases: QWidget

Widget for viewing and importing megascans.

__init__()

Initialize this instance.

addScansToImageManager()

Add scans to image manager.

addThumbnailItem(megascanPath, previewPath)

Add thumbnail item.

adjustThumbnailSize(value)

Adjust the thumbnail size.

chooseMegascansRepo()

Choose megascans repo.

clearStatus()

Clear status.

completeParse()

Complete parse.

completerActivated(Text)

Completer activated.

elapsedTime()

Return elapsed time.

filterActivated(Index)

Filter activated.

filterButtonClicked()

Handle filter button clicked.

filterCleared()

Filter cleared.

filterEnterPressed(Text)

Filter enter pressed.

filterList()

Return filter list.

filterTypeChanged()

Filter type changed.

hoveredOverButton(inside)

Handle hovered over button.

loadPreferences()

Load preferences.

onViewContextMenuRequested(Pos)

Handle context menu requested on the thumbnail view.

parseMegascansRepo()

Parse megascans repo.

processFilter(filterText)

Process filter operation.

registerPreferences()

Register preferences.

repoRootChanged()

Update the globals and save the preferences.

savePreferences()

Save preferences to stored settings.

staticMetaObject = PySide6.QtCore.QMetaObject("MegascansViewerWidget" inherits "QWidget": )
triggerParser()

Trigger parser.

updateFilterList()

Update filter list.

updateStatus(Text)

Update status.

updateUI()

Update UI.

class mari.system.megascans.ThumbnailProxyModel(parent=None)

Bases: QSortFilterProxyModel

Proxy model for filtering megascans thumbnails based on category and tags.

__init__(parent=None)

Initialize this instance.

filterAcceptsRow(row, parent)

Return True if the row should be accepted based on the current filter settings, False otherwise.

setSearchFilters(filterList, category)

Set search filters.

staticMetaObject = PySide6.QtCore.QMetaObject("ThumbnailProxyModel" inherits "QSortFilterProxyModel": )
class mari.system.megascans.ThumbnailSourceModel(parent=None)

Bases: QAbstractListModel

Model for holding megascans data and providing it to the view.

__init__(parent=None)

Initialize this instance.

addItem(megascanPath, previewPath)

Parse and add a megascan entry to the model.

clearAll()

Remove all megascan entries and reset the model.

data(index, role=ItemDataRole.DisplayRole)

Return data for the given index and role.

dataAsVariantMap(Indices, AddUrl)

Return selected item data as a variant map for import.

flags(column)

Return item flags including drag support.

mimeData(Indices)

Build mime data containing image URLs and import metadata.

mimeTypes()

Return selected item data as a variant map for import.

rowCount(parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)

Return the number of rows in the model.

staticMetaObject = PySide6.QtCore.QMetaObject("ThumbnailSourceModel" inherits "QAbstractListModel": )

Megascans viewer and image importer.

class mari.system.megascans_parser.Megascan

Bases: object

Represents a Megascans asset.

__init__()

Initialize this instance.

addCategory(category)

Append a category string to this megascan.

addColorspace(imageFileName, bitDepth, colorspace)

Record the colorspace configuration for an image file.

addFilter(tag)

Add a lowercase filter tag if not already present.

addTag(tag)

Add a lowercase tag if not already present.

addToIdMap(imageFileName)

Map an image filename to the megascan name.

addToolTip(tooltip)

Append a tooltip string describing a component.

isSupportedFormat(format)

Return True if the file extension is a supported import format.

setId(id)

Set the unique identifier for this megascan.

setImageCount(imageCount)

Set the number of images in this megascan.

setJsonPath(value)

Set the path to the megascan JSON file.

setName(name)

Set the display name of this megascan.

setPreviewPath(previewPath)

Set the preview image path and load the icon if it exists.

setUrlList(urlList)

Set the list of image file URLs for this megascan.

toolTipText()

Return a formatted tooltip string with name and details.

exception mari.system.megascans_parser.MegascanFormatError(message)

Bases: Exception

Exception raised for errors in the megascan format.

__init__(message)

Initialize this instance.

class mari.system.megascans_parser.MegascanV1

Bases: Megascan

Represents a Megascans asset of version 1.

__init__()

Initialize this instance.

classmethod fromJson(jsonPath, previewPath)

Generate a MegascanV1 instance from a JSON file and preview image path.

class mari.system.megascans_parser.MegascanV2

Bases: Megascan

Represents a Megascans asset of version 2.

__init__()

Initialize this instance.

classmethod fromJson(jsonPath, previewPath)

Generate a MegascanV2 instance from a JSON file and preview image path.

class mari.system.megascans_parser.ThreadedParser(root, parent=None)

Bases: QThread

Threaded parser for scanning a directory for megascans JSON and preview files.

__init__(root, parent=None)

Initialize this instance.

completedParsing
megascanFound
run()

Run the thread to parse the root path for megascans JSON and preview files.

setRootPath(root)

Set root path.

startedParsing
staticMetaObject = PySide6.QtCore.QMetaObject("ThreadedParser" inherits "QThread": Methods:   #13 type=Signal, signature=megascanFound(QString,QString), parameters=QString, QString   #14 type=Signal, signature=startedParsing()   #15 type=Signal, signature=completedParsing() )
stop()

Stop the thread.

Mari-Nuke communication scripts.

exception mari.system.nuke_bridge.CancelledError

Bases: RuntimeError

An exception to indicate that the user cancelled a selection dialog.

class mari.system.nuke_bridge.FromNuke(data_src)

Bases: object

Nuke data receiver class.

__init__(data_src)

Import projection data from Nuke and do stuff with it in Mari.

Parameters:

data_src – A data dictionary as created by mari_bridge.ToMari in Nuke. It can also be a file path pointing to a pickled version of the above

createProjectors()

Create projectors based on data sent from Nuke.

static getDefaultProjectorSize(image_data)

Return the smallest projector resolution that can contain the given image size.

startNewProject(channel_desc={'height': 4096, 'name': 'color', 'width': 4096}, meta_options={})

Close a currently open project and start a new one with the given values.

Parameters:
  • channel_desc (dict) – A dictionary containing properties of channel to create

  • meta_options (dict) – A dictionary of project creation meta options

class mari.system.nuke_bridge.ProjectionSettingsUI(projector_data, geo_list)

Bases: QDialog

A simplified UI for creating a new project.

__init__(projector_data, geo_list)

Initialize this instance.

addOption(label, widget, tooltip)

Add an option to the form with the given label, widget, and tooltip.

addSeparator()

Add a horizontal separator to the form.

staticMetaObject = PySide6.QtCore.QMetaObject("ProjectionSettingsUI" inherits "QDialog": )
mari.system.nuke_bridge.checkAndCall(function_call_text)

Ensure that the Mari-Nuke connection is active, and then call the given function.

Parameters:

function_call_text (str) – The text of the function to call after checking

mari.system.nuke_bridge.createProjectorForCurrentView()

Create a Mari projector for the current view.

mari.system.nuke_bridge.debugMsg(message)

Trace debugging messages, if enabled.

mari.system.nuke_bridge.disconnectFromNuke(notify_nuke)

Shuts down any active connection to Nuke.

Parameters:

notify_nuke – If True, this sends data to Nuke to indicate that this Mari session is disconnecting

mari.system.nuke_bridge.errorMsg(message)

Print an error message to the console output and log it.

mari.system.nuke_bridge.exportAllChannelsUVPatchTextures(use_socket, output_path=None)

Export the channels of all objects.

Parameters:
  • output_path – The location to export the image to

  • use_socket – If True, a Read node is sent to Nuke’s socket pointing to the exported texture

mari.system.nuke_bridge.exportCurrentChannelUVPatchTextures(use_socket, output_path=None)

Export the current channel of each object.

Parameters:
  • output_path – The location to export the image to

  • use_socket – If True, a Read node is sent to Nuke’s socket pointing to the exported texture

mari.system.nuke_bridge.exportCurrentView(use_socket=False)

Export the current view as a Mari projector to Nuke.

mari.system.nuke_bridge.exportProjectors(export_all=True, use_socket=False)

Export Mari projector to Nuke either via the the socket connection or to a file (pickled python dictionary).

Parameters:
  • export_all – If True, export all projectors; otherwsise only export the current one

  • use_socket – If True, data will be sent to Nuke via the socket; otherwise a file browser will prompt the user for a path

mari.system.nuke_bridge.exportUVPatchTextures(obj_chan_list, use_socket, output_path=None)

Export UV patch textures from a list of (obj, channel) pairs.

mari.system.nuke_bridge.exportUnproject(projector, output_path=None, use_socket=False, unique=False)

Unprojects the texture from a projector.

Parameters:
  • projector – The projector to export

  • output_path – The location to export the image to. If None, a file dialog is used

  • use_socket – If True, a Read node is sent to Nuke’s socket pointing to the exported texture

Raises:

CancelledError – Raised if the user cancelled a data directory selection dialog

mari.system.nuke_bridge.exportUnprojectCurrent(use_socket, unique=False)

Export the current Mari projector to a file or Nuke socket.

mari.system.nuke_bridge.flatLightingPreferenceChanged()

Handle changes to the flat lighting preference.

mari.system.nuke_bridge.getCamData(projector)

Convert Mari camera data into Nuke camera data (Vector to Vector, focal to focal and filmback, etc).

Return a dictionary with name and data keys with translate, rotate, haperture, vaperture, focal. This will only work for ZXY rotation order.

Parameters:

projector – A Mari projector

mari.system.nuke_bridge.getDataDir()

Return the data directory to use for Nuke-Mari communication.

mari.system.nuke_bridge.getMariHostAndPort()

Return the details of the current Mari server connection.

Returns:

(str, int) – host, port

mari.system.nuke_bridge.getNukeHostAndPort()

Return the details of the current Nuke host connection.

Returns:

(str, int) – host, port

mari.system.nuke_bridge.getNumericVersion(version_str)

Return an integer representation of the given version string.

The integers generated in this way will match mari.app.version().number() in scale.

mari.system.nuke_bridge.hostNamesMatch(host1, host2)

Return True if the given host names match, accounting for the various equivalent names of ‘localhost’ etc.

mari.system.nuke_bridge.hostPreferenceChanged()

Handle changes to the Nuke host preference.

mari.system.nuke_bridge.importNMBFile()

Import a Nuke projection file (.nmb) and create Mari projectors from it.

mari.system.nuke_bridge.init()

Initialise the Nuke bridge functionality.

This function is used just to avoid filling up the global namespace with temporary names.

Requires Mari 2.0v1 or higher.

mari.system.nuke_bridge.launchNuke()

Launch Nuke and prepare Mari to receive data from it.

mari.system.nuke_bridge.loadImages(img_list)

Load all images from img_list into Image Manager.

Parameters:

img_list – A list of file paths to load

mari.system.nuke_bridge.loadPreferences()

Load the preferences for the Nuke bridge from Mari’s settings.

mari.system.nuke_bridge.pathPreferenceChanged()

Handle changes to the Nuke path preference.

mari.system.nuke_bridge.portPreferenceChanged()

Handle changes to the Nuke port preference.

mari.system.nuke_bridge.processResponse(nuke_version)

Process a response to a setCurrentMariFor command.

Parameters:

nuke_version (str) – The string version of the Mari bridge scripts that Nuke is using; ‘’ for pre-1.4v3, or None to not check now

mari.system.nuke_bridge.registerPreferences()

Register the preferences for the Nuke bridge in Mari’s preferences dialog.

mari.system.nuke_bridge.responseTimerExpired()

Timer function to call to check if a Nuke connection has failed.

mari.system.nuke_bridge.savePreferences()

Save the preferences for the Nuke bridge to Mari’s settings.

mari.system.nuke_bridge.sendToNuke(nuke_cmd, ignore_failure=False)

Send a command to Nuke via a socket connection.

The command port in Nuke’s script settings needs to be enabled for this to work.

Parameters:

nuke_cmd – Nuke python command (string) - does not need to start with “nukeDo:”. This may be empty to just verify the connection

Returns:

bool – True if the command was sent successfully, or False otherwise

mari.system.nuke_bridge.setCurrentMariFor(nuke_pid, is_current, nuke_version='')

Indicate that Mari is, or is no longer, connected to Nuke and acknowledges communication.

Parameters:

nuke_version (str) – The string version of the Mari bridge scripts that Nuke is using; ‘’ for pre-1.4v3, or None to not check now

mari.system.nuke_bridge.setDebug(enabled)

Enable or disable debugging messages.

mari.system.nuke_bridge.setLUT(lut)

Set up the ‘Color Space’ profile in the View Transform.

mari.system.nuke_bridge.setNukeHost(name, port, pid)

Set the details of the Nuke instance for Mari to communicate with.

This function is only intended to be called from Nuke via a socket.

Parameters:
  • name (str) – The host name, or None to clear

  • port (int) – The host port, or None to clear

  • pid (int) – The process ID of the Nuke instance that we are communicating with

mari.system.nuke_bridge.updateAndSavePreferences()

Update the preferences for the Nuke bridge in Mari’s settings and save them.

Snapshot related Mari scripts.

mari.system.snapshots.CHANNELS_ALL = 1

snapshot all channels

mari.system.snapshots.CHANNELS_CURRENT = 2

snapshot the current channel (on the current object)

class mari.system.snapshots.SnapshotUI

Bases: QWidget

Inspection and management of object snapshots.

__init__()

Initialize this instance.

staticMetaObject = PySide6.QtCore.QMetaObject("SnapshotUI" inherits "QWidget": )
mari.system.snapshots.checkForAutosnapshot()

Create an autosnapshot of all channels without prompting, if the ‘snapshot on save’ preference is set.

mari.system.snapshots.clearOrBakePaint()

If the paint buffer is dirty, this asks the user to clear or bake it.

The clearing or baking will be performed if requested. The user may cancel this operation, in which case an exception is raised.

We need to do this during snapshots because otherwise the actual data that the snapshot is performed on will not match the visible buffer state, which is misleading.

Raises:

RuntimeError – The user cancelled the operation.

mari.system.snapshots.deleteAll(confirm=True)

Delete all snapshots in the project, after an optional confirmation dialog.

mari.system.snapshots.disconnectNoLogs(signal, response)

Disconnect a signal from a response function without logging errors.

mari.system.snapshots.getAllChannels()

Return a list of all channels in the project.

If no project is open, it returns an empty list.

mari.system.snapshots.getAllUVChannels()

Return a list of all UV channels in the project - i.e. all channels except Ptex channels.

If no project is open, it returns an empty list.

mari.system.snapshots.getShotsInAllChannels()

Return a list of the snapshots that are present in all channels.

mari.system.snapshots.hasMultiChannelLayer(layer_stack)

Check if the layer stack contains a multi-channel layer.

mari.system.snapshots.isPtexProject()

Check if the current project contains any Ptex channels.

Deprecated

This function will be deprecated, as a project can contain both Ptex and UV-based objects.

Returns:

bool – True if any of the channels in this project are Ptex channels, and False if not.

mari.system.snapshots.showNewSnapshotGUI(channels=1, title='Snapshot All Channels')

Show a GUI to create a snapshot of a set of channels in the project.

Note that snapshots will only be created for UV channels. Future releases may support snapshots for Ptex channels as well.

Parameters:
  • channels – The channels to create a snapshot for, or CHANNELS_ALL or CHANNELS_CURRENT

  • title – The title for the dialog that requests a snapshot name from the user

mari.system.snapshots.snapshotAllChannels(shot_name)

Call L{snapshotChannels()} with all channels in the project.

Note that snapshots will only be created for UV channels. Future releases may support snapshots for Ptex channels as well.

Parameters:

shot_name – A descriptive name for the snapshot being taken

mari.system.snapshots.snapshotChannels(channel_list, shot_name)

Create a snapshot of a list of the channels in the scene.

A unique ID is created for the group of snapshots, and then a snapshot is created for each channel with the given name and generated ID.

Note that snapshots can only be created for UV channels. Future releases may support snapshots for Ptex channels as well. Calling this function on Ptex channels will result in a value error exception.

Parameters:
  • channel_list – A list of channels to take snapshots of, or a single channel

  • shot_name – A descriptive name for the snapshot being taken

Returns:

The ID of the new group snapshot

Script to create texture sets palette.

class mari.system.textureSets.TextureSetsTabWidget

Bases: QTabWidget

Tab widget for managing texture sets in Mari.

__init__()

Initialize this instance.

repoRootChanged()

Notify the megascans widget that the repository root has changed.

staticMetaObject = PySide6.QtCore.QMetaObject("TextureSetsTabWidget" inherits "QTabWidget": )
mari.system.textureSets.makePalette()

Create the texture sets palette.