Reason #35 why you should check the Arnold log
In this case, a scene that used to render yesterday, now just resulted in a blue render view, like this:
Anytime the render view doesn’t update when your render, you can be fairly sure there’s some ERROR in the Arnold log.
In this case, the problem was a broken path to the IES file used by a photometric light. In the Arnold log, there was this ERROR:
00:00:04 870MB ERROR | [photometric] can't open C:/Assets/IES/example.ies
It’s easy to say “check the log”, but where do you find the log? It’s not like there’s a nice, color-coded button (red for error) on the render view UI that will pop up the log for you.
- On Windows, you should see the Arnold log in the Output Windows. However, I find that this happens only when I start Maya from the command line. If I start Maya from the Windows Start menu, the Arnold log messages don’t show up in the Output Window. So I have to enable file logging, and check the log file.
- On OSX and Linux, you’ll also have to enable file logging, unless you start Maya from a terminal.
Update: For Google:
- Arnold renders a black screen
- Arnold renders a blue screen
Any time you see “node … is not installed” and “unresolved reference” warnings when you try to kick an ASS file exported from Maya, the problem is missing MtoA shaders.
00:00:00 18MB WARNING | [ass] line 259: node "MayaFile" is not installed
00:00:00 18MB WARNING | [ass] line 288: node "MayaShadingEngine" is not installed
00:00:03 23MB WARNING | [ass] line 238: pSphereShape1.mtoa_shading_groups: unresolved reference to 'aiStandard2SG'
00:00:03 23MB WARNING | [ass] line 137: aiSkyDomeLightShape1.color: unresolved reference to 'file1'
00:00:03 23MB WARNING | [ass] line 188: pPlaneShape1.shader: unresolved reference to 'aiStandard1SG'
00:00:03 23MB WARNING | [ass] line 197: pPlaneShape1.mtoa_shading_groups: unresolved reference to 'aiStandard1SG'
00:00:03 23MB WARNING | [ass] line 229: pSphereShape1.shader: unresolved reference to 'aiStandard2SG'
When you render with kick, you need to specify the location of the MtoA shaders. You can do this several ways:
Arnold 126.96.36.199 added support for per-light AOVs for volumetrics.
Here’s how to set up per-light AOVs in MtoA 188.8.131.52:
- In the light Attribute Editor, enter a name for the light group.
- Create a custom AOV for the light group. Give the AOV a name that starts with “volume_”. For example, if the light group name is “red”, then the AOV name is “volume_red”.
Loading MtoA isn’t enough to create the defaultArnoldRenderOptions node. The defaultArnoldRenderOptions node isn’t created until a user opens the Arnold Render Settings for the first time.
In code, you can do it like this:
from mtoa.core import createOptions
# Set default render options
setAttr( "defaultArnoldRenderOptions.motion_blur_enable", 1 )
When createOptions() creates the defaultArnoldRenderOptions node, it also creates the defaultArnoldDisplayDriver, defaultArnoldDriver, defaultArnoldFilter nodes and hooks them up to the defaultArnoldRenderOptions node.
Note that for setting defaults like this, you can also user a userSetup.py file. createOptions() calls hook functions that you can implement in your userSetup.py.
Here’s something important to remember when you’re debugging a scene…
By default, the MayaFile node uses a default color if a texture is missing.
This means the render won’t abort because of missing textures, and you won’t see ERRORs like these in the Arnold log for missing texture files:
ERROR | [texturesys] OpenImageIO could not open "sourceimages/noicon.tx" as tx: Could not open file "sourceimages/noicon.tx"
ERROR | [texturesys] Invalid image file "sourceimages/noicon.tx"
So missing textures can easily go unnoticed.
If you need to disable Use Default Color for testing, an easy way is to export an ASS file and then render it with kick -set MayaFile.useDefaultColor false.
I suppose you could also modify the Maya scene file directly:
import maya.cmds as cmds
for item in filenodes:
cmds.setAttr( "%s.aiUseDefaultColor" % item, b )
set_useDefaultColor( False )
And finally, you can change the default value of the Use Default Color parameter by adding this to shaders/mtoa_shaders.mtd:
default BOOL false
No, there isn’t. HtoA recently added support for an ARNOLD_PROCEDURAL_PATH environment variable, but neither MtoA or Arnold itself support ARNOLD_PROCEDURAL_PATH.
Here’s a few things you can do:
If you want to instance lights in Maya, use Duplicate Special. MtoA will correctly translate those instances to Arnold (as copies, not instances, because Arnold itself doesn’t support light instances).
MtoA doesn’t support the particle instancer for lights.
PS I don’t think Maya supports instancing lights with the particle instancer. The Maya docs say “Do not instance lights; they’ll have no effect in rendering.”, and that’s the behavior I’ve observed with mental ray and the Maya Software renderer. Also, if I leave the viewport set to Viewport 2.0, Maya crashes when I try to use the particle instancer with point or spot lights (and that’s without MtoA loaded).
MtoA provides an arnoldFlushCache command (and the Arnold > Flush Caches menu uses that command). You can call it from Python like this:
import maya.cmds as cmds
cmds.arnoldFlushCache( textures=True )
mayaBump2D has an RGB parameter for normal maps, and it’s named “normal_map”:
C:\solidangle\mtoadeploy\2015\bin>kick -l ..\shaders -info mayaBump2D
Type Name Default
------------ -------------------------------- --------------------------------
FLOAT bump_map 0
FLOAT bump_height 1
RGB normal_map 0, 0, 1
BOOL flip_r true
BOOL flip_g true
BOOL swap_tangents false
BOOL use_derivatives true
BOOL gamma_correct true
ENUM use_as bump
RGBA shader 0, 0, 0, 1
In Maya, you don’t connect your normal map directly to mayaBump2D.normal_map. Instead, just connect the normal map alpha to the Bump Value
and then change bump2d > 2d Bump Attributes > Use As to Object Space Normals or Tangent Space Normals.
The Use As parameter controls how MtoA translates the shaders to Arnold. For example, if Use As is Object Space Normals, you get this:
Notice that file1 (the MayaFile node) is linked to mayaBump2D.normal_map.
When you enable file logging, it can seem a bit of a mystery where the .log files end up. You may find log files in different folders of your project, like the scenes folder, or the sourceimages folder.
Here’s how it works.
- If the MTOA_LOG_PATH environment variable is set, the log files are saved to the folder specified by MTOA_LOG_PATH.
- If MTOA_LOG_PATH is not set, the log files are saved in the current workspace directory (in MEL, that’s workspace -q -directory). In other words, the log files are saved to last place you went with the Maya file browser. If you haven’t used the file browser yet, the log file is saved in the root folder of the project.
- If you click the folder icon beside the Filename text box, you can choose where the log files are saved.
Note that the log files will always include the frame number, so you’ll get arnold.1.log, arnold.2.log, and so on.