Tutorials

It’s been 9 to 15 July 2017. I don’t have anything close to a preview of Shot 3 yet – it’s been a week of lost evenings, product releases at the day job, visits from interstate and a pressing need for rest. Shot 3 and its bird/cactus japery is just going to take a while longer and that’s that.

Someone asked how I did the “zip” (smear) effect in Shot 2 and whether I used motion blur. I didn’t! It’s just extreme scaling on a few single frames.

Here’s the shot in motion (again):

ALL HAIL THE PYRAMID (again)

And here’s stills of the smear frames where the head monk appears.

Frame 73 – monk enters

Frame 74 – monk ascends

Here’s a screengrab from Blender:

The highlighted bone is the base bone. It is quite stretched.

The X and Z scale values are both 0.142 because I built the base character much bigger than it ended up being in the final scene, so I had to scale it down. The Y scale value is 1.492, over ten times the value of X and Z. This distorts the rig considerably along the length of the base bone.

This means the character covers a lot of the screen, and in a single frame I can draw the attention of the audience to what this little purple guy is up to. It ups the cartooniness, it strengthens the staging, and as long as the zip frames are spaced so that they have obvious visual continuity (i.e. no large spatial gap from one frame to the next), it’s a lot of impact for not very much time spent.

If I’d had more time, I’d have added a frame where the monk is distorted in more of a curve to follow the contour of the ground rising up into the pyramid, but it’s fine without it. (Next time for sure!)

There can be no discussion of smears and zips and such without linking a certain Chuck Jones short which is chock full of great smear effects. Who needs motion blur?

I’ve been playing lots of Far Cry Primal since it came out last week. It’s been jolly good fun tooling around the Stone Age on Easy difficulty, lobbing spears and cave bears and bees at conveniently colour-coded baddies.

A Moment In The Sun meanwhile is back in active development. I’ve written a much tighter synopsis along with some handy character rules that should help keep me on track. Easter’s coming up weekend after next (not next weekend, derp), so if I get my act together I’ll have a good run of days for doing some rough layout. 🙂

There’s two animated shows in particular whose feel I like for AMITS, both kids’ shows – Pocoyo and Kaeloo. I’ve recorded both of them off free to air TV down here but I end up with WTV files. Neither VLC nor Blender load WTV files natively, and WTV files (here in Australia at least) are also stupidly big because our digital TV broadcasters are still using old inefficient codecs to maintain compatibility with old hardware.

Anyway, here’s a mini-tutorial on turning WTV files into MP4 files using open source software. Mainly writing this so I don’t forget the commands for FFmpeg or the keystrokes for Avidemux. 🙂

Step 1: Record your show using Windows Media Center (sp). Make sure you’ve got a buffer of around 5 minutes either side of the show starting and finishing because TV schedules are not exact. Free-to-air TV in Australia doesn’t apply any kinds of extra DRM – other countries may vary. You will end up with a stupidly big file.

There is a way to batchconvert a whole directory using a single line of code – sadly, * doesn’t work. Personally I cheat by booting into Linux and using bash. 🙂

Once FFMpeg is going, wait a bit. It will do Things.

You will have a file which is much smaller but about the same quality.

Step 3 – topping and tailingunwanted bitswithout recompressing. For this you’ll need Avidemux. Manipulating the MP4 stream directly means there’s no extra quality lost through recompression. Also Avidemux is much quicker to use with hotkeys instead of clicking icons.

Load your fresh new MP4 into Avidemux.

Keep hitting the up arrow key until you can see your show starting. Press [ to mark the in point.

Hit the up arrow key some more until your show ends. Hit down arrow if it skips past the end of the show. Find the keyrame closest to after the program ends then keep hitting left arrow key until you’re at the last frame of the show. Hit ] to mark the out point.

It’s here! In this tutorial, I go over Blender’s “Bake Sound to F-Curves” function and some of its options, demonstrate ways of using the resulting data within objects and armatures, and provide a whirlwind tour of the audio spectrum.

The second half of the tutorial shows you how to identify and extract data from specific frequencies in order to make a drummer armature play the drums using automatically triggered actions – no need to keyframe each individual hit or even open the NLA Editor!

Software you’ll need to follow along at home: Blender 2.70 or higher, Audacity or any DAW.

Here’s some expanded notes on the soft body sim in Blender. I’ve figured out what I think are the basics. I think. Theoretically. Let’s use Mr Jelly Belly as an example mesh.

