kicking ass with debug shading


You can use kick to render with debug shading. Here’s the flags to use:

  • -is to ignore the shaders assigned to the shapes
    When you ignore shaders, a default utility shader is used to render the scene.
  • -sm sets the shade mode ( ndoteye lambert flat ambocc plastic metal)
  • -cm sets the color mode (color ng ns n bary uv u v dpdu dpdv p prims uniformid wire polywire obj edgelength floatgrid reflectline bad_uvs nlights id bumpdiff pixelerror)

Here’s some examples that show how to kick with different types of debug shading (I’ve used the Arnold Render View debug shading modes for these examples)

 

Debug shading kick flags
Basic: disable all shaders in the scene, switching to a gray ‘ndoteye’ shader; a very fast shading mode.
kick -is

or

kick -is -sm notdoteye
Lighting: renders the scene with a white lambert shader
kick -is -sm lambert
Occlusion: use ambient occlusion shading
kick -is -sm ambocc
Wireframe: displays geometry as a wireframe
 kick -is -cm polywire

or

kick -is -sm ndoteye -cm polywire
Normal: visualizes the normal vector (between 0 and 1, in tangent space)
 kick -is -sm flat -cm n
UV: displays the coordinates of the primary UV set (red=U, green=V)
 kick -is -sm flat -cm uv
Primitive ID: displays random colors based on the per-primitive (triangle, curve) index
 kick -is -sm flat -cm prims
Barycentric: displays intra-primitive parametric coordinates (barycentric for triangles, parametric length, and width for curve segments)
 kick -is -sm flat -cm bary
Object: displays random colors based on the per-object ID
kick -is -sm flat -cm obj

kicking a cputime heat map


cputime-heatmap.png

New in Arnold 5.0.2! You can press T to get a cputime heat map. From the Arnold release notes:

  • Added cputime heatmap view to kick: When using kick you can now toggle between viewing kicks default output and a cputime heatmap with the T key. The mapping of the heat map can be scaled with the [ and ] keys.

To get the cputime heat map, you have to run kick interactive (eg with the -ipr flag):

kick -ipr example.ass

WARNING | unable to load dynamic library .\ai_renderview.dll: The specified module could not be found.


kick checks the current working directory for plugins (shaders and procedurals). That means kick tries to load all .dll/.so/.dylib files in the current directory.

So if you do this:

cd C:\solidangle\mtoadeploy\2017\bin
kick -nodes

Then you’ll get a warning like this (plus a pop-up System Error dialog that says “Qt5Core.dll is missing from your computer”).

loading plugins from .
WARNING | unable to load dynamic library .\ai_renderview.dll: The specified module could not be found.

On OSX, the warning would  say ./libai_renderview.so, and on Linux, ./libai.so

Notice the “loading plugins from .” The single period, or dot, represents the current directory.

The solution? Don’t run kick in the MtoA bin folder. Don’t run kick in an any folder where there are non-plugin libraries.

 

WARNING mtoa_shading_groups: unresolved reference


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:

  • Set the ARNOLD_PLUGIN_PATH environment variable. For example:
    export ARNOLD_PLUGIN_PATH=/home/render/solidangle/mtoa/2016/shaders
    set ARNOLD_PLUGIN_PATH=C:\solidangle\mtoadeploy\2016\shaders
  • Use the kick -l flag to specify the MtoA shader location.
  • In Maya, set the Shader Search Path in the Arnold Render Settings, then export the ASS file.

[Arnold] [kick] Changing output paths for AOVs


The -o flag changes the output path for the beauty AOV only. For other AOVs, kick still uses the output paths specified in the ASS file (the AOV output paths are specified by the filename parameter of the driver nodes in an ASS file).

driver_exr
{
 name defaultArnoldDriver@driver_exr.RGBA.direct_diffuse
 filename "C:/Users/StephenBlair/Documents/maya/projects/Support/images/direct_diffuse/Natural_Museum.exr"
 compression "zip"
 half_precision off
 tiled off
 preserve_layer_name off
 autocrop off
 append off
}

It is possible, however, to use kick -set to change the output path and file name of specific AOVs, but you’d have to know the AOV names in advance. For example:

kick -set defaultArnoldDriver@driver_exr.RGBA.direct_diffuse.filename "C:/temp/direct_diffuse.exr" -i example.ass

[kick] [ass] reading from stdin


Some customers have reported a problem using a render manager (Muster, Tractor, Deadline) to render jobs with kick, typically via a wrapper script. The problem is that kick tries to read from STDIN instead of loading the specified ASS file. In the log, you’d see this:

00:00:00     0MB         | [ass] reading from stdin ...

A workaround is to add the -nstdin flag (Ignore input from stdin) to the kick command line.

[Arnold] [MtoA] Disabling Skip License Check


watermark
If you render a scene that has Skip License Check enabled, you’ll get the Arnold watermark. One way to make sure this doesn’t happen is to turn off Skip License Check from the command line:

render -r arnold -ai:slc off some_scene.mb
kick -set options.skip_license_check off -dp -dw some.ass

You might also want to enable Abort on License Fail (-ai:alf for render, -set options.abort_on_license_fail for kick).

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.