Exporting user data parameters to Arnold from Maya


You can add attributes to shape nodes in Maya, and MTOA will export those extra attributes as user data in Arnold shape nodes. For example, you use this mechanism to add user data to a procedural node.

Add some extra attributes to a shape node, using the naming convention mtoa_constant_parameter-name. That is, the attribute name must always start with “mtoa_constant_”.
AddAttribute

Export to ASS. In the .ass file, your extra attributes will be declared as user parameters:

procedural
{
 name ArnoldStandInShape
 dso "C:/Users/SOLIDANGLE/Dev/MyProcedural.dll"
 min -9.63329697 0 0.861843109
 max -6.73797035 3.62841082 9.87797546
 matrix 
  1 0 0 0
  0 1 0 0
  0 0 1 0
  0 0 0 1 
 declare MyVector constant VECTOR
 MyVector 0 0 0
 declare MyFloat constant FLOAT
 MyFloat 0
 declare MyInteger constant INT
 MyInteger 0
 declare MyBoolean constant BOOL
 MyBoolean off
 declare MyString constant STRING
 MyString ""
}

Setting the Arnold log verbosity level


RenderSettings-Log

Here’s what you’ll get in Maya for the different verbosity levels.
In general, the higher the verbosity, the more diagnostic log information you get.
Each verbose level includes everything in the lower levels.

In brief, here’s how the verbosity levels work in MTOA 0.21:

  • verbosity=0 is silent mode.
  • At verbosity=1, you get ERRORS and WARNINGS.
  • At verbosity=2, you get ERRORS and WARNINGS and INFORMATION.
  • At verbosity=3, you get ERRORS and WARNINGS and INFORMATION and PROGRESS.

Here’s a bit more detail on the verbosity levels in MTOA 0.21.

0 Absolute silence. Nothing will be logged, no matter what happens.
1 ERRORS, WARNINGS, and, in the case of a crash or other “abnormal program termination”, the backtrace (stack contents).
2 Basic information
3 Progress messages.
4 Render statistics, and plugin loading information.
5 Everything except diagnosics. Verbosity levels 4 and 5 are pretty much the same, except that level 5 adds:

  • WARNINGS for NAN pixels
  • messages about sub-surface scattering pointclouds
  • .ass-file parsing details
6 Everything, including diagnostics.

In MTOA 0.20 and earlier, the verbosity levels were different:

0 Absolute silence. Nothing will be logged, no matter what happens.
1 ERRORS and, in the case of a crash or other “abnormal program termination”, the backtrace (stack contents).
2 WARNINGS
3 Basic information.
4 Progress messages, render statistics, and plugin loading information.
5 Everything except diagnosics. Verbosity levels 4 and 5 are pretty much the same, except that level 5 adds:

  • WARNINGS for NAN pixels
  • messages about sub-surface scattering pointclouds
  • .ass-file parsing details
6 Everything, including diagnostics.

Here’s some samples of the different types of log output:

WARNINGS, ERRORS, and information

00:00:00   516MB         | log started Thu Dec 13 10:27:49 2012
00:00:00   516MB         | Arnold 4.0.10.2 windows icc110 oiio1012 rlm932 (build date: Oct 30 2012 15:25:33)
00:00:00   516MB         | running on SOLIDANGLE-PC
00:00:00   516MB         |  1 x Intel(R) Xeon(R) CPU E3-1240 V2 @ 3.40GHz (4 cores, 8 logical) with 16334MB
00:00:00   516MB         |  Windows 7 Professional Service Pack 1 (version 6.1, build 7601)
00:00:00   516MB         |  
00:00:05   516MB WARNING | [rlm] could not connect to license server on 5053@localhost
00:00:05   516MB         |  
00:00:05   516MB         | there are 0 lights and 1 object:
00:00:05   516MB         |  1 polymesh
00:00:05   516MB         |  
00:00:05   516MB         | rendering image at 640 x 480, 3 AA samples, 2 GI samples, 1 GI bounces
00:00:05   516MB         |  active camera: 'perspShape'
00:00:05   516MB         |  initializing 11 nodes ...
00:00:05   516MB         |  node initialization done in 0:00.00
00:00:05   519MB         |  creating root object list ...
00:00:05   519MB         |   scene bounds: (-6.33536005 -4.01219463 -10.337409) -> (6.23116827 6.43629837 13.2852964)
00:00:05   519MB         |  updating 11 nodes ...
00:00:05   519MB         |  node update done in 0:00.00
00:00:05   519MB WARNING |  [aov] driver "defaultArnoldDriver@driver_exr.RGB" does not support POINT2 pixels
00:00:05   519MB WARNING |  [aov] driver "defaultArnoldDisplayDriver@renderview_display" does not support POINT2 pixels
00:00:05   519MB WARNING |  [aov] driver "defaultArnoldDriver@driver_exr.RGB" does not support POINT2 pixels
00:00:05   519MB ERROR   |  [aov] no valid outputs - can't continue
00:00:05   519MB         |   
00:00:05   519MB         |  releasing resources
00:00:05   516MB   

