Category Archives: Tutorials

Tutorials in Photoshop, After Effects and other animation and design software.

Pacific - Sample

Adventures in map animation with QGIS, After Effects/C4D and Illustrator

Before I start this tutorial I need to complain about something:
The Pacific Theatre of WWII is a huge pain to map. We were fighting over some SERIOUSLY TINY ISLANDS. Even just finding a vector map that includes them is difficult, and when you go to add labels, well… zoom out wide enough to see where in the world you are, and you can’t see the places you’re trying to pinpoint.

QGIS to the rescue! Yes, it’s finally time to make our own maps.

I’m not gonna get too technical here (I’m still learning this stuff myself), but this will hopefully serve as a useful workflow reference to help animators on their way to becoming DIY cartographers.

So what is GIS, anyway?

You’ve heard of data-driven design? This is some of the stuff that’s driving the data for data-driven design. GIS stands for Geographic Information Systems — basically, all things digital mapping. If you’ve only ever worked with maps designed by someone else before, learning to use GIS software will enable you to go much deeper: not only can you create your own maps from raw data, you can measure exact distances, do all kinds of cool analytical work, go nuts with custom styling and even change map projections on the fly.

There are lots of different GIS applications, but we’ll be using QGIS because it’s free, open-source, and outputs files in a usable format. You can download it here.

Grab some data

To get started, you’ll need to import some map data. Shapefiles (.shp, usually accompanied by additional files with other extensions) are the main way to get outlines into GIS software. These are basically just geographically-linked vectors, and there are tons of them available for you to use.

Here are a couple sources for shapefiles you can use for anything you want:

You can also use OpenStreetMap data freely. If you’re working with a small enough area (think neighborhood, not country), you can even grab the vectors you need right within QGIS. Here’s a nice tutorial using OSM to generate a map of London’s pubs that covers that import process.

Another way to get data into QGIS is to import KML files. This is the way to work with points you’ve mapped using Google Maps Engine or Google Earth. Maps Engine is a lifesaver if someone gives you a giant spreadsheet of poorly labeled locations. You can upload a CSV (100 locations at a time with the free version, but breaking a big dataset into chunks is easy enough), tell it which columns contain the location info, and be amazed when it figures out what the guy who sent you the spreadsheet meant when he abbreviated California as “Calf”. mapsengine

There are also thousands of maps made by other people whose points you can borrow. Once you get everything correctly positioned on the map, click the folder icon in the top left corner and choose “Export to KML”.
kml-export

Import your data

Now that you have some data to work with, open QGIS and create a new project.

Add your dataset by choosing the appropriate import button for its file format. The importers are located on left side of the screen as well as in the Layer menu, where they are more helpfully labeled. addvectorlayer

Add Vector Layer is likely to be your go-to choice — that’s the right option for shapefiles, KML and CSV data, among others.

If you attempt to import KML from Google Maps Engine and get a blank layer instead, there’s a workaround: open the file you downloaded in Google Earth, resave as KML and try again. (Note: Google Earth may give you a KMZ file, which is a zipped KML. Just change the extension to .zip and unzip to import into QGIS.)

The earth isn’t a perfect sphere, so you’ll need to choose a geographic coordinate reference system (CRS) to make sure your points land in the right place. WGS84 is the standard you’re likely to be working with.

As long as it knows its original format, QGIS can reproject data on the fly. You can set these options in the CRS settings in Project > Project Properties. QGIS ships with a couple thousand options, and if those aren’t enough you can make your own custom projections.

CRS

You can also add points directly within QGIS through a process called geocoding. Enable the Geocoding plugin by going to Plugins > Manage and Install Plugins, and you’ll be able to search for locations one at a time and pin them to your map. (If you have a ton of addresses to batch through, you can follow this tutorial instead.)

geocode

geocode-japan  geocode-tokyo

You can also “reverse geocode” — click on a point and ask QGIS to label it. I’ve had a handful of issues with this plugin, namely that my added points disappear after a program restart, so you’ll probably want to export your Geocoding layer as a shapefile then reimport it. It’s also still using the deprecated labeling engine, so things may scale weirdly — you can switch to the new labeler in the layer settings.

There are a wide variety of other plugins that can be installed the same way as Geocoding. I’ve found a couple especially handy: QGIS doesn’t really do curved paths, but I needed to create a bunch of arcs connecting points to a single city — think airline destination map style — so to get that working, I:

  1. Exported my locations via MMQGIS‘s Geometry Export to CSV menu, manually added the target city to each with the same ID valuelocations-for-points2one
  2. Reimported and ran that file through Points2One to generate the connections as straight lines.straight-lines-b-29
  3. Once I output the lines, I used Illustrator’s Warp:Arch effect to make them into curves, then animated them in After Effects. Convoluted, but it worked nicely.Map With Curves - B-29 Contractors

 

