Just for kicks: Printing out shading trees


kick -tree prints the shading network for a shader node. For example, given this:

polymesh
{
 ...
 shader "Sources.Materials.DefaultLib.Material.standard.SItoA.41000.1" 
 ...
}

standard
{
 name Sources.Materials.DefaultLib.Material.standard.SItoA.41000.1
 
}

You can print out the shader tree for the standard shader like this:

set ASS_FILE=//Projects/Support/Arnold_Scenes/example.ass
set NODE=Sources.Materials.DefaultLib.Material.standard.SItoA.41000.1
set SHADER_PATH=%SITOA_BIN%
%KICK_PATH%\kick.exe -tree %NODE%  -i %ASS_FILE% -l %SHADER_PATH%

For a [simple] shading tree that looks like this:
SimpleTree
You would get this:

standard:Sources.Materials.DefaultLib.Material.standard.SItoA.41000.1
  |
  +-Kd_color = txt2d_image_explicit:Sources.Materials.DefaultLib.Material.Image.SItoA.41000.2
  |   |
  |   +-tex = sib_image_clip:Sources.Materials.DefaultLib.Material.noIcon_pic.SItoA.41000.3
  |
  +-opacity = txt2d_image_explicit:Sources.Materials.DefaultLib.Material.Image.SItoA.41000.2
      |
      +-tex = sib_image_clip:Sources.Materials.DefaultLib.Material.noIcon_pic.SItoA.41000.3

max depth:       2
total shaders:   5
cycles detected: 0

shader counts:
  2 txt2d_image_explicit
  2 sib_image_clip
  1 standard

one-to-many connections:
  2 txt2d_image_explicit:Sources.Materials.DefaultLib.Material.Image.SItoA.41000.2
  2 sib_image_clip:Sources.Materials.DefaultLib.Material.noIcon_pic.SItoA.41000.3

Notice that txt2d_image_explicit and sib_image_clip are counted twice, because those branches are plugged into two different ports on the standard shader.

[SItoA] Doing a license check in Softimage


Setting up the environment right is what often goes wrong. Running kick -licensecheck from inside Softimage is a quick way to check that you set up the environment variables correctly.

Here’s two lines of Python that will open a command prompt and run kick -licensecheck (on Windows).

#Python
from subprocess import Popen
Popen(["cmd", "/K", XSIUtils.BuildPath( Application.Plugins('Arnold Render').OriginPath, 'kick.exe' ), "-licensecheck"])

Here’s the same thing, but broken down a bit for legibility:

#Python
si = Application

p = si.Plugins('Arnold Render')
sKick = XSIUtils.BuildPath( p.OriginPath, 'kick.exe' )

from subprocess import Popen
Popen(["cmd", "/K", sKick, "-licensecheck"])

[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.

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"