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
First ... 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)
| 103589 Views
| 3 Comments
| Comments 3
Date Added: 7th May 2013
Software used:
Maya

Type the MELScript code into the Expression: field. Click Create to Compile and Save the expression (Fig.38).

If you have followed the tutorial correctly, you have finished. Play the animation and the gears should all by rotating and synced together.

1713_tid_fig38.png
Fig. 38

Error Checking

However, if you have made a typo in the MELScript and it produces an Error or incorrect results, you'll need to edit the expression. Open the Expression Editor (Fig.39).

1713_tid_fig39.png
Fig. 39

List the Expressions (Select Filter > By Expression Name). Then select gearRotation in the Selection listing (Fig.40).

1713_tid_fig40.png
Fig. 40


Finishing Touches

Up to now, the animation in this tutorial is very simple - gear01 rotates 10 times (3600°) over 20 seconds (500 frames).

Add some anticipation to the start and overlap to the end of the rotation for gear01 (Fig.41):

• Frame 1: Start Position: 0°
• Frame 25: Roll backwards to anticipate: -90°
• Frame 450: End of 10 rotations: 3600°
• Frame 500: Roll backwards to rest position: 3560°

1713_tid_fig41.png
Fig. 41

All Stop..!!

To help create the illusion of weight in the way the gears rotate, they should come to a complete start and stop at each key frame. Select gear_basic01, and in the Channel Box, select RotateX. Open the Graph Editor (Window > Animation Editors > Graph Editor).

Select all four keyframe markers (small black dots) and set the tangents to Flat Tangent. This will ensure the animation comes to a compete start and stop at each keyframe - indicating weight (Fig.42).

1713_tid_fig42.png
Fig. 42

Play the animation.

Door Driven

In the previous section of this tutorial, the gear01 was the driving force for the animation.
In the next section the project is reversed to make the door the driving force:

gear_basic05.rotateX= door.translateY/0.2618;
gear_basic04.rotateX= gear_basic05.rotateX*-3;
gear_basic03.rotateX= gear_basic04.rotateX*-1.5;
gear_basic02.rotateX= gear_basic03.rotateX*-4;
gear_basic01.rotateX= gear_basic02.rotateX*-2;

As explained previously, when gear05 is driving the door the translation of the door is calculated as:

door.translateY=gear05.rotateX*0.2618;

In Fig.43 the driver is reversed from [gear05 > door], to [door > gear05]. Therefore, the rotation of gear05 is calculated as door.translateY/0.2618;

The MELScript to rotate gear05 is:

gear_basic05.rotateX= door.translateY/0.2618;

1713_tid_fig43.png
Fig. 43

In Fig.44, cog30 is paired to cog10. When cog30 is rotated, cog10 will rotate at three times the speed.

This can be summarized as a ratio: cog30/cog10=3 (30/10=3). The MELScript to rotate gear04 by three times the rotation value of gear05, in the opposite direction is:

gear_basic04.rotateX= gear_basic05.rotateX*-3;

1713_tid_fig44.png
Fig. 44

In Fig.45, cog30 is paired to cog20. When cog30 is rotated, cog20 will rotate at 1.5 times the speed.
This can be summarized as a ratio: cog30/cog20=1.5 (30/20=1.5). The MELScript to rotate gear03 by 1.5 times the rotation value of gear04, in the opposite direction is:

gear_basic03.rotateX= gear_basic04.rotateX*-1.5;

1713_tid_fig45.png
Fig. 45

In Fig.46, cog40 is paired to cog10. When cog40 is rotated, cog10 will rotate at four times the speed. This can be summarized as a ratio: cog40/cog10=4 (40/10=4). The MELScript to rotate gear02 by four times the rotation value of gear03, in the opposite direction is:

gear_basic02.rotateX= gear_basic03.rotateX*-4;

1713_tid_fig46.png
Fig. 46

In Fig.47, cog20 is paired to cog10. When cog20 is rotated, cog10 will rotate at two times the speed. This can be summarized as a ratio: cog20/cog10=2 (20/10=2). The MELScript to rotate gear01 by 2 times the rotation value of gear02, in the opposite direction is:

gear_basic01.rotateX= gear_basic02.rotateX*-2;

1713_tid_fig47.png
Fig. 47

Good luck and enjoy.

1713_tid_zzz_chris_shaw.jpg




< previous page

 
First ... 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 4 Views 25941

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 14848

Tutorial

Gallery Image.



Keywords: pirate, modeling, 3ds max, making of

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star half
Comments 3 Views 41798

Tutorial

Gallery Image.



Keywords: Maya, Tutorial, Head, Model, Modeling, Mouth, Nose, Ear, Neck, Eyes, Face

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