Progress messages (at 5% increments during rendering)

00:00:05   492MB         |  starting 8 bucket workers of size 64x64 ...
00:00:05   503MB         |     0% done - 27 rays/pixel
00:00:05   504MB         |     5% done - 108 rays/pixel
00:00:06   505MB         |    10% done - 101 rays/pixel
...
00:00:07   500MB         |   100% done - 33 rays/pixel
00:00:07   499MB         |  bucket workers done

Render statistics
which includes things like scene creation time, render time, memory consumed, ray counts, lighting calculations, shader calls, geometry stats, and tesselation.

00:00:07   499MB         | -----------------------------------------------------------------------------------------
00:00:07   499MB         | ray counts:                           (/pixel , /sample) (% total) (avg. hits) (max hits)
00:00:07   499MB         |  camera                       2946240 (   9.00,    1.00) ( 31.80%) (     0.24) (       1)
00:00:07   499MB         |  shadow                       1303706 (   3.98,    0.44) ( 14.07%) (     0.00) (       0)
00:00:07   499MB         |  diffuse                      3339596 (  10.20,    1.13) ( 36.05%) (     0.29) (       1)
00:00:07   499MB         |  glossy                       1675254 (   5.12,    0.57) ( 18.08%) (     0.31) (       1)
00:00:07   499MB         |  total                        9264796 (  28.30,    3.14) (100.00%) (     0.25) (       1)
00:00:07   499MB         |  max depth                          2

Diagnostics includes messages from the mtoa plugin, information about the bvh acceleration structures, and plugin loading/unloading info.

00:00:00   493MB         | [mtoa.session] Setting export camera to "persp"
00:00:00   493MB         | [mtoa] Exporting scene
00:00:00   493MB         | [mtoa.extensions]  aiOptions Using translator , provided by ().
00:00:00   493MB         | [mtoa.translator]  defaultArnoldRenderOptions     | : Exporting Arnold options(options): 000000002B36F2E0
00:00:00   493MB         | [mtoa] [aov beauty] Setting AOV output: filter and driver.

Rendering a Z-depth AOV with Arnold


To get z-depth data out of Softimage with Arnold, you can use the built-in Softimage Depth render channel. Depth outputs a floating point image, so you need to use a format like EXR.

Depth

The Depth channel will give you non-antialised, non-normalized depth data in the alpha channel. In the DCC, it will appear solid white, but that’s because the data is non-normalized.
Depth-RR

Non-normalized means that the Z depth values are not between 0 and 1, but between the near and far camera clipping planes, so you need to divide the Z values by the far clipping plane value to get 0..1 values. You can use a compositing package like Nuke for this. Myself, I don’t have Nuke, so I used Composite to normalize the Z depth AOV:
Depth-composite

In Maya, you’d use the Z AOV to render out the Z-depth information. In Softimage, Depth is mapped to the Z AOV, and if you export a .ass, you’ll see the “Z” AOV listed in the options node.

 outputs 2 1 STRING 
  "RGBA RGBA sitoa_output_filter Passes.Default_Pass.Main" 
  "Z FLOAT sitoa_closest_filter Passes.Default_Pass.Depth"