This “do a thing – export the layer – reimport as a new layer – delete original” process probably sounds weird to you, but it seems to be the primary QGIS workflow and we’ll be using it a lot. Advance warning: you’re going to end up with a lot of fiddly little shapefile files. You should probably decide where you’re going to keep them now, before they end up scattered across your hard drive.

Position and style your map

Moving around in QGIS isn’t that different from, say, Google Maps — with one big exception. Global shapefiles are usually centered on the Atlantic, and if you need to generate something Pacific-centered you can’t just roll the map around to the other side. I followed these instructions, which are tricky but seem to work. (If you know of a better method, please tell me!)

pacific-centered-map

To customize the look of your layers and/or add labels to your points, double-click on the layer name. You’ll find a million options inside. QGIS even supports blend modes, which look great but don’t work with vector export — they’re still super-helpful though for previewing purposes. To change both the line and fill styling, click on Style, then click the default Simple Fill in the Symbol Layers list to get to the full parameter set. From this screen, you can also access more advanced options. Make sure to check out the line and pattern fills; they do some neat things if you’re going for a more abstract look for your map. Here’s Australia with polka dots and kittens:
australia-polkadots

australia-kittens

Get your vectors out of QGIS

And now for an annoying extra step. Once you have a map you’re happy with, you can’t just go “Save as > PDF”. Instead we’re going to be using a tool called the Print Composer for this bit.

Note: If you’re attempting to create a map of the whole world, you should avoid using the highest-resolution land data from Natural Earth. I can’t get it to import properly into Illustrator for the life of me. I can, however, use the high-res shapefiles as long as I’m only exporting a smaller portion of the globe. They’re really nice to work with when you’re dealing with all the aforementioned tiny Pacific islands.

Go to Project > New Print Composer and give your new preset a name.

Click the Add New Map icon (looks like an unrolling sheet of paper), and drag a rectangle the size of the page. If you want to match your current view in QGIS, and it looks like the map’s the wrong size, go to Item Properties and click “Set to map canvas extent.”

mapcomposer

Now you can save as a PDF.

If you plan to map your data onto a sphere (either in C4D or with CC Sphere), export your file as an equirectangular projection, with the extents set to X min = -180, Y min = -90, X max = 180, Y max =90. You’ll probably need to crop the resulting file/change the artboard size, too, since QGIS exports documents in the shape of the paper it’s “printing” them on. 3600×1800 is a good choice of final image size, since it’s easy to keep the math consistent if you need to add something later by hand — just multiply your degrees by 10.

Open your map in Illustrator

Here’s where we’re going to turn a flat vector map into something we can use in After Effects.

illustrator-openmap

When you bring the PDF into Illustrator, everything comes in nested within a single layer. You’ll have a lot more design flexibility later on if you take a couple minutes to break up the map components into multiple layers. When there are lots and lots of paths, I find the easiest way to pull the pieces apart is to select one part of one element,  go to Select > Same > [Relevant appearance attribute], then cut and paste in place (Ctrl + Alt + V) on a new layer. If you want to be able to link to your points in AE, use the Release to Layers feature, then drag them out to be top-level layers.

illustrator-selectsame

illustrator-layers

You can add additional styling at this point, too. Using the art brushes on country border strokes is an especially nice effect:

illustrator-restyle

Label your layers, and save as an Illustrator file, or export your image in your favorite C4D texture format.

Protip: To import Illustrator paths straight into C4D, you need to save them as Illustrator 8.

Now on to After Effects and/or C4D

This is the easy bit. Well, easy for you, assuming you already know After Effects or C4D. For AE, just import your AI file as a composition, drop the layers in your comp and animate and composite away as you would any other map. Here are stills from two relatively simple variations on the same dataset:

Pacific - Sample

Pacific - Sample2

Map - Saipan A

Map - Saipan B

The only real differences between the two are color and texture — you can go much further than this.

Even though QGIS’s text labels aren’t much good for animating directly, I tend to import them anyway (I usually stick them all on one layer). They’re a handy a guide for creating native AE text labels. You can do the same thing with points, or import them as individual layers so they’re easy to alt-replace with precomped animation like the concentric rings above. Having georeferenced guides to refer to even when you’re creating new elements from scratch opens up a lot of possibilities. If someone makes a late change to graphic (never happens, right?), it also makes map additions so much easier: you can go back to QGIS, use your saved Map Composer preset to export new borders or geolocated points, and they should line up exactly.

