MAX Tutorial3D Studio MAX Tutorial: SETTING UP SLIDERS FOR DEFINED KEY POSES



GENERAL OVERVIEW

This tutorial wants to show the most important steps to create a "Slider Setup" with 3D Studio MAX R.1.2.

But what does a "Slider Setup" mean ?

The main idea of this approach (which is especially useful for character & facial animation) is the following:
First of all you create special key poses (e.g. facial animations such as laughing, crying, kissing etc.) to which you assign a slider. With the help of those sliders the strength of each key pose is controlled in every frame. After the setup of the key poses has been done, the actual animation of the character consists in controlling the different existing key poses with the help of the sliders in the correct relation & timing.

The advantage compared to the usual morphing is that you have also the possibilty to mix different poses at one frame (e.g. 20% laughing, 65% kissing, etc.).

It is even possible to create new "compound sliders" with the ability to control several of your sliders at once for easier handling (wich could be useful for some situations). This is like creating new key poses out of the existing ones by mixing them together. Then, poses that normally would require setting values with numerous sliders can be controlled with this single compound slider.
You just have to connect these compound sliders with the help of Expressions to the already existing sliders wich are supposed to be influenced. After you have managed to get the basic slider setup to work this couldn't be too difficult for you to do anymore. If you are too lazy to do this setup stuff on your own you should consider to buy the MorphMagic plug-in.

This tutorial describes the application of the "Slider Setup" in conjunction with a mouth modeled by MAX's build in patches.
You have to use a combination of LinkedXForm Modifiers and Expressions. The LinkedXForm Modifiers are needed to set up the key poses for your (patch-)character. With the help of "control handles" (usually simple boxes or dummys) applied to the character's patch vertices via LinkedXForm you are able to create the needed key poses. Of course the Expressions are needed to connect the sliders with these "control handles".

If you alternatively choose to create the key poses with bones, a transfer of this technique is possible by using the bones as "control handles". Further it is useful to reserve a dedicated time segment (in this tutorial frames 0-100) for setting up the key poses and start animating on a different time segment (here frames 100-xxx).

If you don't want to start from scratch, download the Slider Demo File now (22,5 kb)



TOC - The tutorial is divided into 7 steps:


I.NEEDED MATH
II.PREPARING THE MODEL - SETTING UP THE CONTROL HANDLES
III.REDUCING THE NUMBER OF CONTROL HANDLES TO BE LINKED TO THE SLIDERS
IV.CREATING THE KEY POSES
V.CREATING THE SLIDERS
VI.LINKING THE SLIDERS WITH THE CONTROL HANDLES
VII.ANIMATE & HAVE FUN !!!



vector_dia.GIF


I. NEEDED MATH


The expressions are realized with the help of some basic vector math. The left diagramm wants to illustrate the mathematical background to get the sliders work. To start with, let's assume we only got one default pose, one real pose (pose 1), and one control handle.

In the default pose the handle is at the position (xd,yd,zd) with the vector vd. In the pose 1 the handle is at the position (x1, y1,z1) with the vector v1. A linear morph between both poses goes along the connection vector vdv1.

We need a mathematical equation for the vector v wich is moving according to the slider position along the vector vdv1, to control the strength of the influence of pose 1 to the default pose. The equation is:

tutformel1.GIF - 489,0 K
Now we have to expand this to several control handles 1...nh and several key poses 1...nsl out of wich results the following equation:
tutformel2.GIF - 8995,0 K

This is the equation for the position vector of a handle h depending from all the slider positions 1...nsl. How you can easily see from this equation, it is getting more complex the more poses / sliders you define. The number of the equations is increasing linear to the number of the control handles. So be aware of this when setting up ! For this tutorial I limited the actual number of control handles to 5 and the number of key poses / sliders to 5, too.

(back to TOC)



II. PREPARING THE MODEL - SETTING UP THE CONTROL HANDLES

object So far concerning the theory - now the practical part:

Of course you have to model a mouth in a default pose first. For this tutorial I decided to use this mouth on the picture, modeld with MAX's patches.


mindtut02.GIF - 9166,0 K mindtut03.GIF - 21944,0 K
Then you have to define most flexible control handles with which the mouth is animated. For this tutorial you can use 8 simple boxes or dummys wich are linked to certain vertices of the mouth patch by the LinkedXForm Modifier.

For this tutorial, name them according to the picture on the left side.









After that the stack of the mouth should approximately look like in this picture >


Now do this:

Tip: To minimize potential problems, try to avoid grouping any handles during setup. It looks like grouping can lead to some very unpredictable results in combination with expressions, at least under some conditions (seems to be a bug). If you like, you can group all handles together at the end of the setup. At least I have done this in the demo file.

(back to TOC)



III. REDUCING THE NUMBER OF CONTROL HANDLES TO BE LINKED TO THE SLIDERS - A LITTLE SIMPLIFICATION

