Notifications
Clear all

[Closed] Vertex Normals & UV coordinates

Vertex Normals & UV coordinates

 I’m writing a simple animated mesh exporter for my game, and intact it’s almost done, but I seem to be having a break down in my understanding of Max Script syntax. I am using max 5.

 Here is my exporter

–take a mesh snapshot
tmesh = snapshotAsMesh selection[1]
–the output filename of the recorded data
out_name = ((GetDir #export)+”/testmesh.txt”)
–open a file to write to
out_file = createfile out_name
–get the vertex count
num_verts = tmesh.numverts
–get the face count
num_faces = tmesh.numfaces
format “%,%

” num_verts num_faces to:out_file

–Index buffer
for f = 1 to num_faces do
(
face = getFace tmesh f
format “%
” face to:out_file
)

–write the vertex buffers for all frames to file
for t = animationrange.start to
animationrange.end do
(
–Advance the frame
slidertime = t
–Label the frame
format “[Frame %” t to:out_file
format “]
” to:out_file
–take a new snapshot of the mesh
tmesh = snapshotAsMesh selection[1]
–loop through the vertex’s recording there location
for v = 1 to num_verts do
(
vert = getVert tmesh v
format “%
” vert to:out_file
–format “:%” getNormal tmesh v to:out_file – this dosnt work
–and i want uv data here
)
format “

” to:out_file
)

–save the file
close out_file

2 Replies

You should place function between brackets. ()

format ":%" (getNormal tmesh v) to:out_file

have a good day

Now that is a variation that never occurred to me. Thank you for responding, that did the trick.