If you want a little bit of 3D and have either 1) a good enough GPU or 2) enough patience to use the Ray Tracer, you can choose “Create Shapes from Vector Layer”, switch to RT rendering and extrude the shapes. It takes forever to render, but you can do some interesting and/or very weird stuff this way. This also lets you apply Shape Layer effects like Wiggle Paths.

For C4D, you have a couple of options:

Image as texture (those of you with just C4D Lite: you can totally do this in Lite): create a new material, import an image file of your map as a texture, throw it on a sphere, style as desired. Add some splines connecting points and you have a snazzy 3D globe. Alternatively, import the AI paths and do a whole bunch of extruding for a fancy 3D ‘flat’ map that renders faster than with the AE Ray Tracer.

Wrap your vectors around a sphere (you’ll need more than Lite, as this uses the Wrap deformer): follow the instructions here.

Things to watch out for

  • When it comes to the shapefiles inside your project, QGIS is a DESTRUCTIVE EDITOR. I learned this the hard way: I accidentally deleted the whole world at one point. If you want to move some borders around, right click on the layer and Save As… before you go into edit mode.
  • The QGIS team is in the process of replacing their labeling engine, and as of 2.2.0 the new one automatically converts text to curves on export. If you want to preserve the labels as editable text, you should use the deprecated label system — or wait a few weeks. They’re supposed to be fixing this.
  • Don’t get too fancy designing backgrounds in QGIS. They only export for me about a third of the time. Do that stuff in AI or AE — or Photoshop.

Keep your head on: Automating scaling in KinectToPin with Z-axis data

I’ve spent a lot of time recently creating the latest version of KinectToPin’s UI Panel for After Effects. It has a ton of great new features, and makes things a lot easier to use.

But now that that’s out, I’m working on something new that gets around one of the biggest remaining issues with rigging 2.5D Kinect characters: automating layer scaling based on Z-distance. It’s one of the most annoying things to deal with, and until now the best options were “stay in one depth plane” or “manually scale things up and down.” Ugh.

The guy on the left is what happened if you walked back and forth toward the camera and didn’t account for it:

KinectToPin - AutoZ 1

KinectToPin - AutoZ 2

The little expression I came up with this morning turns the same character with the same mocap data into the guy on the right.

Keep in mind this is an experimental feature and at the moment only works for camera-facing characters. It won’t be added to the UI Panel until I’ve worked out the necessary layer space transforms and a couple bugs. In the meantime, if you’d like to try it out, do the following: The new code will be added to the UI Panel shortly, but if you’re eager to try it out, here it is:

In the 3D template, set this as the “mocap” layer’s position expression:

mocap = thisLayer;
try{cam = thisComp.activeCamera;}catch(err){ cam = mocap};
torso = mocap.effect("torso")("3D Point");
tW = mocap.toWorld(torso);
fW = cam.fromWorld(tW);
[value[0],value[1],value[2]+(1500-fW[2])*2]

I swear, it seems like the main thing I’ve been doing for the last year and a half is finding ways to make people’s heads stop flying off. This is yet another.

KinectToPin FAQ and Installation Guide

 

This FAQ’s a bit out of date. Check out the new KinectToPin website for the latest version of the software and how to use it — it’s dramatically easier now.

 

It’s been pretty incredible seeing KinectToPin generate interest all over the world, but I’ve also had a lot of feedback about how difficult and frustrating it is to get it working. One of my big priorities right now is to find ways to make that easier. But in the meantime, here’s some additional helpful information:

FAQ

Is this 3D/can I use it with Maya etc.?
– No, it isn’t 3D (although the Z data is recorded to the XML, and it is open source, so, uh, you can go wild and make something 3D out of it); if you want to use your Kinect with a 3D app try BreckelKinect (Windows only).

What hardware can I use?
– KinectToPin works with the standard Xbox Kinect, as well as the Xtion (a generic Kinect by Asus), although I’ve not gotten that running successfully on my own machine. Has not been tested with Kinect for Windows as far as I know.

Help! I recorded a really long track and I can’t get it converted from XML!
– If you have an xml file that is more than a couple of minutes long, KinectToPin may crash when you try to turn it into AE keyframes. Nick has an older converter-only tool for Processing called FlaePin that may work where KinectToPin fails.

Help! After Effects is giving me grayed-out puppet pins!
– This is a known bug with the Puppet Tool. You need to create dummy pins for all fifteen points before you paste in your tracking data or you’ll get these weird unusable pins.

Help! Microsoft’s Kinect drivers keep installing themselves automatically and taking over for OpenNI!
– You can fix this in Device Manager. Follow David Menard’s instructions here.

 

INSTALLATION GUIDE

The folks behind SimpleOpenNI have created some handy software bundles that will help get you up and running a lot faster. Go to this site and find your relevant link(s) in the “Downloads” menu on the lefthand side of the page. You’ll still need to download Processing separately, as well as KinectToPin itself. Follow the instructions in Part 2 of my tutorial series to get those configured.

