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

Day 2 at FMX: The allure of Arnold


fxguide quick takes

It was only in a small-ish room but the hustle and bustle outside the Solid Angle Arnold workshop showed just how much buzz this renderer has. In the session, Solid Angle founder Marcos Fajardo detailed the growth of his company (now more than 20 people) and promised a new website (traditionally a rendering formula) and that they would be ‘more open’.

More at fxguide

[MtoA] The case of the renderer that failed to register


In this case, a customer running Maya 2013 on Ubuntu reported this error when he tried to load the mtoa plugin:

API error detected in plugins/mtoa/Main.cpp at line 710: (kFailure): Unexpected Internal Failure 
ERROR | Failed to register renderer 'arnold' 

That specific line in plugins/mtoa/Main.cpp runs these two lines of Python:

import mtoa.cmds.registerArnoldRenderer
mtoa.cmds.registerArnoldRenderer.registerArnoldRenderer()

So I asked the customer to run that Python in the Maya script editor, and that gave us this error:

# Error: ImportError: file 
/usr/autodesk/maya2013-x64/lib/python26.zip/hashlib.py line 63: No module 
named _md5 # 

Now we’re cooking with EVIL gas! I’ve seen these kinds of errors before…

This appears to be general problem with Maya 2013 and pymel (I found a few different posts about this via Google search). For example, this thread from the pymel project, or the Troubleshooting section on this page.

In brief: you need to create some symlinks to the right versions of the libssl.

[SItoA] Unlimited batch rendering with xsibatch -processing


Hat tip: Andy Jones on the Softimage mailing list

You can use xsibatch -processing to render scenes with Arnold. With -processing, xsibatch uses a Processing token instead of a Batch license, so you’re not limited by the number of Batch licenses you happen to have. Back in the days before third-party renderers, -processing for was for non-rendering tasks. Now it’s for non-mental ray tasks!

I was sure I tested this long ago, but obviously I must have made a mistake on my command line.


 xsibatch -processing -render //server/project/Scenes/example.scn

=======================================================
 Autodesk Softimage 11.1.57.0
=======================================================

License information: using [Processing]
# INFO : [sitoa] SItoA 2.7.1 win loaded.
# INFO : [sitoa] Arnold 4.0.12.1 detected.
 

Here’s actual proof in the form of a screenshot 🙂

xsibatch_processing_render

Another case of a missing entry point


entry_point_not_found
In this case, a user installed the latest MtoA, but when he went to load mtoa.mll in the Plug-in Manager, he got this error:

---------------------------
Settings/Preferences: maya.exe - Entry Point Not Found
---------------------------
The procedure entry point ?IsRenderablePath@CArnoldSession@@SA_NVMDagPath@@@Z could not be located in the dynamic link library mtoa_api.dll. 

From past experience, I knew that the problem was probably the Maya.env file. And sure enough, it looked something like this:

MAYA_RENDER_DESC_PATH = C:\solidangle\mtoadeploy\2013.0.22.0
PATH = %PATH%;C:\solidangle\mtoadeploy\2013.0.22.0\bin;
solidangle_LICENSE=5053@SOLIDANGLE-PC

MAYA_RENDER_DESC_PATH = C:\solidangle\mtoadeploy\2013.0.22.1
PATH = %PATH%;C:\solidangle\mtoadeploy\2013.0.22.1\bin;

Notice that there are two MAYA_RENDER_DESC_PATH and PATH settings. Maya reads just the top two, which are for an older version of mtoa, so when Maya loads mtoa.mll we end up with a “missing entry point” error.

How did this happen? Well, in this case, in-between installs and uninstalls of different versions MtoA, the user had updated Maya.env with his own MAYA_RENDER_DESC_PATH and PATH settings for MtoA. And then the next install of MtoA appended its own settings to the Maya.env file.

