This is a code for printing the name and co-ordinates of all the spheres in the scene in a file
however its not getting executed and the error is:
“Cannot convert data of type float[] to type float.” :banghead: :banghead: :banghead:
Is getAttr returning a float array??
if yes then how can I convert it into float??
Any other logics to implement this will be more than welcome…
float $x,$y,$z;
int $i;
string $filePath=“D:\sphereCoordinates.txt”;
layerEditorSelectObjects jSpheres;
string $jointSpheres[]=ls -sl;
$fileId=fopen $filePath "w";
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+”
");
}
fclose $fileId;
I need a solution ASAP…
its an emergency…

