[MtoA] Running a silent install on Windows

On Windows, if MtoA isn’t already installed, then the /S flag will do a silent install:

MtoA- /S

You can also specify an install location with the /D flag:

MtoA- /S /D=C:\solidangle\mtoadeploy\2016-
There’s no help, but I found the /S and /D via Google:

There is no silent install on OSX or Linux.

If another version of MtoA is installed, there will be some pop-up dialogs. You can get around that by doing a silent uninstall, like this:
C:\solidangle\mtoadeploy\2016-\uninstall.exe /S

or, if you want to keep the existing install around, you could do this:

reg DELETE HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\MtoA2016 /f

After you delete that registry key, an MtoA install won’t detect an existing installation, so you get to keep the old install, and install a new version.


[C4DtoA] Understanding shaders and AOVs

Arnold takes care of writing the built-in AOVs like N, P, Pref, A, and the all-important beauty. But it’s shaders that write to AOVs like direct_diffuse. That’s why something like this is not going to give you what you might expect in the AOVs:


layer_color doesn’t write to AOVs, so you won’t see the layered result in an AOV like direct_diffuse. standard does write to the direct_diffuse AOV (and others), but in this setup, you have multiple standards and they end up overwriting each other, so you get just the last standard output in the AOVs.

It’s better practice to avoid having multiple standard nodes in a single material; instead, layer the maps that go into the standard parameters like the diffuse and specular colors.

Or you could use a node like mix, or the third-party alLayer, which support AOVs. You can tell if a node writes AOVs by looking at its Attribute Editor: there’s usually a tab or list where you can change the names of the AOV outputs.


[MtoA] Use any mesh for a standin

MtoA includes an enhancement (“standin as attribute group”) that allows you to use any mesh as a standin. So instead of the aiStandin node, you can have a proxy geometry to represent your standin.

For example, here’s a mesh shape that loads an animated ASS sequence exported from Softimage:

Note that in the shape Attribute Editor, the Arnold Translator is set to procedural.

This feature uses the mesh bounding from Maya, so it’s possible your standin maybe clipped. You can work around this either by disabling Defer Procedural Load, or by using the User Options to set the procedural min and max (for example: min -1 -1 -1 max 1 1 1).

Hat tip: Alf

[Arnold] Setting core affinity aka pinning threads

Instead of setting the core affinity yourself, you should let Arnold do it. By default, Arnold pins threads (sets the affinity) if you use more than half the cores on the machine.

If you really must set affinity yourself, you can use the Override User Options to set options.pin_threads to off.

BUT you can also limit the number of threads Arnold uses: in the Render Settings, System tab, clear the Autodetect Threads check box and then set the number of threads. For example, you could limit Arnold to six threads, and limiting the threads is probably a better approach, since you won’t end up with multiple render threads running on the same core, which can be bad for performance. This way, you wouldn’t need to set the affinity at all.

