Make Marbel Texture..
Make variable colored grid..
Neon Text..
The micro bevel..
Rusted Type..
3D Text/Logo..
Techno-wave Effect..
Trendy Avatar..
Simple background..
Digital Effect..
Polar Coordinates..
Water drops..
LCD Screens..
Steel Type..
Pixelated Text..
Smooth Edges..
Vectorizing Photos..
Luminous Essence..
Transparency..
Digital Smoke..
Game cube logo..
Gradient Grids..
Sparkles..
Driping Slime..
Borders..
Cartoon Clouds..
Organic Tech..
Aqua Balls..
Kerning and Tracking text..
Getting rid of overlap..
Weaving a ribbon through text..
Blend layers w/ opacity mask..
Brilliant Color..
Create 3D Cylinder..
Creating Artistic Brushes..
Fine Lines Design..
Transition b/w two objects..
Distortion Effect..
Soft Proof your colors..
Knotworking..
Creating views..
Transforming shapes..
Creating Image map..
Optimizing web graphics..
Using Slice tool..
Creating web button..
Animation of scaling..
Ripple Animation..
Colors changes to animation..
Neon light animation..
Creating a Navigation bar..
Animated Imagemap Button..
Preloader with FlashMX..
Sound Control..
Steel Flash..
Using masks..
Loading an external movie..
Flash light effect..
Flash game techniques (P-1)..
Flash game techniques (P-2)..
Flash game techniques (P-3)..
Flash game techniques (P-4)..
Flash game techniques (P-5)..
Dropdown menu for FlashMX..
Zoom blur effect..
Dessolving words ..
Spotlight masking..
Passing variable to Flash..
Clear Text..
Create Time in Flash..
Change colors of movieclip..
Creating sites using CSS ..
Dreamweaver 4 Flash buttons..
Defining a site..
Dreamweaver Form tips..
Dreamweaver interface..
Creating nested tables..
Rollover form buttons..
Graphics Editing w/ DW & FW..
Inserting FW HTML into DW..
Working with templates..
Quick shapes in freehand..
Making a 3D pie-chart..
Exporting GIFs from Freehand..
Creating 3D Soccer Ball..
Creating Perspective shadows..
Chrome effect in Freehand..
Creating Hollow Envelopes..
Building Buttons..
Drawing a heart symbol..
3D Ball ..
Bouncing ball..
Automating Fireworks..
Text writing animation..
Fireworks 4 Popup menus..
Creating Gel Text..
Outline tool overview..
Cracked text..
Page curl ..
Contoured Text ..
Drop Shadows ..
Creating complex shapes..
Creating volumetric clouds..
Water/Fire/Smoke Effect ..
The Power of Radial array..
Modelling an Eye..
Welding vertices..
Animating a ball..
Realistic Texturing..
Polygon basics..
Lathe Tutorial ..
Emit geometry from a point emitter..
Creating a missile trail..
Animating a flying baloon..
Introduction to Expressions..
Making MEL Procedures..
Introduction to MEL Scripting..
Modeling a mechanical hand..
Build a spiral staircase..
Building leg skeletons..
Modeling a head..
Texturing the head..

How to make water ripple..
Create Ghost shader..
Using two bone IK Solver..
Using multi-texturing..

Introduction to Maya Expressions

 

 

Once you figure out the basics of expressions in Maya, you'll find yourself using them all the time, avoiding manual keyframing as much as possible. Expressions are, in my opinion, Maya's strongest feature. In order to explain the basic idea of using them, this tutorial will show how to create a very simple animation: a bug flapping its wings with a controllable speed attribute. The model is very sketchy, since it's not the focus of this tutorial.

 

 

 

Create three Nurbs spheres, and move and scale them so that you get a very rough representation of a body with a couple of wings. Name the wings "rWing" and "lWing", and name the body "bug" or whatever. Throw a basic texture on them if you wish.

 

 

  Move the pivot points of both wings so that they can rotate around the proper axis.


  Parent the wings to the main body so that they move with it.
 

Open the Expression Editor (Window > Animation Editors > Expression Editor...). You'll find it useful to assign a hotkey to that (ALT+e is unassigned by default and is a good choice).

On the left you'll see your currently selected object, and on the right the list of its keyable attributes.

Expression are typed into the bottom box. It's important to know that expressions do NOT relate to the currently selected object. You can write expressions for anything, another object, a shader, whatever you want. If have an object selected, though, it's easier to know the exact name of an attribute you want to control, since all keyable attributes at listed on the right.

 

 

