Friday, December 15, 2006

AN ARTICLE CONCERNING CARTOONY CLOTH

Sometimes cloth simulation is not the best solution, especially when it comes to minimally designed characters, and ‘poppy’ animation, which entails variation between slow and fast movements (i.e. your character covers a large distance in a short duration of time). The following article shows my own struggles to create a consistent, smooth look to a simple dress, which turned out to be not-so-simple.


SYFLEX

My character, Lucy, looks basically like this:



I had no prior experience with cloth simulation, but I learned a lot about SyFlex, and I thought, “How hard can it be? It’s just a simple dress, I’ll just create a piece of cloth and simulate it. It would probably work with default settings, right?”

Wrong!

After a few tries with SyFlex, it was clear this was not the look I was going for. Once you introduce collisions, you create a lot of problems for yourself, especially if your character has skinny arms and legs, and you want to cover them – partially or fully – with a much larger piece of cloth. Once I saw the first results, I was completely disillusioned. As soon as my character made her first full ‘take’, the legs completely penetrated the dress and went through the other side of it, locking it into the leg geometry.

And there was no way around it too. Any setting created different problems: If the dress was too rigid, it couldn’t bend enough to compensate for the acute angle between the legs and the body. If it was too flexible, it flopped around too much, and extreme movement completely ‘broke’ the geometry. If the collision envelope for the legs was too small, the dress, again under extreme situations, would penetrate the legs and lock itself in the geometry. And if the envelope was too large, the dress would collide too early and wouldn’t even cover the girl’s panties. A 4 year old with a distorted, ripped looking mini skirt is simply wrong… Moreover, you can’t have a character as simple as this, with a dress that looks like this:




Instead on focusing on the girl’s facial expressions and body language, the eye is immediately drawn to the one spot that looks different. And in this case, the wrinkles not only create a very detailed and disorganized pattern, it also came to the point where the dress didn’t even look like a dress anymore. It looked more like, I don’t even know, like a screwed up accordion or something. And all I wanted was this:




MAYA HAIR CURVES

What I like about maya’s built in hair system, is a little attribute called ‘start curve attract’, which basically gives the dynamic curve the ‘desire’ to return to its default position. It’s great, cause, unlike Syflex, no matter how extreme your character gets, once it’s back into a relatively normal pose, the dress would get back to its modeled form, but would still have nice overlapping action, which was really important to me. I mean, what’s a cartoon without overlapping action? Can you imagine all the hair and the squishy materials in my scene squashing, stretching and overlapping, but the dress stays completely rigid? The lack of movement would – like in the case of the wrinkles - draw the eye right to it, where in fact this puny little dress is the most insignificant object in the entire scene!

So I decided to bid SyFlex farewell, and completely re-rig my dress, orienting it towards maya’s dynamics (hair curves). I decided to treat the dress as two separate parts: the top, which would be rigged to deform exactly like the top of her body, and the bottom, which would have all the dynamics. The top was easy as expected, and I even got extra lazy, and instead of binding it to the spine (and spend extra time on weighting), I created a few rivets on the body, parented some joints to them, and bound the top of the dress to those. Rivet.mel can be easily found online – it makes you pick 2 edges, and creates a locator between them that is essentially bound to the geometry, no matter how it deforms – exactly like hair follicles. Come to think of it, I’m not even sure if I used rivets or follicles, because they do the same thing.

On any case, I knew the bottom is the real challenge. I spend at least half a session to create the following setup:


I created joint chains all around the dress – every vertex has a joint that’s snapped to it. I made each of the chains spline IK – with autocreate curve turned on – and then deleted the IK’s, so that all that was left were the curves. Next I parented these base curves, as well as the main chain joints to one of the spine joints. Following which, I made these curves dynamic, and anchored the follicles only at the ‘base’ (instead of the default ‘both ends’, because I wanted the bottom to flop around). Next, again, I made each of the chains spine IK, but this time I turned ‘auto create curve’ off, and picked the corresponding dynamic curve for each of the chains. Finally, I bound the bottom of the dress to the joint chains. For accuracy’s sake, I must note I did not bind the geometry to the top and then the bottom (I think it’s impossible right?), but once the whole rig was completed, I picked all the joints I needed (including the top riveted joints, and the bottom joint chains) and bound everything together.

