Random walk keyframed blocks in MEL

February 4th, 2009

I’m starting a project, and I thought I’d do it in the window of my little shop, here on this sidestreet of the Internet. That way everyone wandering by can peek in, gaze upon the array of parts strewn all over my workbench, and wonder what I’m up to.

MEL code follows:

proc doit(string $u) {
  vector $s = sphrand(1);
  xform -r -t ($s.x) ($s.y) ($s.z) $u;
}

select `polyCube -h 1 -n "pCube1"`;

for ($i=0; $i<500; ++$i) {
  $sel = `ls -sl`;
  select -cl;
  select `instance $sel`;
  $new = `ls -sl`;
  setKeyframe -attribute "visibility" -v 0 -t 0 $new; 
  setKeyframe -attribute "visibility" -v 1 -t $i $new;
  doit($new[0]);
}
« previously: La Mare aux TĂȘtards | Home | next: Random walk pyramids »