[Arnold] Standins and the ASS file cache


Did you ever notice the ASS file cache stats in the Arnold log? It’s a breakdown of how many unique ASS files were loaded, and how many were reused:

03:11:33 8868MB | -----------------------------------------------------------------------------------------
03:11:33 8868MB | .ass file cache:
03:11:33 8868MB | unique (loaded from disk)     10 ( 1.00%)
03:11:33 8868MB | reused (found in cache)      990 ( 99.00%)
03:11:33 8868MB | total referenced .ass files 1000 (100.00%)
03:11:33 8868MB | -----------------------------------------------------------------------------------------

Roughly speaking, this caching of standins means that if you have 100 standins that all load the same ASS file, you’ll get one set of geometry and 99 instances of that geometry. That saves memory and I/O time and is just more efficient.

More here…

[Arnold] Loading plugins when you edit ASS files


If you’re using the Arnold API to update ASS files (for example, to change paths), you need to load all the plugins (aka shaders) that are referenced by the ASS file. Otherwise, the unknown nodes are skipped on load, and therefore won’t be in any ASS file you write.

For example, if you set ARNOLD_PLUGIN_PATH to point to the locations of the MtoA shaders and any custom shaders you use, then you could do something like this:

from arnold import *
import os

AiBegin()
AiMsgSetConsoleFlags(AI_LOG_ALL)
AiLoadPlugins( os.getenv( 'ARNOLD_PLUGIN_PATH' ) )
AiASSLoad("original.1001.ass", AI_NODE_ALL)

#
# Do your edits here
#

AiASSWrite("edited.1001.ass", AI_NODE_ALL, False)
AiEnd()

[kick] Combining ASS files on the command line


One way to avoid exporting the same static geometry for every frame is to export it just once, and then export the rest of the scene (the cameras, lights, and any animated objects) as a regular sequence. kick can combine multiple ASS files and then render the result. For example:

kick environment.ass lights.ass character.0001.ass camera.0001.ass -o scene.0001.exr
  • environment.ass is all the static geometry and the applied shaders.
  • camera.####.ass is the camera, driver, filter, and options.
  • character.####.ass is an animated character with its shaders.

Texture search paths


With Arnold there are two things in an ASS file that specify the location of a texture file:

  • The texture filename, which can be an absolute or relative path.
  • The texture_searchpath in the render options. The texture_searchpath is used only if the texture filename is a relative path (for example: “sourceimages/example.tiff”.
  • For example, if the texture filename was a relative path, you might have something like this in an ASS file:

    options
    {
     ...
     texture_searchpath "//server/projects/test"
     ...
    }
    
    MayaFile
    {
     ...
     filename "sourceimages/noicon.png"
     ...
    }
    

    [MtoA] Using standins to load animation sequences


    To load an animated sequence into a standin:

    • In the Attribute editor for the StandInShape, under File/Frame, your Path should be something like example.####.ass (you must use four # symbols for the frame number pattern)
    • Enable Use Frame Extension
    • In the Frame box, type “= frame” without the quotation marks, and press ENTER. That creates an expression that uses the current frame number to specify which ASS file to load.

    [SItoA] Expressions for standins of animated sequences


    A standin can load an animation sequence, such as circling_cubes.[1..25].ass.
    For example, if you open an Arnold_Standin property, click Browse, and select a sequence, Softimage automatically inserts a [Frame] token into the file name:

    standin-path

    By default, that [Frame] token resolved to the current frame, but you can override that and use an expression to drive the sequence.

    For example, if you have a 25-frame sequence of ASS files, you may want to play the 25 frames and then stop. To do that, you could use this expression:

     
    MIN(Fc,25)
     
    

    If you wanted to continuously loop the 25 frame sequence, you could use an fmod (modulo) expression like this:

     
    cond( fmod( Fc, 25 ) == 0, 25, fmod(Fc,25) )
     
    

    And if you wanted to show just frames 10 to 25, you could use this expression:

     
    cond( Fc<10 , 10 , MIN(Fc,25) )
     
    

    If you’re not sure about these expressions, try playing with them in the Expression Editor. As you move through the timeline, watch the Current Value update in the Expression Editor.
    fmod_expression