The goal is to create a soft body sim that procedurally jiggles Mr Jelly Belly’s soft parts around without requiring hand-keyed animation.

The soft body dynamics simulation is mainly an interplay between introduced energy, stiffness/springiness and damping (more correctly dampening but whatever).

When the vertices of the mesh are set in motion (through object translation, shape keys on keyframes, armature-based deformation, certain force fields), energy is introduced – soft body simulation treats vertices like a system of physical particles linked by edges and faces. The stiffness/springiness of the vertices, edges and faces determine how much that energy affects the position of the vertices, and factors like damp(en)ing determine how quickly energy is lost from the system. Once energy stops entering the mesh, the verts will try to get rid of the rest of the energy and return to equilibrium (motionlessness).

First off, for the love of kittens and puppies, open up Soft Body Cache and change the Cache Step option from 10 to 1. (1 should really be the default.) [EDIT: It is the default now. Hurrah!]

So, first let’s look at the top panel, labelled just Soft Body. Here we have:

Friction: the viscosity or thickness of the “air” outside the mesh. Low friction (0 – 1 or so) means the “air” has little if any effect on the mesh – it’s thin, so it doesn’t do much. High friction (4 or more?) means that the “air” takes more energy for the mesh to move through if it’s still. This means the simulation won’t be as energetic, because it’s losing energy to the viscosity. and if the “air” is moving (e.g. because of a wind or vortex force field) it imparts more energy to the mesh. A wind force field will have much more effect with a high friction value because of the extra viscosity of the air.

Mass: As in real life, mass determines inertia: how much energy it takes to get something moving, and also how much energy it takes to make it still. If there’s a mass vertex group selected, this number acts as a multiplier. If there’s no mass vertex group, each vertex is weighted with this number. (Probably.) Mass also interacts with the world gravity setting.

Simulation Speed: If your simulation’s OK except for the fact it looks like it’s in slow motion, set this number higher than 1. If it’s too quick, set it between 0 and 1.

Think of the mass vertex group this way – how much mass is pressing against the vert from the inside of the mesh? How much force is that vert holding back? In the case of Mr Jelly Belly, there’s a lot more mass affecting the underside and sides of the belly than the top of the belly – the weight has sunk into place. Essentially, it’s a gravity thing.

We want Mr Jelly Belly’s spare tyre to be heavier on the bottom so it jiggles more slowly than the top. This is the mass map for Mr Jelly Belly:

Skipping Soft Body Cache (we’ll come back to it), we come to Soft Body Goal. This is where you control how much the verts attempt to keep the position they hold before the soft body simulation takes effect. This is untickable. Here’s why:

If you want to run a pure soft body simulation on this mesh, you want the verts to be able to go wherever the simulation says they should. Therefore they don’t need to pay attention to where they were before the simulation, so a goal is irrelevant. In this case, leave Soft Body Goal off.

If you’re doing armature deformation or shape keys or anything else like that to the mesh and using soft body dynamics as icing on the cake, you want Blender to pay attention and work additively on pre-existing animation. In this case, leave Soft Body Goal on.

We want to control which bits are simulated and which bits aren’t, so we’re going to leave Soft Body Goal on.

Parameters in this section are:

Default: If there’s no vertex group given, or if a vertex doesn’t appear in the vertex group, this number determines how much the verts stick to their pre-simulation positions. We want some bits to jiggle and some bits to stay still, and we’re going to specify values for all vertices, so we can ignore this number.

Minimum and Maximum: Scaling values for the vertex group. A vert with a weight of 0 in the vertex group is re-scaled to the value in Minimum, A vert with a weight of 1 in the vertex group is re-scaled to the value in Maximum. Anything else weighted in-between is re-scaled to fit those values. If the verts are flopping all over the place gelatinously, upping the Minimum value to something like 0.9 is a good place to start.

Stiffness: How attracted are the verts to their pre-simulated positions? In other words, how much do they resist movement? While the mass value per vertex translates into inertia, and the goal value per vertex translates into how much movement is ultimately shown in the simulation, stiffness determines the strength of attraction of all the verts as the simulation progresses. Weak stiffness means the verts will go a lot further afield while stronger stiffness means they’ll generally stay put. Values range from 0 to 1. After some experimentation, 0.8 worked for me..

