[MtoA] Getting the MtoA build ID


When you contact support or log bugs, it’s nice to provide the version number and build ID of the MtoA version that you’re using.

This information is displayed in the Arnold > About box.

mtoa_buildid

But the build id (circled in the screenshot) is kinda a pain to type out. Fortunately, you can get the build ID with the arnoldPlugins command:

arnoldPlugins -gbi;
// Result: 261bd4ca (master) //

You can get both the MtoA version and the MtoA build ID like this:

print( "MtoA " + `pluginInfo -v -q "mtoa.mll"` + " - " + `arnoldPlugins -gbi`);

In Python:

print( "MtoA {} - {}".format( cmds.pluginInfo( 'mtoa', query=True, version=True), cmds.arnoldPlugins(getBuildID=True) ) )
# MtoA 1.4.2.2 - 261bd4ca (master)

[MtoA] UnicodeEncodeError when rendering


UnicodeDecodeError

If you get this UnicodeEncodeError when you render

# Error: line 1: UnicodeEncodeError: file C:\Program Files\Autodesk\Maya2016\bin\python27.zip\encodings\utf_8.py line 16: ascii #

it’s probably because because the project folder has a special character in the name (for example, an accent mark like é).

If that’s not it, then we’d need more context (hint: everything else that is logged in the script history).

For a project name with a special character, you’ll see something like this in the script history:

file -f -save -options "v=0;";
// C:/maya/projects/New_Projéct/scenes/blank.mb // 
# Error: line 1: UnicodeEncodeError: file D:\Program Files\Autodesk\Maya2017\bin\python27.zip\encodings\utf_8.py line 16: ascii # 
# Error: line 1: UnicodeEncodeError: file D:\Program Files\Autodesk\Maya2017\bin\python27.zip\encodings\utf_8.py line 16: ascii #

 

 

The case of the missing Yeti fur


In this case, a client complained that Arnold wasn’t rendering Yeti fur. I asked him to try with a simple sphere, and to send me the log (at verbosity level Warnings + Info).

This what I was looking for:

00:00:00  1222MB         | there are 1 light and 2 objects:
00:00:00  1222MB         |       1 persp_camera
00:00:00  1222MB         |       1 skydome_light
00:00:00  1222MB         |       1 utility
00:00:00  1222MB         |       1 lambert
00:00:00  1222MB         |       1 driver_exr
00:00:00  1222MB         |       1 gaussian_filter
00:00:00  1222MB         |       1 polymesh
00:00:00  1222MB         |       1 list_aggregate
00:00:00  1222MB         |       1 MayaShadingEngine
00:00:00  1222MB         |       1 renderview_display

So, what’s there? Well, the important thing is not what’s there, but what’s not there.

There’s no procedural. If Yeti was installed properly, there would a procedural node. The Yeti extension exports a procedural node when MtoA translates the scene.

That means the PATH or MTOA_EXTENSIONS_PATH wasn’t set up properly. I always use the Yeti module file for that.

[MtoA] Warning: Renderer “arnold” does not provide batch rendered options


Not all renderers have batch render options, so if you click the box beside the Batch Render menu command:

menu_options_box

then you’ll get a warning:

// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "arnold" does not provide batch rendered options. // 
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaHardware" does not provide batch rendered options. // 
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaHardware2" does not provide batch rendered options. // 
// Warning: file: C:/Program Files/Autodesk/Maya2017/scripts/others/batchRenderOptions.mel line 19: Renderer "mayaVector" does not provide batch rendered options. //

All the rendering options for Arnold are in the Arnold Render Settings.

To start a batch render, click the Batch Render text in the Render menu:
render_menu

[MtoA] The case of the machine that was unable to dynamically load mtoa.mll


In this case, a Windows 7 machine did support SSE4.2, but Maya 2017 still couldn’t load mtoa.mll.

I didn’t get a full Process Monitor log from the client, but I did get a Dependency Walker log, and this case, that was enough.

When you first open a Dependency Walker (dwi) file, it’s easy to focus on the wrong thing. In this case, the missing MSVCR90.DLL (Visual Studio 2008 redistributable) might catch your eye.

dwi_01.jpg

But you can ignore that, because if you take a closer look, you’ll see that MSVCR90.DLL is indeed found and loaded.