As for the hairSystem, as you’ll see next, the settings I put in it are not relevant at this point, cause the whole thing didn’t work. I remember I was going for a very high rigidness setting, and, of course, my beloved ‘start curve attract’ cranked up to around 0.3. Now as for the legs going through the dress, I knew I needed collisions, so I made one collision sphere to each of the legs (faster computation than actually making the geo collide), and one for the body. I was so eager to test it I skipped lunch, and immediately loaded up my scene, biting my fingernails with anticipation as it simulated.

It soon became clear that I failed horribly. Granted, there were no more wrinkles, and the dress actually moved exactly like I wanted it to, but as for the collisions, how should I put it, they were nonexistent.

The problem was, that because the dynamic curves went down the dress, but were not connected horizontally, they would just slide-off the colliding sphere on either side. Moreover, if Lucy had to split her legs (running, bending, whatever), there were a few situations where the legs appeared as if they were coming out of her belly, and the dress is tagging along between them. Not cool.

Oh well, back to the drawing board. What should I do to make the dress collide with the legs, under any circumstances?



THE NIGHTMARE BEGINS

My frustration started to build up during the next few days of work, as my futile attempts to make the collisions work became increasingly frustrating. Firstly, I tried to go around the problem – if the vertical chains slide off the collider-spheres, horizontal chains seemed the obvious solution. Trust me, don’t ever, ever, try to use layered horizontal loops to simulate cloth. You can only begin to imagine the mess it created during simulations. Loops breaking apart, jumping frantically, and even shooting up to infinity at some point, as if maya was telling me, ‘come on man. I mean -- come on…”

Horizontal loops not only didn’t solve the collisions issue, it made the simulation worse. I reverted back to an older save, and took another look at the vertical setup. I wished I could have had the same simulation quality from this kind of setup, but somehow connect the chains horizontally too. So, in the next attempt, I tried to combine both ideas: the vertical chains are not skinned to the dress, but instead, they are skinned to the horizontal curves, which are also dynamic. Can you imagine the mess? 2 hair systems, 20 follicles and a gazillion joints made up for a true rigging jungle, filled with wild animals and buzzing insects, all created to make a tiny piece of cloth wrap around a stick figure.

Needless to say, that totally didn’t work either. If it’s too complicated, it’s probably not the best solution. I can’t even begin to describe the horrendous, albeit quite fascinating, results of this Frankenstein experiment. No, the solution has to be simpler.

The following night, as I lay awake in my bed, beating myself up for getting into this hopeless situation, it finally hit me: “Not verticals, not horizontals -- ….DIAGONALS! It’s genius,” I thought, and fell asleep soundly. The next day I leaped out of my bed with a victory roar, and immediately began the vigorous rigging session, which entailed re-creating all the joints and dynamics in a counter-clock-wise looping diagonals configuration. A few hours later I was done. Wiping the sweat off my forehead, I sat back to observe this thing of beauty. Thoughts started running through me head, “This is ingenious! You should patent this, you’ll make millions marketing this thing! You’ll start an empire, just like Bill Gates!”

Needless to say, this setup was also an utter failure.

Just as I was about to give up completely and make my girl wear little pants, I realized what was the basic mistake that I kept making. It’s the collisions. It’s impossible to simulate collisions on cartoony characters without spending weeks and weeks on tweaking each and every frame. Period. If I could find a solution that goes around the whole collision thing, but still keeps the legs from penetrating, not only will it work, the computation would be a lot faster.


LIGHT AT THE END OF THE TUNNEL

The main problem was getting the general shape of the dress to fit the body and the legs, even in cases where Lucy bends to the extreme. If I simply parented the joint chains to the spine, when she bends it looked something like this:




