[MtoA] Doing a license check in Maya


If you’re doing technical support like me, you gotta love things like kick -licensecheck. I wish we’d had something like this at Softimage. This license check will tell you:

  • Whether you can connect to a license server
  • What licenses are available
  • What are the licensing environment variable settings

licensecheck

In this example, I’m running Maya and the license server on the same computer. That’s why none of the environment variables are set, but the licensecheck still shows that there’s a license available. By default, Arnold will connect to 5053@localhost to get a license.

Exporting ASS files from Softimage with xsibatch


You cannot use xsibatch -export to export ASS files (because of the way sitoa implements ASS exporting). But it’s not too hard to do the same thing with SITOA_ExportScene and xsibatch -script.

This is what the xsibatch command line would look like (on Windows). For readability, I used the EXPORT_SCRIPT and SCENE variables to reduce the length of the xsibatch command line.

set EXPORT_SCRIPT = batch_export_scene.pys
set SCENE = \\server\project\scenes\elephant_herd.scn
xsibatch -processing -script %EXPORT_SCRIPT% -args -start 5 -end 20 -step 1 -scene %SCENE%

And here’s the batch export script.

I expose the basic parameters only, and I use the ASS Archive output path from the Arnold Render options, the scene name, and the [Frame] token to compose the output file name.

def main( start, end, step, scene ):
	Application.OpenScene(scene, "", "")
	x = Application.Dictionary.GetObject( "Passes.Arnold_Render_Options" )
	dir = XSIUtils.ResolveTokenString( x.output_file_tagdir_ass.Value, 0, False, None, None )

	scn = Application.ActiveProject.ActiveScene.Parameters("Name").Value	
	output = XSIUtils.BuildPath( dir, '%s.[Frame].ass' % scn )

	Application.SITOA_ExportScene( start, end, step, False, False, output )

Just for kicks: listing the available shaders


Want to know what shaders come with SItoA?

Use kick -nodes with the -l flag to get a list of all nodes. For example:

kick -nodes -l %SITOA_BINDIR%\sitoa_shaders.dll | find "shader"

where SITOA_BINDIR is just shorthand for the Application\bin\nt-x86-64 folder of your SItoA addon install. On my machine, that’s here:

C:\Users\SOLIDANGLE\Documents\Workgroups\sitoa-2.6.0-2013\Addons\SItoA\Application\bin\nt-x86-64

The output will list the builtin Arnold shaders first (such as ambient_occlusion, standard, and wireframe), and then the SItoA shaders (which start with the two BA_ shaders).

In general, you wouldn’t include a filename in the -l path. I included sitoa_shaders.dll so kick wouldn’t try to load sitoa_curves_proc.dll and then pop up a “sicppsdk.dll is missing” error because I’m not running kick in a Softimage command prompt (where all the Softimage environment variables are set for me).

So, a more general example would look like this:

kick -nodes t -l %SITOA_BINDIR%

-nodes t will sort the list of nodes by type.

Missing shaders in images rendered with kick


pink_elephant

I was tempted to title this post something like “why is my ass pink when I kick it???” 🙂

The color magenta (often reported as “pink” or even “purple” sometimes) is the color of missing shaders. If Arnold cannot find a shader, it returns the color magenta (RGB = 1, 0, 1). This is a pretty common result when people export an ASS file from Maya for the very first time. Unlike SItoA, which helpfully fills in the Shader Search Path for you, MtoA leaves the search paths empty (unless you fill them in yourself).

There’s several ways you can tell kick where to find the shaders:

  • Use the kick -l flag to specify the location of the shaders. For example:
    kick -l C:\solidangle\mtoadeploy\2013\shaders
  • Set the ARNOLD_PLUGIN_PATH environment variable to the location of the shaders.
  • In Maya, enter the shader search path in the Render Settings before you export the ass file.

I thought you might also be able to use -set options.shader_searchpath on the kick command line, but that didn’t work for me.

kick -i "elephant.ass" -set options.shader_searchpath "C:\solidangle\mtoadeploy\2013\shaders"

Per-object AA settings?


In the comments, a reader asks:

I am trying to override AA_samples per geometry and cant figure out where to add the attribute. I tried adding a user option to a set with AA_samples 6 and numerous other things but to no avail. Any ideas??

That’s not the way Arnold rolls 🙂

Arnold currently uses a global, non-progressive AA scheme, and the official Arnold shaders (such as the Standard shader) don’t support per-shader or per-object sample settings. One of the goals of the Arnold renderer is to reduce the amount of controls, and per-object or per-shader sampling doesn’t really fit into that vision.

A possible workaround would be to write a custom shader that reads user data attributes from objects and overrides the sampling settings.

PS If you want to know what user options are available, try using kick -info. For example, kick -info polymesh will give you the available parameters for a polymesh node. And kick -nodes will give you a list of nodes.