[MtoA] The case of the instant crash when I load MtoA

In this case, Maya 2015 (Windows) disappeared a few seconds after I clicked the MtoA Loaded check box in the Plug-in Manager. Eventually I tracked it down to this line in my pluginPrefs.mel:

evalDeferred("autoLoadPlugin(\"\", \"PolyTools\", \"PolyTools\")");

Darn you PolyTools, I forgot about you 😉 There’s some kind of conflict between PolyTools (from the Maya BonusTools) and MtoA.

I tracked this down the hard way, by renaming my 2015 MAYA_APP_DIR to 2015-x64.bak and starting over with the default preferences, and then comparing the two.

An easier way (on Windows) would have been to use MTOA_STARTUP_LOG_VERBOSITY along with the -log command-line flag (for example, maya -log %TEMP%\mayastartup.log), which would have given me this:

* Arnold windows icc-13.1.3 oiio-1.4.14 rlm-11.1.2 2015/01/23 16:50:01
* CRASHED in Tstring::formatToWidth at 00:00:00, pixel (0, 0)
* signal caught: error C0000005 -- access violation
* backtrace:
*  0 0x0000000045476700 [ai            ] AiArray                                                                                                                                                                               
*  1 0x0000000045477eff [ai            ] AiArray                                                                                                                                                                               
*  2 0x00000000773cb940 [kernel32      ] UnhandledExceptionFilter                                                                                                                                                              
*  3 0x00000000774e3398 [ntdll         ] MD5Final                                                                                                                                                                              
*  4 0x00000000774685c8 [ntdll         ] _C_specific_handler                                                                                                                                                                   
*  5 0x0000000077479d2d [ntdll         ] RtlDecodePointer                                                                                                                                                                      
*  6 0x00000000774691cf [ntdll         ] RtlUnwindEx                                                                                                                                                                           
*  7 0x00000000774a1248 [ntdll         ] KiUserExceptionDispatcher                                                                                                                                                             
>> 8 0x000007fee46eeb05 [FOUNDATION    ] Tstring::formatToWidth                                                                                                                                                                
*  9 0x000007fee46efff5 [FOUNDATION    ] Tstring::set                                                                                                                                                                          
* 10 0x000007febe593e9c [PolyTools     ] uninitializePlugin                                                                                                                                                                    
* 11 0x000007febe593feb [PolyTools     ] uninitializePlugin                   

[Arnold] [kick] Changing output paths for AOVs

The -o flag changes the output path for the beauty AOV only. For other AOVs, kick still uses the output paths specified in the ASS file (the AOV output paths are specified by the filename parameter of the driver nodes in an ASS file).

 name defaultArnoldDriver@driver_exr.RGBA.direct_diffuse
 filename "C:/Users/StephenBlair/Documents/maya/projects/Support/images/direct_diffuse/Natural_Museum.exr"
 compression "zip"
 half_precision off
 tiled off
 preserve_layer_name off
 autocrop off
 append off

It is possible, however, to use kick -set to change the output path and file name of specific AOVs, but you’d have to know the AOV names in advance. For example:

kick -set defaultArnoldDriver@driver_exr.RGBA.direct_diffuse.filename "C:/temp/direct_diffuse.exr" -i example.ass

[MtoA] Getting Deadline to pick up environment variable changes

Here’s why new environment variable settings (like, say, a new solidangle_LICENSE setting) are not always picked up by Deadline:


Deadline Slave and MayaBatch are child processes of Deadline Launcher, and so they inherit their environment from their parent process (deadlinelauncherservice). If you don’t restart the Launcher, it won’t have the new environment, and neither will child processes like the Monitor or MayaBatch. Restarting the service will restart the child processes too.


However, if you didn’t install the Launcher as a service, it is slightly more complicated. When you exit and restart the Launcher, the child processes may end up as “orphans” with the same old environment, and you’ll have to restart them too. In the screenshot below, Deadline Monitor and Deadline Slave were child processes of Launcher, but when I exited Launcher they kept running.