What I did was, I created a little controller between her legs. The controller is parented to BOTH legs (0.5 weight on each), so it’s always exactly in the middle, no matter how far apart they are from each other. Inside this controller, parented to it, there’s a little joint. Then I’ve built a curve coming out of this joint, and going to one of the middle spine joints. I smooth bound this curve (with about, oh, 5 or 6 curve points) to the little joint between the legs and the spine joint, and messed around with the weighting, so it always looks like a nice smooth curve, no matter how much she bends. I’ve built a chain joint of about 3 or 4, and made it spline IK with the curve. This chain of joints was skinned to all the follicles I already had (remember?). And voilla.


What this does is no matter where the legs are in relation to the body, the dress would always ‘try’ to be somewhere in the middle. The simulation is very rigid, and it works on top of that. i.e. first the base curves get their shape, and then the dynamic curves are simulated. Testing it showed that although it doesn’t work perfectly, it does exactly what I want it to do, and it’s definitely something to work with.

By the way, and this is not so by the way at all, the controller between the legs can be animated, to offset the position of the bottom of the dress. Very useful. Although you need to go in and animate it, it takes about two hours for a 1400 frame shot, which is way faster than any kind of simulation.



FINALIZING THE RIG

After I did my best to make the dress look good in my scene, I noticed it needs just a few more things. First of all, remember the little curve coming from the controller to the spine? Remember the spline IK built on top of it? It wasn’t twisting with the body. I had to connect the controller rotate Y attribute to the IK’s twist attribute, which means I had to animate the twist as well. I’m sure I could have automated this, but at this point, I don’t think it’s necessary anymore.

Secondly, I needed another layer of control just for those specific frames that are extra problematic, or for movements where the dress is the main focus (when she spins around for example, and I want it to flap around her body with nice waves), I needed the ability to ‘sculpt’ the dress, and I needed those ‘sculpting controls’ to be animatable, and resetable. I duplicated the dress’s Geo and freeze transformed it. I built a proxy model around it with very few points, and wrap-deformed it around the first model. I created a joint for every vertex of the proxy, each parented to a controller. Finally I made this ‘custom dress’ a blendshape for the original dress, BUT, the deformation order is critical: I want the dress first to be distorted, and only then bound to the dynamic system, which means the blendshape has to come before the skin. So in deformation-order I put ‘top of chain’.



That’s it. This second layer of control was a lot of work to animate, but it gave me that special ‘umph’ for specific segments of animation, and it finally drove a final blow to the penetrations, eliminating them completely.



FINAL WORD

I hope this has been a little helpful to all you animators/riggers out there, and that you’ll learn from my mistakes – keep it simple, keep it clean, and try to avoid collisions.

Friday, December 01, 2006

Crunch time, part 1

This is the first really stressful period, because I have to present my progress to my entire department in 5 days. So what's going on? I'd say the film's going quite well actually. all in all.

The first dream sequence is 95% done. Still have to figure out the camera movement, and add another layer of animation to homie, cause he looks kinda stiff now. Cloth and hair work fine for both characters. By the way, I decided to ditch cloth simulation altogether. If it was just simulating time, I'd still to keep it, but to have it not look good on top of that was too much. Realistic cloth DOES NOT LOOK GOOD ON SIMPLIFIED CHARACTERS AND CARTOONY ANIMATION. PERIOD. It has wrinkles, which take away attention off the characters' faces, and makes the audience wonder, 'what the heck is that wrapped around his body?". The aesthetics are slick and slimple, so slick and simple cloth is required. So I took a week to rig all the characters' clothes. And it looks great. Rob wants me to write a paper on how I created the rig for lucy dress, so I'll post it here in a week, including illustrations and all.

Right now I'm working on the second dream sequence, which proves to be an even bigger scene than the first, because it has both characters moving and acting, not just Lucy. I'm currently about 50% into stepping the entire scene, but splining it is going to take longer than before, becasue I feel I really improved, and I know how to put more into it. In the next 4 days I'm going to max out - work 3 hours, rest one, again 3 hours, again break, until I can't take it and go to sleep. For 4 days. I want to finish stepping out this entire scene, rerecord the dialogue, touch up the first dream sequence, and put it all together in the animatic for the presentation...

