ScriptSpot

Forum topic · General Scripting

Decimal places as needed

By tx00824 · 2012-02-01

Description

I read a vertex normal of a face in maxscript and it returns an array of 3 arrays like this:

#([0,-1,0], [0,-1,0], [0,-1,0])

this is ok but when I extract single numbers from each array and send it to output (just like below, example for one number only):

for i = 1 to theMesh.numfaces do ( vertexNormal = meshop.getfaceRnormals theMesh i format "%,%,%,%,%,%,%,%,%," vertexNormal[1].x vertexNormal[1].y vertexNormal[1].z vertexNormal[2].x vertexNormal[2].y vertexNormal[2].z vertexNormal[3].x vertexNormal[3].y vertexNormal[3].z to:outFile

I am getting the right numbers but all of them have decimal places like for example “0” is “0.0” and I want to shrink the file size as much as possible so where not needed I want maxscript not to put this unnecessary data:

0.0,-1.0,0.0,<br>0.0,-1.0,0.0,<br>0.0,-1.0,0.0

How do I do it?

Comments (1)

solved

Anubis · 2012-02-01

see my reply in your thread at Area forum