A procedure is a series of instructions that are separate from the main flow of the script. Procedures allow you to reuse certain portions of a script for new applications.
In this section, you use a procedure that is included with Maya (makeroll, which simulates an object rolling on a plane). Later in the lesson, you link this procedure to a user interface to provide an easier way to use the procedure.
To execute the makeRoll procedure
polyCube -name roll_Cube; polyPlane -height 10 -width 10;
makeRoll roll_Cube 0 1 1.0;
The makeRoll procedure requires the following arguments: the name of the object to act on, the height of the ground plane, the type of simulation, and the diameter of the object. The type of simulation is either box or sphere simulation. Rolling simulation is determined using a bounding sphere when simulation type is set to 0, or a bounding box when simulation type is set to 1.
The expressions set up by the makeRoll procedure only take effect when the frame is greater than one.
You have successfully loaded and used the makeRoll procedure. Now, you’ll link the procedure to a user interface.