Adding Shaders


Folder Structure


Shader Files follow the same general rule as the XML nodes without the need to set the Category Tag into the XML

since shaders are not allowed to be set into subcategories. So lighting shaders will fall into these various folders.


~\Scripts\ExtensionPack_XvXX\Shaders\NodeLibrary\Lighting\Diffuse\

~\Scripts\ExtensionPack_XvXX\Shaders\NodeLibrary\Lighting\Specular\

~\Scripts\ExtensionPack_XvXX\Shaders\NodeLibrary\Lighting\Standalone\


Tags


Node Type:

 

To determine what kind of Node it is the autoloader will use the default tags that are found in the Mari XML files and place

them into types: Diffuse, Specular, Standalone shader


Example 1:


    <Tags>

        <Tag>_diffuse</Tag>

    </Tags>



Example 2:

 

  <Tags>

    <Tag>_standalone</Tag>

  </Tags>



Node Name in UI:


The name of the Node as it appears in Mari's UI is used from Mari's Default XML Attribute


<DefaultName></DefaultName>


Example:

<DefaultName>My Shader</DefaultName> will Name the Node My Shader in the Mari UI.



If no <DefaultName> Tag is found <ID> Tag will be used and the node will still register, but an error printout will appear in the Python console



Cross Version Compatibility


The <ID> tag is a unique Name that allows Mari to identify the Node, regardless of the name

it has in the UI. The <ID></ID> should never change between Versions of the Node to allow Mari to

convert between Versions.


Example:

<ID>MyShader_v01</ID>



Restricting Shaders to specific Mari Versions


You can restrict Nodes to load only in specific MARI Versions by using the

<MinMariVersion> and <MaxMariVersion> tags in the Node XML files.


The tags are optional. You can have just a <MinMariVersion> tag, just a <MaxMariVersion> one

or leave them out completely if not required.        


Examples:


Restrict a Node to Mari 3.1 or higher:                 <MinMariVersion>30101000</MinMariVersion>

Restrict a Node to Mari 3.0v3 or lower:         <MaxMariVersion>30003300</MaxMariVersion>