Ok.. time for work!!

Wednesday, November 01, 2006

Update

wow, still working on the same scene. It's really almost there though. I have to say, I don't like the way it looks splined. I mean, the arcs work and all, but there's something missing, and I think I know what it is.

In CalArts, they define the craft of animation in 3 scales when it comes to traditional, and 2 for computer: Acting, which applies for both. Now, I can't even begin to describe myself in that ctegory. I'm not much of an actor, what can I say... I'm good in a lot of things, and I can 'fix' my acting in animation until nothing jumps out, AND I have pretty good ideas usually to make a character do interesting stuff, but other than that I have a lot to learn. I think in a couple of years I'll be excellent in the other two categories (which I'll soon describe), but then I'll really have to take a lot of acting classes if I truely want to master animation...; The second category is called 'animation tech', which involoves a lot of technical knowledge of how things look when they move. Spacing, timing, arcs, squash and stretch, hold/moving holds, weight, and the rest of the principles. Recently I watched the little Mermaid again, and I have to say I felt I can understand a lot more of what they're doing there because I've been animating a lot lately. I understood something really important, which I'll try to illustrate and post here in the next couple of days. I realized a few things about force, after comparing the wonderful movement in the little Mermaid (although the cleanup is wobbely) with the movement in my scene, and there was deffinately something completely missing in mine. Anyway, the 3rd category is GOOD DRAWING. Now, drawing is a craft that even after 80 years you can still grow and learn new things. Every time you draw something new, you learn. First you have to understand the fundamentals, and then u have to use the tools that u learned, and apply them to, yes, FURTHER LEARNING of every thing u wish to know how to draw. In essence, it's about understanding THE STRUCTURE of things, which enables you to draw it from any angle u wish, from imagination. There's also different types of things to draw, that's why ID drawing, which focuses on slick surfaces and hard materials deals primarily with structure and accurate perspective, whereas figure drawing is more about things like fleshiness, weight, spririt. Then comes in understanding in drapery, hair, effects and what not. And we haven't even begun to talk about light. Shading, and eventually color (which is a whole theory by itself) can be also applied to all of this.

Pheww. So much to learn, so little time. But to get back to my movie, fortunately I don't need to master drawing to make my movie look professional because it's 3D. Instead, I have to become a tech wiz, and rely on advice from my mentors. The first dream sequence WILL BE COMPLETELY DONE IN EXACTLY A WEEK, including cloth and hair. That leaves me 5 weeks for the second dream sequence, but I have thanksgiving week to catch up.

Cheerios.

Thursday, October 12, 2006

Animating takes a looooong time...

Begining to get nervous here... Animating Lucy in the first dream sequence is hellish. The scene is 1200 frames long... I started by animating just her body, legs and head, perfecting the keys and breakdowns (all on stepped). I then proceeded to animate Lucy's layer 2, which is her arms and the teddy's body and head. The last layer is polishing the arcs and animating the secondary-secondary (tertiary) motion of the teddy's arms and ears. Then I'll animated homie's reactions, which shouldn't take me more than a week. Then it's splining time. I estimated it would take me 4 weeks, but I think with all the midterms coming up it would take me around 5, not including hair/cloth. That leaves me around 6 more weeks for the second dream sequence. Overall I'd say I'm a bit behind, which worries me a little.

I had some trouble with parent constraining the puppet to the girl's hands, since I never used parent constraints before, but I figured it out eventually. Also, there's a presentation for my department next friday, which slows work down a little bit, but it's good to stay on par. here's what I wrote Rob I'm intended to do for it:

' I hope I can get the following done by the presentation next friday: Finish Lucy and the teddy completely for this scene, except splining, key poses for homie in this scene (no in betweens), no hair or cloth in this scene yet. Additionally I want some quicktime movies demonstrating the rig (how do u capture that anyway?), the test shots (with and without hair/pants), and I guess I'll show the animatic again. That's all I can do in a week (hopefully. Have to get cracking with the arms/puppet animation, I'm only 30% there). Then by next next wednesday (I think that's the begining of next month) I want to completely finish the scene and send it to Gavin (not splined yet), and begin thinking about the 2nd dream sequence... Don't know why I'm writing u this, I guess it's more for myself (don't get out much anymore :) ).'

sigh.

Thursday, September 28, 2006

Animation nation

The film is officially under way! Hurray!

I started animating the first dream sequence. The shot is very very long, about 40 seconds, and very complex as well - it involves two characters and the teddy bear, as well as keeping everything in sync with the toy train revolving at a constant speed. Today was quite boring - I always hate the begining part of an animation sequence - it feels like staring at a blank page. Once the key poses are sketched in I can begin refining them and then finally start animating. So I've completed Lucy's main poses. They're very rough at the moment - nothing to write home about.

Tomorrow I'll refine the poses and begin thinking about the motion. This weekend is all about breaking the scene to about 5 or 6 main parts, and then moving from one to the next, creating keys and breakdowns. I want to finish a rough rough stepped version by next wednesday - only Lucy at the moment. Next week I want to further break down her movement and add homie's subtle acting, as well as fitting her hands to the dolly so it wouldn't have any wierd penetrations. I want to begin participating in the film department's thesis sessions (the only place I can still find animators in Pratt), and see what Pat Smith has to say about the scene. From there it's straight to Gavin, while I start smoothing the tangents out. Completed scene by 20th of next month. Then I'll begin working on the second dream sequence, hopefully crack up the pace and finish it in another four weeks. My goal for the last two weeks is rest a bit and finish a short dialogue scene, including rough lighting (as long as I still have Rob, it's good to tackle all the technical issues). If I can do this I'll be in quite a good place. I also want to rerecord the dialogue, as well as sampling real subway background noise. Winter break is a huge stretch, and I plan many things for it, but let's just cross that bridge when we get there.

Later!

Saturday, September 16, 2006

Just another day..

Here's my current situation:
- Homie's rig is complete, except for bump maps for his forhead.
- Lucy's rig is complete, except for her simple hair.
- Environment modeling is about 20% complete.
- Environment rigging has not even began, nor did texturing of any kind.
- I created a 3 second test shot for homie as well, and it all works great. I even animate faster than I thought.
- Established a formal mentoring relationship with Gavin Moran from Sony - he liked the test shot - and he usually doesn't like anything, so that's a good sign.

I took the day off today, tried to decide whether I want to buy a license for Syflex. It's quite an investment, but pirating it means risking infecting my brand new computer, and potentially loosing data, which is a risk I can't really afford to take. I'll try talking to them about maybe reducing the price for me - fortunately Rob knows them so maybe he can hook me up.

I want to finish homie's cloth and hair by this wednesday, which means I'll have to get crackalakin' this weekend.

Thursday, September 07, 2006

The Pressure is on

School officially kicked into gear, along side with its useless distractions, such as 3 liberal arts classes, poeple, girls and what not..

I also had my first 'unofficial thesis class' with Rob, and we devised a plan for the near future. I need to start animating in 3 weeks. For this semester, I want to finish all the preperations including models, rigs, textures and cloth/hair/soft bodies, and finish the 2 main dream sequences, which are essencially about 40-50% of the film's run time. Winter break would be a big stretch, as it has no distractions. I want to finish re-record the voice (in a recording studio), sample subway noise, and hopefully lock down the music with Dory. Also during that time I want to begin animating the dialogue scenes, about 5 of them.

The Spring semester is the final run. Only 1 extra course should give me plenty of time to finish the remaining 12 scenes in about 6 weeks. The remainder of the time should be spent on lighting, rendering and putting it all together.

As for the next week, my goal is to finish off homie's test shot (not including cloth / hair) as well as Lucy face and body fully rigged, and thats all by next wednesday. By the way, Homie's rig is complete, and lucy has all her blendshapes. The week after that it's figuring out the cloth and hair, texturing and more work on inside of train. A week later the first dream sequence should be ready to go, including the track / toy train rig.