See Also:

  • As of Arnold, options.pin_threads works on Windows too.
  • Thread affinity was added in Arnold
    From the Arnold release notes:
    Threads can now be pinned to cores on Linux. This can improve scalability in modern machines with 16 or 24+ threads and, in the case of ray acceleration structure builds, it can occasionally result in as much as a 3x speedup when all the cores are being used (which is the default in Arnold, options.threads = 0 or -t 0 in kick). The default setting is auto where thread pinning is only enabled if more than half the logical cores are being used.
    This can also be manually set to always on or off by setting the new global option options.pin_threads to on, off, or auto. Note that, if client code, for instance a custom shader, spawns their own threads manually (with pthread_create or similar), these threads will inherit the same thread affinity, which totally breaks the point of spawning threads; in these situations they can either set options.pin_threads to off or they can create their threads with the Arnold API AiThreadCreate() which will un-pin the created thread. (#2733)
  • pin_threads
    Arnold can pin threads on linux and Windows so they don’t jump between multiple processors. This can improve scalability in modern machines multiple processors. It can be set to off, on or auto. By default is set to auto, meaning that if the number of threads is more than half the number of logical cores on the machine, arnold will pin the threads.
  • Adjustable thread priority in OS X: OS X now allows for options.thread_priority to adjust the priority of the render threads. It defaults to lowest, which is lower than the system default that was previously being used. Previously this option only existed in Windows.

[Arnold] Getting component links to node parameters with the Python API

Let’s say you have something like this:

 name alRemapFloat1
 input alCombineColor1.r

where the R component of the alCombineColor node is linked to the alRemapFloat.input parameter.

To get the component that is linked to input, you use the comp parameter of AiNodeGetLink(), like so:

node = AiNodeLookUpByName( "alRemapFloat1" )
comp = c_int()
linked_node = AiNodeGetLink( node, "input", comp);

Since R is connected, comp will be 0.

comp is -1 if the entire output is linked, or a number between 0 and 3 to indicate a specific component (0 for r, 1 for g, 2 for b, and 3 for a)

Note that you can pass a c_int to AiNodeGetLink(). ctypes takes care of converting it to a byref() for you.

[MtoA] Adding user data to standin instances

The standard way to add user data to an Arnold node is to add an mtoa_constant attribute to the shape node in Maya. MtoA translates the mtoa_constant attributes to user data, so you can use shaders like AiUserDataColor.

Instances in Maya, however, don’t have their own shape node: they all share the shape node of the original object. So you can’t use an mtoa_constant attribute on the shape to get different user data for each instance.

But you can use override sets to get user data on instances. Put the instances in a set, and then add the mtoa_constant as an override attribute.


Then each instance in the set will get that user data.

Another way to add user data to instances is with the particle instancer: you can add per-particle attributes, and then list them in the Arnold > Export Attributes text box. MtoA translates all those attributes to user data on the particle instances.

[MtoA] Exporting XGen archives

Finally, I have XGen > Generate > Export Selection as Archive working with Maya 2016 Extension 1 + SP5 on Windows 7.

I recently updated to SP5 from SP4, but I don’t know if that’s part of why the export works now. But I do know that I had to install mental ray for Maya 2016. I didn’t need to load Mayatomr, I just needed it installed. And then Export Selection as Archive worked!

PS I did see that thread on cgtalk about modifying xgenMR.py and xgenMRExport.py, but that didn’t work on my Windows 7 machine.

UPDATE: In summary, to export XGen archives, you need to:

  • install Mayatomr (but you don’t need to load it)
  • load xgenMR.py and xgenToolkit.mll

[Arnold] Do the right thing: use tx

Use tx textures. Don’t use png, jpg, tif, psd, or any other format. Convert them to tx.

Why not use those other formats?

  • Slow to load
  • Memory hungry if not tiled and mipmapped
  • Slow to render if textures exceed the texture cache size

Why use tx?

  • Fast to load
  • Efficient memory usage
  • Faster to render because they make better use of the texture cache
  • Optimizations such as the detection of constant colors and duplicate files



[Arnold] Minimum CPU requirements

Arnold reduced the minimum requirement to SSE4.1

The latest Arnold raises the minimum CPU requirements from SSE3 to SSE4.2:

  • CPUs need to support the SSE4.2 instruction set

If you want to check whether an older machine supports SSE, here’s a few suggestions:

  • Google your CPU and “SSE”
  • Windows: Download and run coreinfo -f
  • OSX: Run sysctl -a | grep machdep.cpu
  • Linux: Check /proc/cpuinfo

[MtoA] [Arnold] The case of the mesh light and the facing-ratio material

In this case, we have a torus as a mesh light.

The mesh light color is facing-ratio ramp, so that in the Beauty AOV, the polygons facing the incoming camera ray are red, and polygons facing away are green.


The plane below the light has a [slightly non-realistic] combination of diffuse, specular, and reflection (Kd=0.7, Ks=0.5, Kr=0.2).

The question here is: why do we see red in the reflection AOV, but green only in the diffuse and specular AOVs? Why does the facing-ratio ramp return red for reflection rays, but green for diffuse and glossy rays?

The answer is that there are no diffuse or glossy rays in this situation. A mesh light gets a meshLightMaterial shader, which MtoA assigns to the mesh light color (and to the torus shape) when MtoA translates the scene to Arnold.

The meshLightMaterial shader doesn’t handle diffuse, glossy, or shadow rays. The first few lines of the meshLightMaterial shader look like this:

 sg->out.RGBA = AI_RGBA_BLACK; 

Let’s take a look at what’s happening in the different AOVs.


The reflection rays hit the bottom of the torus, go through the facing-ratio ramp, and return red because most of the polygons are facing down towards the plane. In this case, we get the facing ratio of the polygon normals and the reflection ray.



We get the green from the light sampling, where there’s no rays.


Since there’s no rays, we get the dot product of the surface normal and  0 0 0, which is 0. And that returns green from the ramp:



The diffuse rays don’t make a contribution (because the meshLightMaterial doesn’t handle them) so we get green from the light sampling (just like for specular).


Indirect Specular

This would be black, since the meshLightMaterial doesn’t handle glossy rays, so the mesh light makes no contribution to the glossy reflections.