Resolve MEL error..
01-28-2012, 04:07 PM
I am working on a script which stores the name and co-ordinates of all spheres in the scene in a Text file.
This is the script I have written:
float $x,$y,$z;
int $i;
string $filePath="D:\sphereCoordinates.txt";
layerEditorSelectObjects jSpheres;
string $jointSpheres[]=`ls -sl`;
$fileId=`fopen $filePath "a"`;
select -d;
for($obj in $jointSpheres)//$i=0; $i<28; $i++)
{
$x=`getAttr $obj.translateX `;
$y=`getAttr $obj.translateY`;
$z=`getAttr $obj.translateZ`;
fprint $fileId("sphere -n"+$obj+" -p " +$x +" "+ $y+" "+ $z+"\n");
fflush $fileId;
}
fclose $fileId;
However this script is not getting executed and error is: No object name matches '.translateX'
Please help.. Its an emergency..
Thanks..
|