Hi all gifted freinds and foes!
Im playing arround and trying to get into the wonderful world of mel. Im trying out with this small script that makes a line out of selected particles.
I had a lot of problems with implemanting the selected particlegorup. It worked fine if i just told it to do it with particle shape 1 but i want it to do it with the selected particle object. I get a warning saying that
"// Error: line 18: Invalid flag: -at position particleShape1.pt[0] //"
I dont get it cause its exactly what the help files state as an example og the getParticleAttr command.
Heres the code:
string $part_name[]=ls -sl;
string $pn=$part_name[0];
string $part_name_shape[]=listRelatives -shapes $part\_name;//giver shapens navn
string $pns=$part_name_shape[0];
int $i;
float $x=0, $y=0, $z=0;// tre floats til positioner
curve -d 3 -p $x $y $z -k 0 -k 0 -k 0;//begynder en curve
string $curve_name[]=ls -sl;
$part_num=getAttr ($pns+".count");//faa fat i hvor mange partikler der er
for ($i=0;$i<=$part_num;$i++) //gennemg377 alle partikler
{
select particle1.pt[$i];
string $attr="-at position "+$pns+".pt["+$i+")";
float $position[]=getParticleAttr $attr ;//faa hver partikkels position
print $position;
$x=$position[0];
$y=$position[1];
$z=$position[2];
curve -os -a -p $x $y $z $curve_name;
};
Thanks a lot!