Class/Method Overview

SDK ›› Python ››
Parent Previous

Class / Method Overview


The following subclasses have been exposed as part of the mari.ExtensionPack() class



mari.ExtensionPack.resources()


Path resources such as extension pack icon paths and extension pack default object paths



The path to Extension Pack Icons



The path to Extension Pack Default Objects


mari.ExtensionPack.splashScreen()


Extension Pack Splash Screen



Launches the Splash Screen


Parameters:


showReleaseNotes (bool):  Determines if Text Release Notes are shown in the Splash Screen



Launches the Splash Screen if the user allows it / checkbox is set


Parameters:


showReleaseNotes (bool):  Determines if Text Release Notes are shown in the Splash Screen

mari.ExtensionPack.project_paths()


Set Project Path Tool



Launches the Set Project Path Dialog




Restores set project paths on Project Load




Returns the per project path to the json file

Used to store project path settings such as export paths etc.


mari.ExtensionPack.selection()


Selection related tools



Isolates visibility of the selection


mari.ExtensionPack.patch()


Patch related tools



Launches Patch Bake to Image Manager


mari.ExtensionPack.camera()


Camera/View related tools



Unproject Channel to Image Manager tool




Unproject Layer to Image Manager tool




Unproject View to Image Manager tool


mari.ExtensionPack.exportChannel()


Export related tools



Launches Export Custom Channel Selection Dialog with the

"Flattened" Checkbox turned on




Launches Export Custom Channel Selection Dialog with the

"Flattened" CHeckbox turned off




Runs the last Export from Export Custom Channel Selection




Sets the Checkbox for how "Export Last" is to deal

with Selected Patch Export - using the original selection

or the current one




Sets the Checkbox for "Export Last" Patch Selection Behavior

back to the way it was when Mari was last opened


mari.ExtensionPack.channel()


Channel related tools



Launches Duplicate/Flatten Channel Dialog




Samples the currently selected Channel and stores its resolutions per UDIM.        Geo and channel can optionally be supplied as arguments


Parameters:


geo (mari.geoEntity):        Pass in the Geometry the Channel lives on. If None (default) the selected object is used

channel (mari.Channel):        Pass in the Channnel to get the resolution off. If None (default) the selected channel is used





Create a new Channel with the UDIM Size Configuration stored via channel_template_get




Sets the currently selected Channel to the UDIM resolutions stored via channel_template_get.

Geo and channel can optionally be supplied as arguments


Parameters:


geo (mari.geoEntity):        Pass in the Geometry the Channel lives on. If None (default) the selected object is used

channel (mari.Channel):        Pass in the Channnel to get the resolution off. If None (default) the selected channel is used




Duplicate a channel with all sharing intact






RenameChannel=False,newChannelName,offsetX=50,offsetY=50)


Duplicates a Node Network such as a channel while cleanign up and rebuilding shared connections in the graph.

Please be aware the same method exists in the nodegraph() class.


Return:


mari.Node()


Parameters:


geo (mari.geoEntity):                        Geo, inputNode lives on


inputNode (mari.Node):                        The node which to use as a base to duplicate the network (upstream connections). Should be a channel node but doesn't have to be

                       

inputNodeNodeGraph (mari.Nodegraph) :        The Nodegraph the input Node belongs to

                       

StopAfterRadioNodes (bool) :                If true (default value) connections upstream of a radio node will not be duplicated and the original Radio Node Connection is

                                       maintained if the first node upstream of a radio has connections to other channels.

                       

RenameChannelIncremental (bool):        If true (default value) and the inputNode is a Channel, the resulting duplicated channel will be renamed incrementally (1,2,3 etc.)


RenameChannel (bool):                        If RenameChannelIncremental=False and RenameChannel=True, and the inputNodeis a channel, the resulting duplicate channel will be renamed with

the name specified under newChannelName


newChannelName (string):                if RenameChannel=True and the inputNode is a channel, the resulting duplicate Channel will be renamed with this name


offsetX / offsetY (int):                        The offsetX and offsetY specify the offset of the duplicated nodes from their original nodegraph position




Launch Pack Channel UI



Selects the corresponding Node of a Channel in the Nodegraph and focuses the view on it



Selects the corresponding Nodes of a Channel in the Nodegraph and focuses the view on it



Lock a Channel



Lock all Channels



Unlock a channel



unlock all channels


mari.ExtensionPack.channelLayer()


Channel Layer related tools



Launches the "Add Channel Layer" UI