Type "wingFlap" into the Expression Name box, and type the following into the Expression box at the bottom of the dialog box:

lWing.rotateX = time * 10;

Click "Create". This creates the expression.

The syntax is very simple: you type the object name (or, rather, the node name), followed by a period and the attribute you want to control. In this case, we want to control the X rotation of the left wing's transform node. The "time" attribute is a built-in value in Maya, which returns the current time of the animation in seconds. Its multiplied by ten so that the result is more immediately visible (the flapping is faster). The semicolon simply marks the end of every statement in Maya. Click "Play", and the you'll see the wing rotate as time goes by. Check the Hypergraph, and you'll see lWing controlled by the wingFlap expression. Also, in the Channel Box, lWing's rotateX attribute turns orange to show that it's controlled by something and that you can't change it directly.

 

 

The simplest way to create a back-and-forth motion is to use a sine function. Modify the expression so that it looks like this:

lWing.rotateX = sin (time * 10) * 40;

If the expression has disappeared from the Expression Editor, simply click Select Filter > By Expression Name and click on wingFlap.

The result of the sine function is multiplied by forty so that the motion describes a larger arc. Otherwise, the flapping goes back and both between two very small values.

Click "Edit". This button, which replaced the "Create" button, updates the expression to reflect the changes you've made. If you get the message "Error: Expression invalid after edit", check your syntax. If you play the animation after this error without correcting it, Maya evaluates the last valid expression that you entered.

 

 

  Play the animation. The wing flaps back and forth.
 

To get both wings to flap, copy and paste the expression into the line below, but change lWing to rWing, so that the whole expression now reads:

lWing.rotateX = sin (time * 10) * 40;
rWing.rotateX = sin (time * 10) * 40;

You'll see a motion which isn't at the cutting-edge of aerodynamics. This is because the X rotation of the opposite wing should be reversed.

 

 

 

Add a minus sign before the sine function of the right wing, to read:

lWing.rotateX = sin (time * 10) * 40;
rWing.rotateX = -sin (time * 10) * 40;

Play the animation. The bug now has more chances of survival.

 

 

Now suppose you want to control the wings' flapping speed. Currently, the speed is determined by the *10 part of the expression. Let's create an attribute for wing speed that would allow us to change the speed dynamically, and even keyframe it. In the Attribute Editor, select the bug's transform node (the one simply called "bug"), and choose Attributes > Add Attributes.

Type WingSpeed into the Attribute Name field, make sure Float is selected, and set 0 as Minimum value, 10 as Maximum and 5 as the Default value. Make sure that "Make Attribute Keyable" is checked (so that is shows up in the Channel Box), and click on OK.

The Add button allows you to add several attributes without closing the window every time.

 

  In the Extra Attributes folder of the bug's transform node, you now have a fresh new attribute called wingspeed, nicely displayed with a space (Wing Speed) because of the capital S. It's set at the default of 5, and doesn't do anything at the moment.
 

Back in the Expression Editor, change the 10 value to bug.WingSpeed in both lines. They should now read:

lWing.rotateX = sin (time * bug.WingSpeed) * 40;
rWing.rotateX = -sin (time * bug.WingSpeed) * 40;

Notice a couple of things: the capitalization (it's very important to type the attribute name exactly as you defined it) and the fact that we're controlling the wings via an attribute which belongs to the bug node, hence the bug.WingSpeed. Move the Wing Speed slider around and see how it affects the wings' motion.

 

   

Play around with this in order to get a feel for the almost infinite possibilities it offers. Try to control the size of the wing arc (currently 40) with another, new attribute. Also, you can attach the bug node to a turbulence field, and try to control the wing speed via, for example, the translateY attribute of the bug, so that its wings flap more quickly when it approach the ground. Bear in mind that you've still haven't set a single keyframe. Enjoy.

Please report any omissions, errors or steps that are hard to understand (use the Contact section).


Courtesy: Tal Zana (www.talino.org)

Partners

Flash Templates
Free Web Templates
FREE professional web templates
Website templates
Free Web Templates
Graphic Design
Tutorial Guide
Flash Templates

Flash Templates and Web Templates

 


Advertise | Submissions | Privacy Policy
All the contents and articles within this website are property of their respective authors and are submitted to us by them, we do not held any liability for the material including text and graphics submitted by them.
© Copyright Vecpix.com 2006-07. All rights reserved.