In hopes of simplifying things a bit more, I’m also compiling a list of the different configurations people have managed to get working. If you’d like to add your setup, post in the comments using this format:

OS:
Capture Hardware:
OpenNI/NITE version (or bundle source):
SensorKinect version:
OSCeleton version:
Recording with simpleopenNI v. OSCeleton?
After Effects version:
Comments:

 

Kinect MoCap Animation in After Effects

Tutorial links: Part 1: Getting Started | Part 2: Motion Capture with KinectToPin | Part 3: Building the Puppet Rigging Template | Part 4: Rigging a Digital Puppet

More info: A better way to control the puppet’s head | FAQ and Installation Guide

Project files: Click here to download the After Effects project (CS5+).

Quick note: the text is just transcripts of the videos, so you can read or watch as you prefer.

 

Faux 3D Stroke

Get the look of Trapcode’s 3D Stroke with no plugins!

So Trapcode’s 3D Stroke is a great After Effects plugin with a long history. And it’s only about a hundred bucks, so if you make a living animating just go buy the real thing. It’s a lot less hacky.

If you’re a cheap bastard, though, or if you enjoy using AE features in ways they’re not designed to be used, have I got the free preset for you!
Continue reading

Pinned-01

Kinect MoCap Animation in After Effects — Part 4: Rigging a Digital Puppet

 

This tutorial is now obsolete. Check out the new KinectToPin website for the latest version of the software and how to use it — it’s dramatically easier now.

 

Kinect MoCap Animation in After Effects

Tutorial links: Part 1: Getting Started | Part 2: Motion Capture with KinectToPin | Part 3: Building the Puppet Rigging Template | Part 4: Rigging a Digital Puppet

More info: A better way to control the puppet’s head | FAQ and Installation Guide

Project files: Click here to download the After Effects project (CS5+).

Quick note: the text is just transcripts of the videos, so you can read or watch as you prefer.

 

Yes, it’s the part you’ve all been waiting for: it’s finally time to set up your character layers!

This was originally going to be in Part 3, but there are so many steps I realized I needed to break things down a bit more.

Continue reading

3 - Add Source Pins

Kinect MoCap Animation in After Effects — Part 3: Building the Puppet Rigging Template

 

This tutorial is now obsolete. Check out the new KinectToPin website for the latest version of the software and how to use it — it’s dramatically easier now.

 

Kinect MoCap Animation in After Effects

Tutorial links: Part 1: Getting Started | Part 2: Motion Capture with KinectToPin | Part 3: Building the Puppet Rigging Template | Part 4: Rigging a Digital Puppet

More info: A better way to control the puppet’s head | FAQ and Installation Guide

Project files: Click here to download the After Effects project (CS5+).

Quick note: the text is just transcripts of the videos, so you can read or watch as you prefer.

 



Welcome back! So now that you have your tracking data recorded, it’s time to build a character to apply it to. This is where things get a bit complicated.

Continue reading

KinectToAEPartII

Kinect MoCap Animation in After Effects — Part 2: Motion Capture with KinectToPin

 

This tutorial is now obsolete. Check out the new KinectToPin website for the latest version of the software and how to use it — it’s dramatically easier now.

 

Kinect MoCap Animation in After Effects

Tutorial links: Part 1: Getting Started | Part 2: Motion Capture with KinectToPin | Part 3: Building the Puppet Rigging Template | Part 4: Rigging a Digital Puppet

More info: A better way to control the puppet’s head | FAQ and Installation Guide

Project files: Click here to download the After Effects project (CS5+).

Quick note: the text is just transcripts of the videos, so you can read or watch as you prefer.

 

Welcome back. You have your USB adapter and you’ve installed all the software I linked in Part I, right? Now it’s time to get KinectToPin up and running. Continue reading

Kinect Part 1 - 1

Kinect MoCap Animation in After Effects — Part 1: Getting Started

 

This tutorial is now obsolete. Check out the new KinectToPin website for the latest version of the software and how to use it — it’s dramatically easier now.

 

Kinect MoCap Animation in After Effects (Original version)

Tutorial links: Part 1: Getting Started | Part 2: Motion Capture with KinectToPin | Part 3: Building the Puppet Rigging Template | Part 4: Rigging a Digital Puppet

More info: A better way to control the puppet’s head | FAQ and Installation Guide

Project files: Click here to download the After Effects project (CS5+).

Quick note: the text is just transcripts of the videos, so you can read or watch as you prefer.

 

Hello, I’m Victoria Nece. I’m a documentary animator, and today I’m going to show you how to use your Kinect to animate a digital puppet like this one in After Effects. Continue reading