dwi_02.jpg

Likewise, you can ignore all these. You’ll almost always see most of those in a Dependency Walker log for Windows 7 and up.

dwi_03

What’s important in this depends log is the warning for AI.DLL.

dwi_04

That warning means that there’s missing functions: MtoA (MTOA.MLL) expects to use certain functions provided by Arnold (AI.DLL), but those functions aren’t there. For example:

dwi_05

And finally, if we click View > Full Paths, we see the reason for the problem:

dwi_06

There’s some older version of Arnold on the system, and that old version is being loaded by MtoA.mll. Most likely, the system PATH includes this location.

With a Process Monitor log, we would have seen right away that ai.dll was being loaded from a non-standard location.

 

[MtoA] What environment variables does MtoA use?


MtoA uses these environment variables:

  • ARNOLD_PLUGIN_PATH is for shaders.
    MtoA and kick use this environment variable. Arnold doesn’t (when you write Arnold code that loads an ASS file, Arnold doesn’t getenv ARNOLD_PLUGIN_PATH)
  • MTOA_TEMPLATES_PATH is for the Attribute Editor (AE) templates of Arnold shaders. For example, if you use the alShaders:
    set MTOA_TEMPLATES_PATH  C:\solidangle\alShaders\alShaders-win-1.0.0rc18-ai4.2.12.2\ae
  • MTOA_EXTENSIONS_PATH is for MtoA extensions like Yeti. By default, MTOA_EXTENSIONS_PATH points to the extensions folder in the MtoA installation.
  • MAYA_CUSTOM_TEMPLATE_PATH is for Node Editor templates for Arnold shaders. For example, if you use the alShaders:
    set MAYA_CUSTOM_TEMPLATE_PATH C:\solidangle\alShaders\alShaders-win-1.0.0rc18-ai4.2.12.2\aexml
  • My personal favorite, MTOA_STARTUP_LOG_VERBOSITY, sets the MtoA log verbosity during startup: 1 for Errors and Warnings, 2 for Errors, Warnings, and Info, and 3 for all. This can be handy for troubleshooting MtoA loading problems.
  • MTOA_LOG_PATH is the default location for Arnold log files.

These are not MtoA environment variables:

  • ARNOLD_PROCEDURAL_PATH is an HtoA environment variable. It’s not used by MtoA (or kick).
  • MTOA_PROCEDURAL_PATH doesn’t exist. No such environment variable is used or supported by MtoA.
  • [MtoA] Unable to dynamically load : mtoa.mll The specified module could not be found.


    I have another, more general, version of this post here. This one is for new Arnold users with Maya 2017.

    Here’s what to do if you get errors like this:

    // Error: file: C:/Program Files/Autodesk/Maya2017/scripts/startup/autoLoadPlugin.mel line 32: Unable to dynamically load : C:/solidangle/mtoadeploy/2017/plug-ins/mtoa.mll
    The specified module could not be found.
    //
    // Error: file: C:/Program Files/Autodesk/Maya2017/scripts/startup/autoLoadPlugin.mel line 32: The specified module could not be found.

    Check if your processor supports SSE4.1

    As of Arnold 4.2.16.2, the SSE requirement is now SSE4.1

    If this is the first time you’ve tried to use the Maya to Arnold (MtoA) plugin, then check whether your processor supports SSE4.1.

    Reinstall MtoA

    If MtoA used to load, but now it doesn’t, then something happened to the MtoA installation. I’ve seen several cases where DLLs were missing from the MtoA bin folder; most importantly, Arnold itself was missing (Arnold is ai.dll on Windows, or libai.so on Linux, or libai.dylib on OSX).

    If you make a backup copy of the MtoA install folder, we can investigate after you fix things by installing MtoA.

    Get a Process Monitor log

    If a clean install of MtoA doesn’t work (and the computer does support SSE4.1), then “The specified module could not be found.” usually means there’s a missing dependency. Dependency Walker is a decent, if aging, tool for checking out dependencies, but for leaving no stone unturned, I prefer Process Monitor.

    The MtoA plugin (mtoa.mll) depends on a handful of files only. Here’s the log of loaded DLLs for a working MtoA:

    process_monitor_mtoa

    Here’s a quick walkthrough (no audio) of how to get a Process Monitor log: