Hi all,
I'm new to MEL, working on a motion capture project at my school. I am enjoying it and finding my c background helpful. Here's my problem -- I'm working on a script which takes an array of random points and plots straight curves between them. the next iteration takes the midpoint of these lines and draws lines between them, etc etc. What I need to be able to do is set keyframes for each iteration of lines so that this process occurse over time. I would like to make the first group of lines fade out, then the second group of lines, and so on. Right now, I can create tons of lines, but they all start on frame 1. The problem is that I'm not really sure how to dynamically name the objects (ie "line1" , "line2") so that referencing them would work for setting keyframes. Here's the code fragment so far:
matrix $b[20][3];
for ($i = 0; $i < 20; $i++){
for ($j = 0; $j < 3; $j++){
$b[$i][$j] = rand(100);
}
if ($i > 0 && $i < 19){
curve -d 1 -p ($b[$i][0]) ($b[$i][1]) ($b[$i][2]) -p ($b[$i-1][0])
($b[$i-1][1]) ($b[$i-1][2]);
}
}
for ($z = 0; $z < 100; $z++){
//setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 1;
matrix $c[20][3];
for ($i = 0; $i < 20; $i++){
if ($i < 19){
for ($j = 0; $j < 3; $j++){
$c[$i][$j] = (($b[$i+1][$j] + $b[$i][$j])/2);
}
} else {
for ($j = 0; $j < 3; $j++){
$c[$i][$j] = (($b[0][0] + $b[$i][$j])/2);
}
}
if ($i > 0 && $i < 19){
curve -d 1 -p ($c[$i][0]) ($c[$i][1]) ($c[$i][2]) -p ($c[$i-1][0])
($c[$i-1][1]) ($c[$i-1][2]);
}
}
$b = $c;
};