You may have noticed the Force Translate Shading Engine option in the export dialog (or in the Feature Overrides section of the Render Settings).
Force Translate Shading Engines forces MtoA to export shape nodes with a shader link, like this:
declare mtoa_shading_groups constant ARRAY NODE
where “aiStandard1SG” is the name of a MayaShadingEngine shader node.
This allows you to keep your shapes and shaders in separate ASS files. For example, you could have one standin that loads the shapes, and a second standin that loads the shaders. As long as the shape nodes include links to the shaders, Arnold will resolve the links and render the shapes with the right shaders.
For the render -rt 1 command, you can specify the output ASS name in
the defaultArnoldRenderOptions.output_ass_filename attribute. For example:
set PRE_RENDER_MEL="setAttr -type \"string\"
render -s 6 -e 8 -r arnold -rt 1 -preRender %PRE_RENDER_MEL%
The scene should have the Frame/Animation ext set to something like
“name.#.ext”. Otherwise, if it is “name.ext” you’ll get filenames like
output_ass_filename can have environment variables, but you have to be
careful to use forward slashes. For example:
set PRE_RENDER_MEL="setAttr -type \"string\" defaultArnoldRenderOptions.output_ass_filename \"%OUTPUT_ASS_FILENAME%\";"
render -s 6 -e 8 -r arnold -rt 1 -preRender %PRE_RENDER_MEL% C:\projects\Support\scenes\_2016\XSI_deformed_logo.mb
There’s also the arnoldExportASS command, if you want to script the export.
maya -batch -file scene.mb -command "arnoldExportAss
-f "/home/blairs/Desktop/example.ass" -mask 255 -lightLinks 1 -compressed
-shadowLinks 2 -cam sideShape;"
The Arnold log is important, not just for troubleshooting and getting help from us at Solid Angle, but also for understanding what’s going on when Arnold renders your scene.
To get an Arnold log:
- In Maya, click Render > Render Settings
- In the Render Using list, click Arnold Renderer
- Click the Diagnostics tab.
- Set the Verbosity level to at least Warnings + Info
- Click the File check box to enable file logging (by default, the log file will be saved in the last folder you browsed to with Maya; see Finding your log file).
- If you want to be absolutely sure of where to find the log file, click the folder icon beside the Filename box, and select a location for the Arnold log file.
- Depending on what OS you use, and how you started Maya, the log is also output to the Output Window (Windows) or to the terminal (on OSX and Linux if you started Maya from a terminal)
For batch rendering, Arnold log messages go into mayaRenderLog.
- [Windows] %USERPROFILE%\Documents\maya\mayaRenderLog.txt
- [OSX] ~/Library/Logs/Maya/mayaRender.log
- [Linux] ~/maya/mayaRenderLog.txt
If you have both Renderman and MtoA installed, you may see a warning that says “Arnold for Maya degrades Renderman performance.” Unless you are running a version of MtoA from 20 months ago, this performance warning is false. MtoA does not degrade Renderman performance.
This was fixed in Arnold 220.127.116.11 (fix #4393 main thread was pinned to a single core) back in January 2015.
MtoA 18.104.22.168 ships with Arnold 4.2.13.
If you want to take advantage of the improvements in Arnold 22.214.171.124 (like the increase in the maximum number of threads from 128 to 256), here’s what you need to do:
- Download Arnold 126.96.36.199 and extract the archive
- Replace Arnold (libai.so, ai.dll, libai.dylib), kick, and maketx in the MtoA bin folder with the versions from the Arnold 188.8.131.52 download
- Replace the Arnold Python bindings in the MtoA scripts/arnold folder with the Python bindings from the Arnold python/arnold folder. For example, replace this folder:
with the python\arnold folder from the Arnold 184.108.40.206 download. For example:
You must update the Arnold Python bindings, otherwise MtoA won’t load. That’s because Arnold 220.127.116.11 included a number of API changes, including the removal of some API (like AiLicenseSetServer). The older Python bindings still refer to the removed API, so there will be Python errors that prevent MtoA from loading.
Arnold uses the OpenImageIO texture cache. From the OIIO Programmer Documentation:
In short, if you have an application that will need to read pixels from many large image files, you can rely on ImageCache to manage all the resources for you. It is reasonable to access thousands of image files totalling hundreds of GB of pixels, efficiently and using a memory footprint on the order of 50 MB.
So, if you’re using tx files (tiled and mipmapped textures), then Arnold can read tiles as required, and use the texture cache to keep memory usage under control.
The reason we don’t read all the textures at once is that many of our customers have (literally) 100+GB of textures, so we use a texture cache that constantly loads small bits of texture data as required, and unloads old data.
By default, the size of the texture cache is 2048KB (as of Arnold 18.104.22.168). The size of the texture cache is set in the Arnold Render Settings.
Max Cache Size
The maximum amount of memory to be used for texture caching. Arnold uses a tile-based cache with a LRU (Least Recently Used) type algorithm, where the least recently used tiles are discarded when the texture caches is full.
Note If we get an error reading a texture, we mark that texture as bad and we never try to read it again. This makes the renderer a lot faster when you have a missing texture, since we won’t ask the file server millions of times to read from a nonexistent file. But in a transient network error case, one bad experience and the rest of your render has the texture missing.
If, like me, you need to switch between different versions of MtoA, here’s a recipe for setting that up.
First, you have to install multiple versions. As you probably already know, the MtoA installer always wants to uninstall first. I take care of that by zapping the Uninstall registry entry with this command:
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\MtoA2016" /f
Then I run the MtoA installer and install in a folder with the version name, like this:
I start Maya with a batch file that creates a symbolic link named “C:\solidangle\mtoadeploy\2016” that links to the version of MtoA I want to use:
mklink /D C:\solidangle\mtoadeploy\2016 C:\solidangle\mtoadeploy\2016-22.214.171.124
rem mklink /D C:\solidangle\mtoadeploy\2016 C:\solidangle\mtoadeploy\2016-126.96.36.199
start "" "C:\Program Files\Autodesk\Maya2016\bin\maya.exe" %* -log %TEMP%\maya.log
My batch file also adds the location of my custom mtoa.mod to MAYA_MODULE_PATH. My custom mtoa.mod points to “C:\solidangle\mtoadeploy\2016”, and handles all versions of Maya:
+ MAYAVERSION:2016 mtoa any C:\solidangle\mtoadeploy\2016
PATH +:= bin
+ MAYAVERSION:2015 mtoa any C:\solidangle\mtoadeploy\2015
PATH +:= bin
+ MAYAVERSION:2014 mtoa any C:\solidangle\mtoadeploy\2014
PATH +:= bin
+ MAYAVERSION:2013 mtoa any C:\solidangle\mtoadeploy\2013
PATH +:= bin