f
f
Global SectionArticlesBookstoreDictionaryDownloadsDVDsEventsForumsGalleryJob ListingsNewsNewslettersSchools
 Advanced Search
USER: PASS:  Login  Register

Subscribe
Site Links
Home > Maya > Tutorials > Using Tools / Scripts > Walk with an expression - DreamLab Database (Math Lesson) > Page 1 Change background colorChange background colorChange background colorChange background color
Walk with an expression - DreamLab Database (Math Lesson)
Tutorial by Federico Cascinel
Login to add a Bookmark 2 votes for an average rating of 3.50

Updated:   09/01/05

Works on:    Irix  Windows  Linux  MacOS-X
Maya Versions:   1.x, 2.x, 3.x, 4.x, 5.x, 6.x, 7.x
Readership Level:   Intermediate
Owner:   sdb1987
Author Name:  Federico Cascinel

This database derives from a personal experiment using expressions. I was looking for a cycling mathematical equation that could allow me to develop almost any cycling actions in human characters and four legs animals.

This tutorial is divided into two parts: the first one is a little math lesson; the second is the database tutorial that will teach you to use the skeleton for almost any human cycling actions

I'll explain the expression procedure that to give you a better understanding of the math involved so that you will be able to produce similar or more advanced expressions in Maya.


If you are not interested in the complete explanation of the expression syntax, click on the database icons

Walk cycle

download "dreamWalk.mb" & "dreamWalkWindow.mel": dreamWalk.zip

download sample avi:

walk1.zip

skiing.zip

oldness.zip



Skiing cycle

A "little" MATH LESSON :


Note: I suggest you to try this first part of the tutorial in a new scene. Create a locator, or another object, and try the expression that follows.

If you don't create a locator, pay attention when you write the expression to use the appropriate name object.


The only think I knew about a cycling expression, at the beginning of this work, was that I'd have to use the trigonometric functions; I was afraid about that, because the last time I used those functions it has been 10 years later when I was in high school.

I started with the simplest expression I was able to think about: "locator1.ty = sin(time)". Form here I knew that I'd need variables to change the frequency and position of the locator animation.

Note: What's a variable? The variable, in math, it's just a value like "1, 2, 1.4, 3.9….etc", the only difference is that it can change depending from your mood or from the expression execution.

So, the "sin" function return a value between "-1" and "1", that mean that the locator can't move higher the one unit up to the zero and one unit down. But when we walk or run we change the "value" of our step longness and highness; what we have to do now is to insert in the expression a new value that will change the highness of the locator, because this expression control just the highness. But if you understand the procedure you'll be able to reproduce it any time anywhere for any movement.

To change the highness we have to increase the value the function return (-1, 1). To do that we will multiply the value in this way: "locator1.ty = sin(time) *2". Someone could say: why don't we add the new value? Because if you do that you'll change the highness of the locator position and not its movement, I mean the locator will move between "-1 and 1" from the highness of the value you add, in this case "2".


That quest let you understand that if you want the locator change its position you have to add the value. try: "locator1.ty = sin(time) + 2".

And now we will introduce the "variables".

Select the locator and add a new attribute, call it "variable" or something like that. Put the min value at "-10" and the max at "10", the default value at "1".

Create a new attribute it's not necessary but it will help us to be more linear in the exercises.
Now go to the expression editor and create the variable as follow (MAYA wants you to declare the variables before you use them, like C and C++):

float $var = locator1.variable;
locator1.ty = sin(time) *$var;

.




Continue Tutorial:  1 2 next page

Login to add a Bookmark 2 votes for an average rating of 3.50

Related Learning Tools
Maya Related DVDs



Digital Sets 4: Image- Based Terrain
Maya Related Books



Learning Autodesk Maya 2008: Foundation
Global DVDs



Creature Design with Aaron Sims Volume Two

Top Rated Maya Tutorials

1. Organising your downloaded scripts by Andrew Kerr (05/28/07)
2. Configuring jEdit with Maya by Ron Bublitz (05/16/07)
3. Skiing Cycle by Federico Cascinel (09/02/05)
4. dreamLipSync - Talk To Me by Federico Cascinel (09/02/05)
5. Loading scripts in Maya 101 by Andrew Kerr (05/28/07)


Related Tips


No Results to Display


More Tutorials by sdb1987

1. HUMAN INDIRECT SKINNING WITH FREE-FORM DEFORMERS I by Paul G. Thuriot (10/04/05)
2. Z-Depth in After Effects by Artboy.cc (09/19/05)
3. PaintFX Hair by Peter Pankras (09/19/05)
4. Seamless Modeling in Maya part1 - An Introduction by Michael Bazhutkin (09/06/05)
5. Character Setup for Real-Time in Maya 3.0 by Tim Naylor (09/25/05)






Sponsors

Sponsor

Contact Us | Advertise | Post Jobs | Post News | Post Events | Terms