Animating fluids by hand

Imagine milk being poured into a glass.  Think about all the physics going on in that situation.  I have seen impressive dynamic fluid engines do a great job of this.  Even with all the tools to do the job, animators tend to steer clear of fluids.  When was the last time you saw a character interact with liquid in an animated movie?  Sure, it’s been done before, but not very often.  I am going to animate a glass being filled with liquid.  I’m going to do this by hand.

When attempting a complicated animation, you need to break the animation into smaller parts.  For example, when you fill a glass with water, all of the water is moving.  Because it’s a uniformly coloured liquid, we can’t see what the fluid is doing.  All we can see is the surface of the liquid deforming from all the various forces.  Therefore, all I have to animate is the surface of the water.  I’m aiming for something like this:

Here is my cup.  The milk was made from the inside wall of the cup, so it fits perfectly.  I put it on a nice background, attempting to make it cooler than it really is.

The first thing the milk needs to do, is fill up.  I need the surface of the milk to rise.  This is a very simple task.  I have converted the liquid to an actor, which allows me to create various “poses” of the object.  The first pose is the one you see in the image above.  For the second pose I have squished the object into a flat mesh at the bottom of the glass.  It is possible to animate between these two poses, with Art of Illusion filling in all the frames in between the two poses.  I can do this by adjusting the “weight” of the empty pose.

The next step is to make the surface of the liquid tilt, as if the glass was tilted to the side.  This will be my third pose.

This brings up another very important feature of AOI’s animation tools.  In the empty glass example, we noticed that AOI would interpolate between poses.  A weight of 0 means the pose isn’t being applied at all.  A weight of 1 means the pose is applied completely.  However, in this example, we see the weight fluctuating from -2 to +2.  AOI is, in fact, interpolating BEYOND the poses.  It recognizes the displacement of each point and is able to multiply that displacement by any amount.  With this in mind, I could put a negative weight on the empty pose and have the liquid rise out of the glass.  I wouldn’t want to do that, but it’s a cool feature.  If I rotate the liquid and use this tilt pose, I can make the liquid tilt in any direction.

The next thing to do is add surface displacement.  We don’t want the liquid to have a perfectly smooth surface.  I had to think ahead when I was making the liquid’s mesh.

As you can see, I’ve added lots of geometry to the top surface.  By randomly moving the surface points vertically, I can create a smooth displacement.

The result is beautiful.  Now we can use our three new poses all at once.

If we create multiple random displacement poses, we can fade between them to create a smooth animated surface.

So far so good.  Now we just need to bring everything together.  We have successfully broken down the animation into it’s three main parts.  It doesn’t seem so complicated now, does it?  The final animation will require me to select the order and timing of each pose.  It all comes down to my understanding of the goal and my familiarity with the software.

There is one more thing.  The stream of liquid that will enter the glass to fill it up.  The stream will travel through the air on a parabolic path.  The moment the stream hits the bottom of the glass, there will need to be lots of displacement.  At that moment, the glass will start to fill.  My empty pose will gradually move from 1 to 0.  The tilt pose can be used to create that wobble we saw in the Youtube video at the top of the page.  When the glass is full, the stream will stop, and the displacement and tilt poses will taper off slowly.

It’s has been a few days since I wrote the last paragraph.  Looking at this with fresh eyes has made me realize there is one more pose I need to make.  When the liquid first makes contact with the bottom of the glass, it splashes up around the edges.  I need the edges of the liquid to be higher than the middle.  This is a simple task.

I only needed to use about 20 key frames for the liquid.  Of course, using an actual fluid simulator would be the ideal way to do this.  However, it can be done by hand if necessary.  I wasn’t sure what to expect from my efforts, but the result is pretty good.  I  wouldn’t use it in a serious project, but it’s good enough for this post.  I’m really just proving a point.  The limits of Art of Illusion are few and far between.

There are a few problems with this.  The liquid settles a little too fast at the end.  The stream pouring into the glass didn’t come out right.  Nevertheless, the outcome is impressive.  Physics simulations have a tendency to be unstable.  I’ve crashed Maya more than a few times with particles.

AOI File:

Leave a Reply

Your email address will not be published. Required fields are marked *