Now a little trick to simplify your work later on at assigning the slider expressions. By linking the 3 control handles tleft, tmid and tright of the upper lips by the use of expressions with the three control handles of the lower lips the number of control handles to be connected to the sliders can be reduced to 5 (as we found out already: more handles - more equations to set up). Of course, by doing this you loose a lot of flexibility when it comes to animating the mouth later on, but it is a good exercise to become more familiar with expressions in MAX. For serious lipsync work you shouldn't link the upper lips handles to the lower lips handles.

Follow these steps:

mindtut04a.GIF - 1356,0 K mindpfeil2.GIF - 1347,0 K mindtut04.GIF - 1266,0 K mindpfeil2.GIF - 1347,0 K mindtut05.GIF - 4287,0 K mindpfeil2.GIF - 1347,0 K mindtut19.GIF - 5317,0 K




tleft: tmid: tright:
vector variables:

bleft : bleft\Position
bleftd : bleftd\Position
vector variables:

bmid : bmid\Position
bmidd : bmidd\Position
vector variables:

bright : bright\Position
brightd : brightd\Position
equation:

[bleft.x-bleftd.x,
bleft.y-bleftd.y,
-bleft.z+bleftd.z]
equation:

[bmid.x-bmidd.x,
bmid.y-bmidd.y,
-bmid.z+bmidd.z]
equation:

[bright.x-brightd.x,
bright.y-brightd.y,
-bright.z+brightd.z]

mindtut07.GIF - 30808,0 K

Now this link should work. Test it out by pushing the lower lips handles around.
The upper lips should perform a "mirrored" movement.

(back to TOC)



IV. CREATING THE KEY POSES


(back to TOC)



V. CREATING THE SLIDERS


(back to TOC)



VI. LINKING THE SLIDERS WITH THE CONTROL HANDLES


control handle "left"
needed vector variables:

left01 : left01\Position
left02 : left02\Position
left03 : left03\Position
left04 : left04\Position
left05 : left05\Position
leftd : leftd\Position
PoseSlider01 : PoseSlider01\Position
PoseSlider02 : PoseSlider02\Position
PoseSlider03 : PoseSlider03\Position
PoseSlider04 : PoseSlider04\Position
PoseSlider05 : PoseSlider05\Position
equation:

PoseSlider01.z/100*length(left01-leftd)*unit(left01-leftd)
+PoseSlider02.z/100*length(left02-leftd)*unit(left02-leftd)
+PoseSlider03.z/100*length(left03-leftd)*unit(left03-leftd)
+PoseSlider04.z/100*length(left04-leftd)*unit(left04-leftd)
+PoseSlider05.z/100*length(left05-leftd)*unit(left05-leftd)

mindtut20.GIF - 30841,0 K

(the equation in the screengrab doesn't fit in the window and is therefore not entirely visible.
WARNING:
in the screengrab & demofile MAX doesn't show the correct assignments of the vectors
when you click on them !!! ...seems like a little bug...use the tutorial tables for reference !)

The variables and equations for "bleft", "bmid", "bright" and "right" have to be set up accordingly. Just replace all words *left* by *bleft*, *bmid*, *bright* and *right*.

Here just a note to simplify your work: After you have set up the variables and the equation for "left" save your expression, open it in a text editor of your choice and modify the expression there with the help of "search & replace" for the other handles (don't forget to save as .xpr).

Unfortunately, the variable-assignments are not saved in the .xpr files, only their names ! Therefore, after loading the modified expressions in for the other handles, they must be reassigned in the Expression Setup menu by hand.

Here a second example to define the variables & equation for "bmid":

control handle "bmid"
needed vector variables:

bmid01 : bmid01\Position
bmid02 : bmid02\Position
bmid03 : bmid03\Position
bmid04 : bmid04\Position
bmid05 : bmid05\Position
bmidd : bmidd\Position
PoseSlider01 : PoseSlider01\Position
PoseSlider02 : PoseSlider02\Position
PoseSlider03 : PoseSlider03\Position
PoseSlider04 : PoseSlider04\Position
PoseSlider05 : PoseSlider05\Position
equation:

PoseSlider01.z/100*length(bmid01-bmidd)*unit(bmid01-bmidd)
+PoseSlider02.z/100*length(bmid02-bmidd)*unit(bmid02-bmidd)
+PoseSlider03.z/100*length(bmid03-bmidd)*unit(bmid03-bmidd)
+PoseSlider04.z/100*length(bmid04-bmidd)*unit(bmid04-bmidd)
+PoseSlider05.z/100*length(bmid05-bmidd)*unit(bmid05-bmidd)

mindtut22.GIF - 18693,0 K

    Finally, this picture shows an overview of all objects you should have now in your scene.

    That's it ! ...the Slider Setup should work. Now to the fun part...

    (back to TOC)





    VII. ANIMATE & HAVE FUN !!!


    Just a note about modifications:

    It is even possible to modify the key poses afterwards. But everytime you go back to modify a key pose be careful: You have to move the original control handle AND the acociated cloned handle for the specific pose you modify !!! Otherwise it won't work right !


    Please feel free to make any comments on this tutorial or your success with this approach to me !








    Copyright 1997 M. Koch - have done (?) this tutorial already - page last updated: 17.04.97