MEL Lab 1
-
-
- These exercises require writing MEL scripts in the Script
Editor:
-
-
- (1) Write a MEL script that draws 5 evenly-spaced spheres
along the x-axis. Don't use a loop. Just write 5 separate statements.
-
- (2) Write a MEL script that draws 5 evenly-spaced cones along
the x-axis instead.
-
- (3) Copy and paste the following MEL script into your script
editor and execute it:
-
- int $i, $j, $k;
-
-
- for ($j = -100; $j <= 100; $j +=
10) {
- for ($i = -100; $i <= 100; $i +=
10) {
- $k = rand( 0., 1. ) + 0.5;
- if ($k == 0) sphere -n ball; else cone
-n cone;
- move $i $j 0;
- }
- }
Only using the Script Editor and MEL commands, find out how many
balls and cones are in this scene.
-
- (4) Write a MEL script that draws 5 evenly-spaced objects
along the x-axis, where each object is randomly chosen to be
either a sphere or a cone.
-
- (4a) Using MEL, find out the names of your cones and spheres.
Edit three of your objects and make them invisible.
-
- Note: None of these exercises require writing loops.