Whats New - Version 8.3.6

April 24 2021

return to main index

Arnold MTD Files & C++ Source

With Cutter v8.3.1 when the C++ source code for an Arnold shader is successully compiled it would generate/overwrite the shaders .mtd file. With this version of Cutter any edits that have been made to a .mtd file will NOT be over-written.

Arnold AETemplate.py Files & C++ Source

Cutter can now generate/update an AETemplate.py file. Using the popup menu - activated by right-mouse clicking in the window containing the C++ code for a shader.

Figure 1

will cause Cutter to look for commented "hints". For example, suppose the code for a shader named mkPattern.cpp has the hints shown below,

node_parameters {
    AiParameterRGB("baseColor", 0.7f, 0.7f, 0);    // panel:colors:open
    AiParameterRGB("patternColor", 0.7f, 0, 0.7f); // panel:colors
    AiParameterFlt("offset", 0.5);                 // panel:pattern_controls:open
    AiParameterEnum("mode", 0, mode_labels);       // panel:pattern_controls 
    AiParameterFlt("radius", 0.4);                 // panel:pattern_controls
    AiParameterFlt("uCenter", 0.5);                // panel:pattern_controls
    AiParameterFlt("vCenter", 0.5);                // panel:pattern_controls
    AiParameterVec2("uvCoord", -1,-1);             // panel:UV_controls
    AiParameterBool("useUVCoord", 1);              // panel:UV_controls

Cutter would create/update a file named "mkPatternTemplate.py" with the following python code.

import pymel.core as pm
import mtoa.utils as utils
import mtoa.ui.ae.utils as aeUtils
from mtoa.ui.ae.shaderTemplate import ShaderAETemplate
# Note the name of the class must be AE<shader_name>Template
class AEmkPatternTemplate(ShaderAETemplate):
    def setup(self):
        # Add the shader swatch to the AE
        # Add a list that allows to replace the shader for other one
        self.addCustom('message', 'AEshaderTypeNew', 'AEshaderTypeReplace')
        self.beginLayout("Colors", collapse=False)
        self.addControl("baseColor", label="BaseColor", annotation="")
        self.addControl("patternColor", label="PatternColor", annotation="")
        self.beginLayout("Pattern Controls", collapse=False)
        self.addControl("offset", label="Offset", annotation="")
        self.addControl("mode", label="Mode", annotation="")
        self.addControl("radius", label="Radius", annotation="")
        self.addControl("uCenter", label="UCenter", annotation="")
        self.addControl("vCenter", label="VCenter", annotation="")
        self.beginLayout("UV Controls", collapse=True)
        self.addControl("uvCoord", label="UvCoord", annotation="")
        self.addControl("useUVCoord", label="UseUVCoord", annotation="")
        # include/call base class/node attributes
        # Add Section for the extra controls not displayed before

Maya.env Environment Variable

To ensure the AETemplate.py files are used by the mtoa plugin the following environment variable must be added to the Maya.env file. For convenience the value of the MTOA_TEMPLATES_PATH can be set to the same location as the ARNOLD_PLUGIN_PATH.


In the case of the example "mkPatternTemplate.py" shown above the UI for the mkPattern shader would look like this.

Figure 2

Note the hint (// panel:UV_controls) for the last two parameters did not specify ":open" or ":closed" and consequently the panel labelled "UV Controls" is shown closed.

Arnold MTD Files for Maya and Houdini

Because Arnold C++ shaders and OSL shaders can be used with both Maya and Houdini Cutter now has an option to select the MTD "style" for both types of shaders.

Figure 3 (Arnold SDK)

Figure 4 (Arnold OSL)

© 2002- Malcolm Kesson. All rights reserved.