// Expression:

LerpAnim( "ball", frame );

 

 

 

 

// MEL:

/*
Animate interpolated spheres by making some visible and
the rest invisible. In a "ball Matrix", each column is
considered to be one frame of animation. The chosen
column is passed as "$fcol". That column of balls will
be made visible and the rest made invisible. Normally,
"LerpAnim()" will be called by an expression:

"LerpAnim( "ball", frame );"

And the image will change with each frame. If there are
8 columns, then there will be a different image for
each of 8 frames.
*/

global proc LerpAnim( string $name, int $fcol ) {
string $attr;
int $icol, $i, $v;

for ($icol = 1; $icol <= 8; $icol++) {
if ($icol == $fcol) $v = 1;
else $v = 0;
for ($i = $icol; $i <= 48; $i += 8) {
$attr = $name + $i + ".visibility";
setAttr $attr $v;
}
}
}