Bridge of Birds

Animation 2016

Bridge of Birds is a team animation project which narratively deals with the death of a relative framed by dreams and Chinese mythology.

For this project, I served as the team's technical artist. On top of modeling and rigging, I was responsible for dealing with any programmatic element within Maya. My major contribution was the behavior of the eponymous bridge of birds, which was a pairing of the particle instancer and nParticle system with customized expressions.

The following code snippet is a script written in MEL that creates duplicates of an animated model for each frame within a editable range.

window -rtf true -title "Manifest Keyframes";

    intSliderGrp -label "Start Frame:" -field true startFrame;
    intSliderGrp -label "End Frame:" -field true endFrame;
    button -label "Run" -command "manifest()";


proc manifest ()
    string $nodes[] = `ls -sl`;
    string $model = $nodes[0];
    int $startFrame = `intSliderGrp -q -value "startFrame"`;
    int $endFrame = `intSliderGrp -q -value "endFrame"`;
    for ($i = $startFrame; $i <= $endFrame; ++$i)
        select -r $model ;
        currentTime -edit $i ;
        duplicate -n ($model + " " + $i);

The following was the expression used to control the birds' behavior.

$step = 0.5 ;
$prev = birdsParticleShape.prevVelocity ;
$vel = birdsParticleShape.velocity ;
$prev = <<$prev.x, 0, $prev.z>> ; //ensures the bird stays flat
$vel = <<$vel.x, 0, $vel.z>> ; 
$prev = $prev / mag($prev) ; // normalize the vector to length 1
$vel = $vel / mag($vel) ;
$vel = (1 - $step) * $vel + $step * $prev ; //interpolate

$dampen = 1 ;//set this to whatever scales best with the velocity
//adjusts animation speed based on velocity
birdsParticleShape.myAge = birdsParticleShape.age0 + 
                           mag(birdsParticleShape.velocity) * $dampen ; 

//a custom attribute to hold the bridge in place
if (!birdsParticleShape.isSimulating) 
birdsParticleShape.velocity = <<0,0,-0.001>>;
$vel = birdsParticleShape.velocity;
birdsParticleShape.horVelocity = $vel; //turn each bird