Launches the "Add Channel Mask" UI




Launches the "Add grouped Channel Mask" UI


mari.ExtensionPack.layer()


Layer related tools



Executes layer Clone & Merge



toggles the visibility of selected layers



toggles the visibility of unselected layers



toggles the locking of selected layers



toggles the locking of unselected layers



Extension Pack Version of standard Mari Layer Convert to Paintable

Supports multi selection and channel layers



Executes "Copy with Shared Connections"

Shared Layers will always be relinked to their original source,

including in Mask Stacks

Pasted Channel Layers will be relinked to the original channel,

without unnecessary channel duplication




Executes "Paste with Shared Connections"

Shared Layers will always be relinked to their original source,

including in Mask Stacks

Pasted Channel Layers will be relinked to the original channel,

without unnecessary channel duplication




Standard Mari Layer CUT Action,however since extension pack

moves the action in the UI it is declared here again



Standard Mari Layer COPY Action,however since extension pack

moves the action in the UI it is declared here again



Standard Mari Layer PASTE Action,however since extension pack

moves the action in the UI it is declared here again



The Add Mask Tools in Extension Pack are replacements for the existing Mari Add Mask functionality


Reveal All

Hide All

From Alpha

From Selection

From Selection Group


They act identical to the default Mari functionality in most cases however the Add Mask Tools

will no longer be disabled/greyed out when a mask or mask stack already exists on the layer


When executed on a layer with a pre-existing mask, the mask will be removed and a new one added

depending on the tool executed


When executed on a layer with a pre-existing mask stack, the mask stack will be removed and a new one added

depending on the tool executed


parameters:


mode (str):    available options are "reveal","hide","from Alpha","from Selection","from Selection Group"


mari.ExtensionPack.lights()


Light related methods



Rotates the Environment Light.

Mode is either "slow","medium" or "fast"

The multiplier is usually 1 or -1 to rotate clockwise or

counterclockwise

               


Adds ENV Light Rotation Settings to the Preferences



Saves the Setting of the ENV Light Rotation in the Preferences


mari.ExtensionPack.pinnedLayers()


Pinned Layer Methods (Layer Sharing Bookmarks)



Executed if no layer has been pinned but user triggers quick pin



Adds a Layer selection to the Quick Pin


parameters:


mode (str):     'channel' wil add a pinned Channel, else automatically use layers




Adds shared layers from the Quick Pin


parameters:


layerType (str):       "0" for layers, "1" for channel layers

layerName (str):       The Name of the Layer the Pin references

project (str):         The Project Name the Quick Pin was added

project_uuid (str):    The Project UUID the Quick pin was added

layer_uuid (str):      The UUID of the Layer(s) the Quick Pin should add




Adds a collection Pin


parameters:


mode (str):             "0" for layers, "1" for channel layers  




Adds shared layers from a collection pin


parameters:


layerType (str):       "0" for layers, "1" for channel layers

layerName (str):       The Name of the Layer the Pin references

project (str):         The Project Name the Quick Pin was added

project_uuid (str):    The Project UUID the Quick pin was added

layer_uuid (str):      The UUID of the Layer(s) the Quick Pin should add




Launches Manage Collection Pins UI



Used to restore any Pins stored in a project, so they appear in the UI



Removes all Collection Pins in a Project


mari.ExtensionPack.shader()


Shader related tools



Syncs all shader selections on all objects in a project to the current shader name

mari.ExtensionPack.shaderPreset()


Shader Preset related tools



Adds a signal monitoring to each object in a project so we can detect if a new shader is added

and compare it on creation if a preset needs to be applied



Adds a signal monitoring to a new object in a project so we can detect if a new shader is added

and compare it on creation if a preset needs to be applied



Stores a shader preset from the selected shader



Removes a shader preset based on the selected shader



If a preset matching the name of the selected shader is found, this will restore

all shader attributes to the saved preset



If a preset matching the name of the selected shader is found, this will restore

all shader inputs to the saved preset based on channel names

If a channel matching the channel name in the preset is found, it will be assigned to the

corresponding shader input



With a shader selected in the Shader Palette, selected Nodes in the Nodegraph will be checked

if they contain any names of channels that have been previously saved in a shader preset.

If a channel name is part of the Nodename the Node will be assigned to the corresponding channel input



With a shader selected in the Shader Palette, this will restore the shader to the state

it was before "setNodesToShader" was first used


mari.ExtensionPack.selection_group()


Selection Group related methods



Launches the "Material ID from Selection Groups" Dialog



