tutorial: mapping actions to sliders for animation

many of us know, that virtually any of the commercial 3D animation packages have some sort of slider-animation possibility. in maya there are driven keys, in XSI it’s possible to control a complete animation-strip via a slider and thus control complex animation (hand or facial expressions) with the ease of mixing the values of a couple of sliders.

i often wished, blender had something similar, but never actually considered the fact - it is (almost) build in! so i’ll describe here how to build a setup that uses sliders to control armature-animation.

1 - theory

among sliders for material settings, or constraint-influence, blender uses them to control and mix relative vertex keys, if assigned to a mesh. once set up, they appear in the action editor, the same that is used to visualize bone actions. now how can they be usd to control bone movement?

two important things to think about: objects can be parented to vertices, and bones can have an action constraint applied, using any object as a “driver”. do you make the connection already?

2 - the setup

if not, here’s the trick:

2a - the armature

first set up a simple bone chain (let’s imagine, three bones that can bend a finger). make an armature with three bones, each one blender unit long. change to pose-mode and define keys - for the neutral pose at frame 1, for the bent pose at frame 30 (remember that - we’ll use those values later in the action-constraint). change any 3D view to an action editor and rename the current action to “bend” (also

memorize that - or write down everything on a post-it). test the animation by dragging the frame-slider. go to frame 1, from the actions-menu click on the arrows and press “ADD NEW”. this will create a copy of the current action. select all keys from that second action and delete them.

all i’m doing here is cleaning up a little, this will make the "magic a the end easier to see.

2b - the RVK mesh

the second important part is the control objects. since we want to use RVK’s, we’ll need a mesh that has mesh-keys applied, and an intermediate object that is parented to the vertices and drives the action constraint applied to the bones.

so, let’s start with the RVK-mesh.

create a cube (or any mesh). exit edit-mode, press ALT+R to clear rotation, then again enter edit mode and delete all vertices. we’ll make our custom-control mesh will suit well the needs we have. still in edit mode, add MESH>>Circle>>3 vertices (important!). this gives us a triangle. hit “.” to change the rotation center to the cursor and rotate the whole mesh, so that one vertex is on top and lined up with a vertical grid line, and the other two vertices are horizontal. this is easy if you hold CTRL while rotating (snaps rotation to 5°-steps). now, make sure the time slider is at frame 1, and hit “I”>>“MESH”>>“Relative keys”.

now rotate the mesh (we’ll still in edit mode!) 90° (watch the window header - it shows the rotation offset you perform while dragging the mouse) and add another mesh key. leave edit mode.

have another look to the action window, there is a label “Sliders” and an arrow, which actually expands and shows them. so use the slider to add a key at frame 1 (value:0) and another at frame 15 (value:100).

dragging the frame slider shows the animation. don’t worry if the mesh seems to get scaled down in the middle of the animation.

again back to frame 1.

2c - the intermediate object.

this is also merely a control object, and we’ll also give it a special appearance. make sure the cursor, the RVK mesh and the armature share the same location, and add MESH>>Cube. again exit edit-mode, clear rotation, enter edit mode, delete all vertices and finally add a circle, this time with more vertices (24 - we want it to look more like a circle). deselect all, select the one on top and pull it up, so that it looks like an arrow. leave edit mode.

2d - final steps

before actually “wiring” everything together, we should rename the object involved. this makes it easier to set-up, and you’ll know later what is what. so bring up the transform panel with “N” and start renaming:

the armature is named “arm.finger”, the RVK-mesh is called “rvk” and the intermediate object is called “intermediate”.

let’s first do the vertex-parenting: select the intermediate object, SHIFT-select the RVK-object. hit TAB to enter edit-mode. since the RVK-object is the active one, you’ll enter edit mode here. select all three vertices and hit “CTRL+P”>>make vertex parent. exit edit mode. now when you drag the time slider, the intermediate object will follow the rotation of the triangle. as may already know, using one vertex as parent allows you only to change the location of the child, while using three vertices also enables rotation - and that’s what we need!

now comes the action constraints: select the armature and enter pose-mode. for each bone the same procedure applies: select it, add an action constraint and use the following values:

OB: intermediate
AC: bend
Start: 1, End: 30
XRot
Min: 0, Max: -90

the last two might vary, maybe you’ll need some experimentation to find the right value. in any case the range should be 90°, since your control object rotates in that range. when finished, exit pose-mode, grab the time slider and watch :slight_smile:

3 -final notes

if everything went fine, you should get an impression of what’s possible using this technique: you can set-up virtually any bone-based animation and map it to a single slider! one thing i haven’t tried yet is mixing, using multiple controllers, which would even expand the capabilities (facial expressions, hand poses etc.)

so, that’s it. hope that helps anybody out there.

marin

IMO this a very good idea, but it would be a little too tricky for complex animations to set up… but if it would be integrated as a stable “automatic” feature, it could be really useful.

Env

HA! This is a brilliant hack. I’d love to see sliders implemented on a simpler basis, but this is very cool.

should be easy. very much like RVK sliders, which appear in the action editor as soon as a mesh has RVK’s, armature objects could also have sliders “attached” to them as soon as an action is defined. as many sliders as actions, mixing… hey XSI, watch out!

no really, it would be more a GUI issue, because the maths/functions for mapping a value (be it rotation or a slider’s position) to an action’s position in time IS already there!

hoping for the future :slight_smile:

marin