|
string $exp = "";
string $obj[];
for($i = 0; $i < 3; $i++)
{
$obj = `sphere`;
move (rand(-3,3)) (rand(-3,3)) (rand(-3,3));
$exp += "select -r " + $obj[0] + ";\n" +
"move -moveY (rand(0,2));\n";
}
$exp += "select -clear;\n";
expression -s $exp -ae 1;
playbackOptions -min 1 -max 30;
play;
|
Declare an empty string that will store the entire expression.
Declare a string array for the names of a sphere transform
and shape nodes.
Create three spheres and add the (expression) text that
references each sphere.
The move statements on this line merely separates each of the
spheres. The expression randomly moves each sphere in Y.
This line is optional, but its sometimes useful to ensure that
no object remains selected after the expression has been run.
Add the expression to the scene graph.
Setup a short animation.
Begin looping the animation.
|