Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / unexpected end of file
  RSS 2.0 ATOM  

unexpected end of file
Rate this thread
 
26493
 
Permlink of this thread  
avatar
  • Total Posts: 45
  • Joined: 17 July 2007 03:08 AM

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 1 to tmesh.num_verts do
(
   
format "%," (getVert tmesh v) to:out_file
)

format 
"\n" to:out_file

-- write the face data
for 1 to tmesh.num_faces do
(
   
format "%," (getFace tmesh fto:out_file
)

close "testmesh.dat"
delete tmesh


Replies: 0
avatar

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”



Replies: 0
avatar
  • pen
  • Posted: 01 May 2009 08:33 AM

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!

Replies: 0