The MtoA Installer works like this:

  • Installs make a backup of the existing Maya.env, and then append the environment settings to the existing Maya.env.
  • Uninstalls restore the backup version of Maya.env.

So if your Maya.env already has MtoA settings for MAYA_RENDER_DESC_PATH and PATH settings, then when you install another MtoA, you end up with a problem (because the new settings will be at the bottom, where they are ignored).

Ok, so that’s problem solved. Just remove those extra entries from Maya.env.

[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

[SItoA] Adjusting camera exposure


Arnold added support for per-camera exposure awhile ago:

Camera exposure control: All cameras, even custom cameras, have an exposure parameter that scales the pixel samples by 2 ** exposure . Increasing the exposure by 1.0, or one stop, produces an image twice as bright, while reducing the exposure by one stop produces an image half as bright. The default value is 0 for backwards compatibility. You can also control this in in kick with the new -e option.

In Softimage, you can access the exposure parameter though the User Options.

user-options-camera-exposure

[MtoA] Creating color masks with a custom AOV and the Utility shader


In this video, I show how to a color mask AOV using a custom AOV and the Utility shader. Topics covered include:
– Creating a custom AOV
– Setting the default shader for a custom AOV
– Setting up the Utility shader to output a color for each shape
– Understanding the difference between the Color and Color ID color modes

Changing ASS files with the Arnold Python API


If you want to change something in existing ASS files, don’t write an ad-hoc script or your own parser for the ASS file. Use the Arnold API. The Arnold API includes a set of Python bindings, so you can fairly quickly whip up a script to do whatever it is you need to do 🙂

For example, we recently discovered (and fixed) an issue where exported ASS files were missing procedural nodes. SItoA exports hair data in chunks (one chunk for every 200K hairs), but the exported ASS had just one procedural for the first chunk (chunk 0), but there should be one procedural for each chunk.

Here’s what the procedural for chunk 0 on frame 5 looks like. The missing procedurals would be for bin files like Hair.chunk.1.5.bin, Hair.chunk.2.5.bin, and so on.

procedural
{
 name Hair.SItoA.5000
 dso "sitoa_curves_proc.dll"
 data "//Projects/Support/Arnold_Scenes/Hair.chunk.0.5.bin"
 load_at_init on
}

So, for my first dive into the Arnold API, I put together a basic little script to add the missing procedurals. To do this, I had to learn how to:

  • Read and write ASS files
  • Iterate over nodes and find a specific type of node
  • Get parameter values from a node
  • Create new nodes
from arnold import *
import glob


ass_file = "Hair_Archive.ass"

AiBegin()
AiMsgSetConsoleFlags(AI_LOG_ALL)
AiASSLoad(ass_file, AI_NODE_ALL)

# Iterate over all shape nodes, which includes procedural nodes
iter = AiUniverseGetNodeIterator(AI_NODE_SHAPE);
while not AiNodeIteratorFinished(iter):
	node = AiNodeIteratorGetNext(iter)
	#print AiNodeGetName( node )

	# Is the node a procedural?	
	if AiNodeIs( node, "procedural" ):
	
		data = AiNodeGetStr( node, "data" )
		name = AiNodeGetStr( node, "name" )
	
		# Find all other chunk.<chunk-number>.<frame>.bin files
		chunks = glob.glob( data.replace( 'chunk.0', 'chunk.*' ) )

		# Add procedural nodes for chunks 1,2,3...
		for i in range(1,len(chunks)):
			n = AiNode("procedural");
			AiNodeSetStr(n, "name", "%s.%s" % (name, i) )
			AiNodeSetStr(n, "dso", "sitoa_curves_proc.dll")
			AiNodeSetStr(n, "data", data.replace( 'chunk.0', 'chunk.%s' % i ) )
			AiNodeSetBool(n, "load_at_init", True)

AiNodeIteratorDestroy(iter)


AiASSWrite(ass_file, AI_NODE_ALL, False)
AiEnd()