Thursday, February 14, 2013

Happy Year of the Snake


A slightly belated (yes, the first day of the Chinese New Year celebrations was a few days ago on Monday) Happy Chinese New Year greeting to all.


Making Of
Despite it's simple 2D line-art appearance, this whole image was rendered in Blender, derived from one of several quick sketches for a snake-themed greeting I knocked out in an 30 minutes a few days ago.

Some history about this project...
About 10 years ago (i.e. during the previous zodiac cycle), every year I'd try to come up with a little animated skit that year's animal. In the early years, I just about succeeded (using Paint + MsAgent and assembled using a little Visual Basic app), though these attempts usually suffered distribution problems arising from my use of hardcoded paths to the MsAgent character file (Doh! This only really occurred to me several years later upon stumbling across the code again). Later on, this long-term project was tempered by an increasingly busy life (including starting Blender development and increased violin/music commitments), increasingly complicated plans/aspirations for animated awesomeness, and a blank mind every time it came to trying to creating suitable character designs (Argh! For example, it's amazing how despite knowing what a tiger looks like, when it comes down to it, nothing you try to create looks even remotely like one!). As a result, most years, I ended up barely managing a humble little still image by the time CNY came around to show for my summertime efforts. This year though, I was mostly stuck for ideas for what I should get my snake to do. No story, no go.

The Sketch...

The original sketch - pencil on paper (nothing can really beat that still IMO, though Sketchbook Pro + a good quality stylus probably come close)

While filling in some time before heading out a few days ago, I decided to try doodling a few snakes to play around with some promising concepts to polish up - either as a very short skit (increasingly unlikely with each day that passe) or just a still. This particular design which I've gone with was actually the second one I drew that morning (NB strictly speaking, the first one wasn't even complete, as I realised half-way through that the tongue placement there was just weird/impractical).

Once again, starting from what I term "the characteristic arc" (i.e. a sweeping spiral-like initial line *), I slapped a pair of the classic eyes I've been putting on characters recently over the past few years, and voila! A semi-decent character design was born.

(*) As a side note, I'd have to say that my drawing techniques changed quite a bit (for the better I think) a few years ago after watching a video of Eric Goldberg animating Louis the Alligator. IIRC, what struck me the most watching that video was the magic of how, by using a series of loose and light curves, he'd start by blocking out the near-final voluminous forms, and the with a few well-placed chips and creases (placed with clinical precision and with almost no wastage of any lines) various features of the character would start to emerge. Seeing a volume take shape like that was quite amazing! Also, listening to the thought process behind frame-to-frame changes, and especially the "double-bounce" stuff was quite enlightening.
From Paper and Pixels
After stewing on the designs for a day or so, I eventually found this character crying out to be taken to the next level digitally. Just like with my earlier Tweedle image, I intended to perhaps try and make a 3D model out of it. But, being a bit rusty with modelling and hesitant to go down a winding rabbit hole trying to fine-tune a rig and deformation system for such a creature, eventually the plan was just to make a beautified 2D rendering of the sketch.

After scanning it in (greyscale), I proceeded to crop and isolate the character from the rest of the designs.

Now, before trying to do a paintover to apply some colours and shading to the sketch, I figured that I needed to firstly trace out the main outlines of the character so that, 1) these could be overlaid over the shading to retain the slightly-rough "liveliness" of raw pencil sketches (*), 2) they could be used to mask off areas for easier painting.
(*) In recent years, I've taken a strong liking to 2D characters rendered in just raw pencil sketch style. That is, without any cleanup pass to extract clean, continuous outlines, which are then filled with solid blocks of colour. This cleaned up style, which has long been the gold standard of "cartoon" fare produced by studios, and which is now easily cranked out by the bucketload as the hoards of low-fi mass-market soul-less Flash/Vector2D "sliding cardboard" crap out there, is frankly boring. It is also devoid of all those little minor details (such as those lines which may be slightly overdrawn a few times for extra stress, or perhaps those few loose and jagged lines suggestive of whispy whiskers beyond), those human touches, which give the animation even more life, while providing a brief glimpse of the master craftsmen behind all this and their struggles to get the performance finessed. And it's only then, that the true magic of traditional 2D/hand-drawn animation can really be felt - a series of lines on a page, coming to life before your eyes. I'm still waiting to see a mainstream release or releases where we get to see something like this.