Damping: How quickly do the verts lose energy once they get it? Undampened verts (value less than say 2) can wobble for ages. Dampened verts (values up over 20) lose their energy quicker and wobble less. Flesh doesn’t wobble as much as jelly so I’ve got a high damping value in here (30).

Stiff, undampened verts will vibrate at high frequencies like a stiff ruler. Slack (unstiff), dampened verts will wobble a little bit then calm down.

Since we want the belly to wobble around a lot once it gets going but for other parts of the body (like the legs and chest) not to be too affected, this is the goal map (min 0.9, max 1.0). This map lets the belly wobble around as freely as possible in the sim while keeping the red areas where we left them pre-sim.

Both Soft Body and Soft Body Goal deal with external forces.

Soft Body Edges, the last panel we’ll deal with in this intro, is all about setting internal forces. (There’s also Soft Body Self Collision, Soft Body Solver and Soft Body Field Weights, but I didn’t touch them.)

Soft Body Edges is truly where it’s at. I can’t think of any situation in which you’d actually untick it because if you do, things tend to fall in a heap. This is because Soft Body Edges is where you set up the internal tensions of your mesh acting through its edges and quad faces:

Pull and Push: Determine how much edges resist when stretched (Pull) and compressed (Push). These can be wildly different values depending on what you’re simulating. For instance, rubber can be stretched quite happily (low pull value) but doesn’t compress anywhere near as well (high push value).

Damp: How quickly do the edges lose energy once they’re excited.

Plastic: Should the deformations affect the mesh’s shape for the rest of the scene? If so, enter an integer (!) from 1 to 100. Wisely set to zero by default. If you are doing a soft body sim of an object dropping with Soft Body Goal unchecked, reaching for this might make your sim a bit more interesting.

Bending: How much should the mesh resist bending out of shape? This is a sort of distributed stiffness, calculated across neighbouring edges and verts. Turn it up if your mesh is deforming out of control. We’ll come back to this one, actually.

Length: If you want to shrink or expand the edges by a particular amount, enter the percentage (as an integer) here. Haven’t found a use case for this yet.

Springs (vertex group): At a guess, a vertex’s membership in this group is multiplied with the Pull and Push values to get a final springiness value. That’s what it seems to do.

Stiff Quads: An extra layer of mesh stiffness reinforced across opposite (as opposed to adjacent) verts on 4gons. Shear controls the stiffness across the quad.

Since we want the belly to be pretty springy and mobile, it gets a low spring value in the Spring map. Other parts of the mesh should be relatively stiff. This is the spring map I weightpainted for Mr Jelly Belly:

Soft Body Solver contains the very useful Min Steps parameter which controls the minimum granularity of Blender’s simulation. If the simulation appears to be doing stupid stuff like making certain verts stick and then suddenly fly all over the place like a wasp on crack, try cranking this number up a bit.

So, back to that Bending parameter in the Soft Body Edges panel.

Let’s say you’re playing with dynamics. Let’s say you’ve got a complex shape like our good friend Suzanne. Let’s say you’re blasting that complex shape with a very powerful Wind force field, and let’s say Suzanne’s eyebrows are periodically disappearing into her forehead. By cranking up the Bending parameter to 2 or 3, you increase the stiffness across longer links than just adjacent verts. Suzanne’s eyebrows find it harder to bend back because of this distributed stiffness. Basically it’s a way to say “Get the mesh to hold its shapes as they are”.

Dealing with self-intersection this way is preferable to the alternative, namely ticking the Edge or Face boxes in Soft Body Edges, then turning on Soft Body Self Collision and burning enough CPU to fuel a small country.

Anyway. Whenever you play the scene’s animation from scratch, the soft body re-simulates. You can tell it not to simulate until render time by unticking the eye icon next to the “Soft Body” button.

Soft body dynamics can also be placed over the top of meshes being deformed with armatures.

It may help to remember in this instance that the soft body parameters can be animated. For instance, you can nullify the effects of the soft body simulation by having Soft Body Goal’s Minimum and Maximum parameters set to 1 during parts of the scene. Such parameters can be bound to bones and linked using our old friends drivers.

If any given vertex is allowed some simulation, it’s possible for the armature-driven movement to lag severely or even be ignored entirely if the stiffness in Soft Body Goal is set too low.

I wouldn’t call that everything I know about soft body dynamics in Blender, but at least now we have a procedurally animated hypnotic jiggling purple arse to contemplate: