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 / Max 2012 MAXScript Editor break
  RSS 2.0 ATOM  

Max 2012 MAXScript Editor break
Rate this thread
 
56063
 
Permlink of this thread  
avatar
  • Location: Columbus, Ohio
  • Total Posts: 434
  • Joined: 01 March 2008 04:43 AM

I’ve got a problem I’ve never seen.

I’m writing a MS to recursively iterate through folders to parse a certain kind of text file. Standard stuff. My script has some kind of logic error that is throwing an exception… probably something unrelated to the break.

The problem is that as soon as the exception happens, MAXScript editor will not let me save any files. Not the script that is in the editor. Not a following script I open. Not even a brand new dummy script that I made just to see if I can add a new script.

Just in case the problem is related to a specific Max function, here’s the error in the listener:

>> MAXScript Rollout Handler Exception:
-- No “"eof"” function for undefined <<

It may be that some uncaught exception with openFile() is causing this (my script may be running openFile on something that doesn’t have permission to read, etc).

So far, when it happens, I have to close Max entirely and restart to fix. So it is 1) making it hard to debug (well I’m about to wrap EVERYTHING in a try...catch to alleviate that) and 2) making me wonder if there is another bug in 2012 MAXScript.



______________________________
Shawn Olson’s Creative Arts
Developer of the Wall Worm Model Tools for Source
And my Favorite Unsung Plugin: Convexity for Level Design

Max 4/Gmax, 2008 - 2013
Mudbox 2009-2011
Win 7 x64 (x4)
Geforce 480x2 | Geforce 275x1 | ATI Radeon HD 3200 | Intel Generic chip
8GB | 12GB | 4GB | 4GB
Intel Quad 6700 | i7 930 | Athlon QL-65 | Intel Quad 6700

Attachment Attachment
Replies: 0
avatar

Well I think I know what causes the error. It was certainly bad coding but I’m not sure it should actually crash the MAXScript editor’s ability to save files (you know--so you can actually fix the file and save it! :) ) Bug?

I believe it was because I did a recursive search through hundreds of text files using openFile() but neglected to add a close() inside the loop (before going to the next openFile() ).

So if you have this problem, you might see if you’ve added close() .



______________________________
Shawn Olson’s Creative Arts
Developer of the Wall Worm Model Tools for Source
And my Favorite Unsung Plugin: Convexity for Level Design

Max 4/Gmax, 2008 - 2013
Mudbox 2009-2011
Win 7 x64 (x4)
Geforce 480x2 | Geforce 275x1 | ATI Radeon HD 3200 | Intel Generic chip
8GB | 12GB | 4GB | 4GB
Intel Quad 6700 | i7 930 | Athlon QL-65 | Intel Quad 6700

Replies: 0
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

The specific error is because the file wasn’t opened, returning “undefined” - passing an “undefined” value to many functions (not just file operations) will give that kind of error.

Make sure you test for “undefined” immediately after the open, and make sure you only perform any operations on that file if the open worked.

Why it locked up the editor I’m not sure, I’ve had the Listener do strange things like that, but not the Editor.

[edit] And don’t use try..catch if you can avoid it - it’s horribly slow [/edit]
[edit2] Ahh - programmer error :D Windows does have limits on how many files can be open at any one time. You’ll rarely, if ever, hit that limit under normal circumstances. [/edit2]



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 2
/img/forum/dark/default_avatar.png

As always, thanks for the input Steve. I can foresee there being a larger-than-life statue of you for my great-grandkids to see :)

Author: Shawn Olson

Replied: 21 May 2011 05:36 AM  
/img/forum/dark/default_avatar.png

Make sure you get my good side (the back...) :D

Author: Steve_Curley

Replied: 21 May 2011 07:37 AM