[MtoA] Mapping textures to Yeti hair

Like MtoA, Yeti exports UV coordinates in the uparamcoord and vparamcoord parameters, and you use these to map textures in the aiHair shader with the Uparam and Vparam extra attributes.

For example, if you plug a texture into the Rootcolor and tipcolor
then you can use uparamcoord and vparamcoord to map that texture onto the hair:

Tip If you enable Expand Procedurals and export an ASS file, you can see what parametes Yeti exports:

### created by pgYetiMayaShape
 name pgYetiMayaShape_|pgYetiMaya|pgYetiMayaShape|scatter01_pSphereShape1_grow01
 num_points 621 1 b85UINT
# ...
 points 4347 1 b85POINT
# ...
 basis "catmull-rom"
 mode "ribbon"
 min_pixel_width 0
 visibility 255
 self_shadows on
 1 0 0 0
 0 1 0 0
 0 0 1 0
 0 0 0 1
 shader "initialShadingGroup"
 opaque on
 id -1230660816
 declare curve_id uniform UINT
 curve_id 621 1 b85UINT
# ...
 declare uparamcoord uniform FLOAT
 uparamcoord 621 1 b85FLOAT
# ...
 declare vparamcoord uniform FLOAT
 vparamcoord 621 1 b85FLOAT
# ...
 declare surf_s uniform FLOAT
 surf_s 621 1 b85FLOAT
# ...
 declare surf_t uniform FLOAT
 surf_t 621 1 b85FLOAT
# ...
 declare length uniform FLOAT
 length 621 1 b85FLOAT
# ...
 declare fur_id uniform FLOAT
 fur_id 621 1 b85FLOAT
# ...
 declare surf_n uniform VECTOR
 surf_n 621 1 b85VECTOR
# ...
 declare filename constant STRING
 filename "C:/Users/StephenBlair/Documents/maya/projects/Support//yeti/tmp/yeti_combExample_pgYetiMayaShape_1886244453_1.fur"
 declare mtoa_shading_groups constant ARRAY NODE
 mtoa_shading_groups "initialShadingGroup"
 declare frame constant INT
 frame 1
 declare verbosity constant INT
 verbosity 1
 declare density constant FLOAT
 density 10
 declare width constant FLOAT
 width 1
 declare threads constant INT
 threads 0
 declare min_pixel_width constant FLOAT
 min_pixel_width 0
 declare mode constant INT
 mode 0
 declare imageSearchPath constant STRING
 imageSearchPath ""
 declare samples constant ARRAY FLOAT
 samples 1

Getting an Arnold log from Royal Render

I’ve had a few cases where people weren’t sure how to get the Arnold log from Royal Render. The Arnold log is pretty important, at least for me, so here’s how to get it.

First, when you submit the job, set the log verbosity in rrSubmitter. You can do that in the Override section, but note that the verbosity levels in the Verbose list don’t match up with the newer MtoA verbosity levels. To get a Debug log, you’ll have to set the Verbose to Progress.


You can view the log in rrControl:

[MtoA] [SItoA] Setting multiple Arnold parameters with a User Options string

If you want to set multiple Arnold parameters in a User Options string, you can use any whitespace (spaces, tabs, newlines eg \n) that you would use in an actual ASS file.

For example, this:

enable_procedural_cache off error_color_bad_pixel 1 .25 1 declare test constant FLOAT test 2

would add these lines to your options node:

 error_color_bad_pixel 1 0.25 1

 enable_procedural_cache off

 declare test constant FLOAT
 test 2

Note: Plugins like MtoA and SItoA use AiNodeSetAttributes to set the user options.

The User Options string is a way to set parameters that are not exposed by the plugins. MtoA provides a User Options string for the render options and for shapes. SItoA also has User Options strings for render options and shapes.