However, it turns out that achieving this is pretty darned difficult in most of the 2D software out there. The options I'm aware of and tried unsuccessfully were:
1) Just tracing over the lines in a paint program, using mouse or stylus - it turns out to be really tricky to do this while maintaining smooth rounded lines which strictly follow those in the template (or risk loosing the vitality of the original drawing)

2) Using edge detect algorithms to select the edges - The idea is to automatically detect the strokes, and get the computer to simply broaden/thicken them up, or instead to produce tweakable curves from these. As it turns out, these simply don't work well enough here, as some parts aren't drawn that darkly, while others are filled with many lighter rough-guidelines and proto-shading, which ended up confusing the algorithm.

3) Tracing out the lines using Bezier Paths in Gimp or Inkscape (or editing the outputs of 2 in Inkscape) - ARGH! If you ever need a reminder of just how nice Blender's workflow is, then you just need to spend some time playing around with path editing tools in other apps. They're a bloody pain! Multiple clicks to deselect or select control points, struggles to move these without accidentally misclicking and unselecting/missing the control points resulting in unintended changes including selecting a completely unrelated object's control points, misbehaving controls that are just clumsy to edit without spazzing out/doubling-up/switching-direction, or accidentally adding extra control points which can't be easily removed or joined to the rest of the paths. ARGH!

Surely we can do better than this crap! ARGH!

Blender to the Rescue!
Fortunately, to my great relief, Blender's curve tools were more than sufficient to get the job done in a really pain free manner. And they work really nicely when using a stylus for tracing out line-art, when plotting points one at a time (Grease Pencil could also be used for more spontaneous sketches, though here, we've already ruled out tracing over existing curve-lines as a viable option).

My workflow was something like:
1) Ctrl-LMB = Add point, then move pen to a close spot nearby. At this point the handles/curve is often a bit scary, but just resist the temptation to tweak just yet...
2) Ctrl-LMB = Add another point along the line (this is linked to the first point). You'll now notice that the curve has started to come right automagically, and by and large is actually tending towards the exact profile you'd envisaged!
3) Ctrl-LMB - This process is repeated all along the curve

4) AKEY = Deselect last added vert
5) Ctrl-LMB-Drag = Lasso select to easily select verts/handles that need some urgent fine-tuning. RMB is impractical here (as you're floating above the tablet surface trying to pinpoint a tiny target), while LMB select won't work (but IMO, is realistically pointless, as you really can't see the verts you're trying to select at this stage as they're almost always hidden amidst a dense sea of black muck surrounding the line you're tracing out). Hence, lasso select here really works quite well.
6) GKEY - LMB-Click/Stub = Move verts. This part is perhaps a bit controversial, but IMO it's a really really good thing to decouple selection from moving stuff. Yes, this does slightly go against your natural instincts of just grabbing stuff to move it. But, whereas in real life you need to grip the object to move it, in computer interfaces, gripping to move and pointing to select are both bound to a single input event. There is no way to distinguish between these two, which leads to ambiguity in some cases, leading to heaps of little infuriating, "dammit! I wanted to move A, not select B!" or "dammit! select B not move A you dimwit!" or worse "dammit! just missed A by a micrometer... now I'm going to have to reselect it first before moving!". This dance of ambiguity is tiring.

7) Alt-S = Adjust thickness of curve at various places. Yay! I can easily fine tune the curve thickness, segment by segment this way, instead of dinkering around with some line style crap!

8) XKEY = Delete unwanted/wrong verts. No need to hop over to the other side of the keyboard for Backspace ONLY (*ahem* GIMP) or Del (e.g. Inkscape).

9) [Select Vertex Method]...
10) Ctrl-LKEY = Select rest of connected curve - no hunting and pecking in dense area to find verts!


Using this method, I was able to quickly and easily trace out the original sketch (displayed as a Background Image), producing a clean outline which kept the characteristics of the original while allowing me to make tweaks cleanly and efficiently.

Of course though, as I often find while actually working on projects using Blender, there were a few small features missing which would "have been nice" to have. Look out for these (hopefully) once the current release cycle ends!

No comments:

Post a Comment