|
I am trying to learn maxscript to write a simple exported for my engine.
I started with the example I found in the SDK docs. It so happens it starts to do what I want, so yay team!
However, I get this error:
Error occurred in anonymous code block: filename.... blah blah line <last line>
Compile error: unexpected end of file
I barely know the syntax, so is it looking for some symbol to tell it I am done?
Here is my script
-- Take a snapshot of the selected mesh
tmesh = snapshotAsMesh selection[1]
-- open an output file to write to
out_file = createfile ((GetDir #export+"testmesh.dat")
-- write the number of vertices and faces
format "%,%\n" tmesh.numverts tmesh.numfaces to:out_file
-- write the vertex data for v = 1 to tmesh.num_verts do
(
format "%," (getVert tmesh v) to:out_file
)
format "\n" to:out_file
-- write the face data for f = 1 to tmesh.num_faces do
(
format "%," (getFace tmesh f) to:out_file )
close "testmesh.dat" delete tmesh
|
|
|
|
Ok, I got it.
I was missing a bracket. I guess the error messages just aren’t all that clear. It coulda told me “hey I am looking for a closing bracket and I hit the end of the file”
|
|
|
|
It doesn’t know that the bracket is missing since the file could have gone on for a hundred more
lines before the bracket. It just knows that the file isn’t valid at that point.
brekehan wrote:
> Ok, I got it.
>
> I was missing a bracket. I guess the error messages just aren’t all that clear. It coulda told me “hey I am looking for a closing bracket and I hit the end of the file”
> --
> Max 2010 Trial, Maya 6.0.1
> Vista Ultimate 64 SP1.
> NVidia 8800 Ultra (Driver 182.50).
> Core Duo E6600, 6Gb Ram, DX10 March 2009.
Paul Neale
PEN Productions Inc.
penproductions.ca / paulneale.com
Master Classes for Max, Mudbox and Composite
DotNet Tutorials
MX Driver Car and Trailer Rig On Sale!
|
|
|