Spawns a dialog that lets the user set custom ID Colors for Selection Groups


Parameters:


selGroups (list):  A list of optional selection Groups, otherwise the current selected one is used

       


Sets a Material ID Override on the provided Selection Group(s)


Parameters:


SelectionGroups (list):  A list of selection Groups to apply the override to

color (list): A list of 4 values - [R,G,B,A] - from 0 to 1


mari.ExtensionPack.object()



Launches a full Export UV Mask dialog where you can export UV Masks from multiple objects



Launches a Export UV Mask dialog where you can export UV Masks from the SELECTED Object



Launches a full Export dialog where you can export your Geometry from your project



Launches a Export dialog where you can export your SELECTED object



Launches the subdivide dialog, where you can batch subdivide multiple objects



Set all objects to highest available subdivision



Set all objects to level 0



Set all visible objects to highest available subdivision



Set all visible objects to level 0



Launches the "Add Default Objects" dialog

where you can add a number of primitive objects to your Mari scene (plane, tiling plane, cube etc.)


mari.ExtensionPack.imageManager()


Image Manager related Methods



Export the selected images in the image manager to a folder



Reloads selected images in the image manager from disc and updates

their occurences inside of the project (tiled, triplanar etc.)


mari.ExtensionPack.view()


View related methods



Screenshot all channels


mari.ExtensionPack.shading()


Shading related methods



Turns the spinning wheel on in the Mari viewport to pause viewport updates


parameters:


mode (str):     "iconOnly" will only set the action icon to enabed/disabled (toggle) without actually launching anything. This is to handle any python action that doesn't directly call the disableViewport Action.



mari.ExtensionPack.symmetry()


Extension Pack Symmetry Bake Tool related methods



Activates Symmetry Bake in Mari X Axis



Activates Symmetry Bake in Mari Y Axis



Activates Symmetry Bake in Mari Z Axis



Toggles between different Symmetry Modes


mari.ExtensionPack.bakePoints()


Bake Point related methods



Bakes all selected Bake Points in the Nodegraph



Sets the "use Bake" checkbox in selected bake points to on or off


parameters


bool (bool) = True/False


mari.ExtensionPack.radioNodes()


Radio and Radio Transmitter Node related Methods



       A Python API method to toggle a Radio node, so it doesn't require UI interaction like

       toggleSelectedRadioNodesConnection()

       By using Force and Force Mode "Show" or "Hide" you can show all or hide all


       Parameters:


       node (mari.Node)        The node to set

       Force (bool)                By setting a Force Boolean you can force a mode such as Hide or show otherwise it just toggles

       ForceMode (string)        'Show' or 'Hide to show or hide a connection




This is a special way to cycle through the modes of radio nodes


1) If any Radio Nodes are selected it will toggle them

2) If no Radio Nodes are selected it will toggle ALL of them first  to show, then hide



Toggle Selected Radio Nodes between "Show Connection" and "Hide Connection"



Hides all Radio Connections in the current Graph Tab



Shows all Radio Connections in the current Graph Tab



Focuses your Nodegraph on connected Nodes from the currently selected Radio Node or Radio Transmitter Node



Launches the "Connect to Transmitter" dialog




Adds Radio Node Preferences to the Mari Preferences



Saves the On/Off State of Radio Node Preferences in the Mari Preferences



Given a Radio Node this method will search your nodegraph

for a Transmitter Node matching the name of a Transmitter Node

that was previously connected to that radio node and reconnect it.


Part of a system of reconnecting parts of your nodenetwork on import

to project specific parts of your graph such as Ambient occlusion etc.


Parameters:


radionode (mari.Node) : The Radio Node to sample.



Monitors if a created Node is a Radio Node



Turns off monitoring of Nodecreation in your project for Radio Nodes


mari.ExtensionPack.nodegraph()


Nodegraph related methods



Jumps to the connected Node of the currently selected node output

If multiple Nodes are connected to the Output a dialog will show



Jumps to the connected Node of the currently selected node input

If a node has multiple inputs a dialog will show




Duplicate selected Nodes while maintaining their connections


       Parameters:


       offset X / Y:        Specifies the offset of duplicated nodes in the Nodegraph




Launch the "Multi Rename Nodes" Tool UI




Select all Nodes in the current Graph Tab




deselect all Nodes in the current Graph Tab



deselect all Nodes except backdrops in the current Graph Tab



select all upstream nodes from the current node selection



select all upstream nodes from the current node selection but stop after a radio node



Launches the "Jump to Bookmark" UI



Cycle forward through the available node graph bookmarks



Cycle backwards through the available node graph bookmarks



Smart rename selected Nodes based on a some given rules



Allows you to swap out any node type for another node type. If possible, settings are transfered between nodes



RenameChannel=False,newChannelName,offsetX=50,offsetY=50)


Duplicates a Node Network such as a channel while cleanign up and rebuilding shared connections in the graph.

Please be aware the same method exists in the channel() class.


Return:


mari.Node()


Parameters:


geo (mari.geoEntity):                        Geo, inputNode lives on


inputNode (mari.Node):                        The node which to use as a base to duplicate the network (upstream connections). Should be a channel node but doesn't have to be

                       

inputNodeNodeGraph (mari.Nodegraph) :        The Nodegraph the input Node belongs to

                       

StopAfterRadioNodes (bool) :                If true (default value) connections upstream of a radio node will not be duplicated and the original Radio Node Connection is

                                       maintained if the first node upstream of a radio has connections to other channels.

                       

RenameChannelIncremental (bool):        If true (default value) and the inputNode is a Channel, the resulting duplicated channel will be renamed incrementally (1,2,3 etc.)


RenameChannel (bool):                        If RenameChannelIncremental=False and RenameChannel=True, and the inputNodeis a channel, the resulting duplicate channel will be renamed with

the name specified under newChannelName


newChannelName (string):                if RenameChannel=True and the inputNode is a channel, the resulting duplicate Channel will be renamed with this name


offsetX / offsetY (int):                        The offsetX and offsetY specify the offset of the duplicated nodes from their original nodegraph position

mari.ExtensionPack.node()


Node related methods



Returns the Nodes that are connected to the Output of the supplied Node

With Skip Dots turned on, the return will contain the node connected to a dotNode

if there is one inbetween


Parameters:


graph (mari.nodeGraph):            The Graph to search in

node_to_find (mari.Node):          The node you want to check for, which other nodes are connected to its output(s)


Returns:


(list):                                    A list of nodes (mari.Node)


Please note as of Mari 4.5 there is additional standard Python API mari.node().outputNodes()

that may be better suited for the task in some cases






Returns a Dictionary of Channels [UUID:CHANNEL] that a given node belongs to


Parameters:


node_to_find (mari.Node):          A Node (mari.Node) you want to determine which channel(s) are using it


geo (mari.geoEntity):              Which Object in your scene you want to check for channels


excludeChannelLayer (bool):        If true only Channels will be returned that use the node in their own channel stream but not as part of a 'channel layer' stream                


Return:


{dict}:                                    Returns a Dictionary of Channels with key= ChannelUUID, value=ChannelObject





Returns the pretty Name of a Node, as it is listed in the UI


Parameters:


node:                               A Node Object (mari.Node)


Return:


String:                             Returns a String





Returns the Node Category of a Node, as it is listed in the UI


Parameters:


node:                              A Node Object (mari.Node)


Return:


String:                            Returns a String




               


Returns the Node Position as a list and a string


Parameters:


graph:                              The nodegraph the node belongs to (mari.NodeGraph)

node:                              A Node Object (mari.Node)


Return:


List:                              Returns a list with the coordinates [x,y]






A wrapper method around mari.node.inputNode() to deal with differences

between mari versions.


The method will return pairs of [inputNode,outputPortOnInputNode] for mari 4.5

and above and [inputNode,''] for versions below mari 4.5


Parameters:


node:                                      The node to check for connections on (mari.Node)

port:                              The Input Port Name to check for connections (string)


Return:


List:                              Returns a list with the pair [inputNode, outputPortOnInputNode]






A wrapper method around mari.node.setInputNode() to deal with differences between mari versions.

The method allows the same code for both Mari 4.5+ and below

On mari 4.5+ this supports multiOutput Nodes, below it doesn't so the OutputPortName is ignored then.


Parameters:


node:                              The node to connect something to (mari.Node)

port:                              The Input Port Name to connect something to (string)

NodeToConnect:                        The Node to Connect to the Port

OutputPort:                        The OutputPort of the NodetoConnect to connect to


Return:


None







Create duplicates of given nodes with a position offset


Parameters:


graph:                                The nodegraph the node belongs to (mari.NodeGraph)

nodes:                                      A list of Node Objects (list(mari.Node))

offsetList:                                A list of offset coordinates [x,y]

removeOrigNodes:                    If True the original nodes are removed


Return:


List:                                      Returns a list of nodes




Creates a new node at a specific position


Parameters:


graph:                The nodegraph the node belongs to (mari.NodeGraph)

nodes:                A list of Node Objects (list(mari.Node))

PositionList:       A list of coordinates [x,y]


Return:


mari.Node():        Returns a mari.Node




Given a Target Node (and the nodeGraph it lives in) this will return all Nodes

that are connected to the targetNode + optionally targetNode again as well.



Parameters:


targetNode (mari.Node):                The Node you want to find all connected nodes for


nodeGraph (mari.nodeGraph):     The Nodegraph the targetNode lives in


groupContentMode (str):                 If "Include Group Node Contents" all Nodes inside of Graph Groups will be returned as well. Otherwise just the nodes fromt he target Node Nodegaph will be returned


returnBakePointUpstream (bool): If "False" nodes upstream from bake points will only be returned if the bake point is disabled or does not useBake(). If "True" all nodes upstream of Bakepoints will be returned


includeTargetNode (bool):              If "True" the given targetNode will be includes in the returned list



Return:


(list):                                         A list of nodes (mari.Node)





Smart rename given Nodes, circumventing the Smart Rename UI

       

Parameters:


graph (mari.Nodegraph):        A mari Nodegraph obkect

node (mari.Node):                Node to rename


mari.ExtensionPack.toolbar()


Adds Toolbar Options to existing Mari Toolbars



Adds Extension Pack Options to the Transform Paint Toolbar



Turns on Buffer BitDepth Syncing on a new session if it was active on previous session close

Buffer BitDepth Syncinc will constantly switch the paint buffer bit depth to the

bit depth of the currently selected channel




Adds Extension Pack Options to the Transform Object Toolbar


mari.ExtensionPack.text()


Extension Pack Text Tool



Launch the EP Text Generator


mari.ExtensionPack.project()


Project related tools such as cleanup tools        



Remove all Layer and Channel Snapshots



Run a Garbage Collect



Opens your Project Directoy (currently open project) in a File Browser


mari.ExtensionPack.archive()


Project archiving related tools



Adds information about Archive Status and Archive Date to the Project Tooltip

and marks the Project Screenshot with a visual indicator




Sets the ArchiveUpToDate Metadata on a Project


Parameters:


cur_project (mari.project):        a mari.Project

outOfDate (bool):                Sets the Metadata to True of False


mari.ExtensionPack.projectors()


Projector related tools



toggles the selected projector between Orthographic and Perspective


mari.ExtensionPack.dev()


A number of tools and dialogs to easily find classes, methods, actions and menu paths



Launches Dialog to search through Mari Actions



Launches Dialog to search through Mari Menu Paths



Launches Dialog to search through available classes and methods


mari.ExtensionPack.help()


Access to Help and Tutorials



Launch Extension Pack Online Help



Launch Youtube Extension Pack Tutorials

               

mari.ExtensionPack.version()


Methods to determine Extension Pack Versions



Check if a new version exists



returns Path to Json file containing Major, Minor, Patch and PrettyVersionName



returns the Major Version



returns the Minor Version



returns the patch Version



returns the build Version



returns the Pretty Version Name



returns the full version consisting of major,minor and patch


mari.ExtensionPack.utils()


Various Python Helper Methods




this is a method to find the active nodegraph based on the open tab

Hopefully in the future Mari will provide this via its build in python

at which point the method will use that method to keep backwards compatibility


Return:


mari.Nodegraph





Returns all Nodes including Group Contents based on initial list provided

For example if you give a nodelist containing a group node, the return

will include all nodes from the initial nodelist plus all nodes from within the group


Parameters:


node_list (list):                 A list of nodes (mari.Node)


Return:


(list):                    A list of nodes (mari.Node)






Returns all Group Nodes including Groups in Groups based on initial list provided

For example given a nodelist you will get all Group Nodes inside this Nodelist

including all Group Nodes inside of Group Nodes


Parameters:


node_list (list):                 A list of nodes (mari.Node)


Return:


(list):                    A list of group nodes (mari.GraphGroup)





A quick and easy way to get the selected Nodes from the current geo root graph


Parameters:


FirstOnly (bool):          If "True" only the first found selected node willl be returned, otherwise all selected ones


Return:


(list):                            A list of nodes (mari.Node)





This returns the Mari Main Window Object or None if not found




this sets the context focus inside of mari to the Nodegraph. This is useful to return focus to the Nodegraph after a dialog was opened/closed





Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?