Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Modeling, Scripting and Animating Gears

By Chris Shaw
| Your Rating:
rating star fullrating star fullrating star fullrating star fullrating star full
(41 Votes)
| 98059 Views
| 3 Comments
| Comments 3
Date Added: 7th May 2013
Software used:
Maya

You're now ready to start animating.

Animating the Gears

The objective of this tutorial is to create a simple Gear system that is simple to animate and easily modified. It would be far too tedious and time consuming to keyframe the rotation of gear01 - gear05 + TranslateY of door. It would be even more tedious to modify it several times if your supervisor required it.

For that reason, we'll create a system that only requires the animator (you) to animate gear01.
Select gear01 and create the following 2 keyframes (Fig.30).

1713_tid_fig30.png
Fig. 30

Play the animation and check that gear01 rotates 10 times.

Creating the MELScript

MELScript is the programming language used in Maya. An expression is a MELScript that runs every frame and allows you to create animation.

The next step is to write a MELScript that calculates the rotation value for each gear (gear[2] - gear[5]). We'll start by creating and explaining the MELScript first, and then show you how to use the Expression Editor later in the tutorial.

MELScript for gear02

In Fig.31, cog10 is paired to cog20. When cog10 is rotated, cog20 will rotate at 1/2 the speed.

1713_tid_fig31.png
Fig. 31


This can be summarized as a ratio: cog10/cog20=0.5 (10/20=0.5). The MELScript to rotate gear02 by 1/2 the rotation value of gear01, in the opposite direction is:

gear02.rotateX=gear01.rotateX*-0.5;

MELScript for gear03

In Fig.32, cog10 is paired to cog40. When cog10 is rotated, cog40 will rotate at 1/4 the speed.

1713_tid_fig32.png
Fig. 32

This can be summarized as a ratio: cog10/cog40=0.25 (10/40=0.25). The MELScript to rotate gear03 by 1/4 the rotation value of gear02, in the opposite direction is:

gear03.rotateX=gear02.rotateX*-0.25;

MELScript for gear04

In Fig.33, cog20 is paired to cog30. When cog20 is rotated, cog30 will rotate at 2/3 the speed.

1713_tid_fig33.png
Fig. 33

This can be summarized as a ratio: cog20/cog30=0.66 (20/30=0.66). The MELScript to rotate gear04 by 2/3 the rotation value of gear03, in the opposite direction is:

gear04.rotateX=gear03.rotateX*-0.66;

MELScript for gear05

In Fig.34, cog10 is paired to cog30. When cog10 is rotated, cog30 will rotate at 1/3 the speed.

1713_tid_fig34.png
Fig. 34





< previous page next page >

 
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Related Tutorials

Tutorial

Gallery Image.



Keywords: Modeling, clothes, Marvelous Designer

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (21)
Comments 3 Views 22093

Tutorial

Gallery Image.



Keywords: Animation, Rigging, Transformer, Decepticon, Modeling, Lighting

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 14183

Tutorial

Gallery Image.



Keywords: Maya, Rigging, Modeling, Character, Male, Animation, Tutorial

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 68034

Tutorial

Gallery Image.



Keywords: fingers, hands, maya, feet, tutorial, modeling,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 0 Views 36818
Readers Comments (Newest on Top)
no comments!
No comments yet. Be the first to comment!
Add Your Comment