View Full Version : maxscript v7 : detecting whether a file is from newer version of max

03-04-2008, 12:36 PM

I've got me a maxscript that opens a shed load of max files and exports them to our internal model format - this all works fine.

The problem is that I have to run this script on max7/8/9/2008 and the max files it opens were created on a variety of max versions (7/8/9 )

I need to detect whether the max file I'm currently opening is from a later version or not so I can ignore it. Currently, when it comes across one of these an empty scene is created and results in me being prompted to save on export (this is a "feature" of the exporter rather than being a max thing)

so yeah - can we tell if a file that's being opened is from a later version of Max through max script?

Mr. Bluesummers-3DT
03-04-2008, 05:23 PM
By my experience, the only thing Max can know is if the current file "Is_Older_Than_This_Version" kind of thing, and even that would take some convoluted code to check.

I'm really unsure how you could check a file version specifically. I'll post if anything turns up.

P.S. You could always use merge instead of open, squelch all errors or dialogs, and bring in all the content into the version of Max you're running. It wouldn't have the filtering you need, but it should let you run the process on everything. :P

03-04-2008, 06:16 PM
Because the exporter demands the scene is saved before export merging files in wouldn't save me - after each merge the scene would be modified so I'd be asked to save the max file each time.

I didn't write the bulk of the script so I don't really know what it's doing - I guess I can just check the scene after loading to see if it's empty and skip the export if it is ,it just seems a bit hacky.

Mr. Bluesummers-3DT
03-04-2008, 07:40 PM
Hacky is the name of the game, my friend! If that works, go for it- seems like a pretty straightforward solution. =)

Hmm...I bet you could squelch the requirement by simply saving the document under some script-generated name [Merge, Save as "Scene 001", (Batch process), Reset, Merge, Save as "Scene 002", (Batch process), ...].

Think that would do it?

04-04-2008, 03:52 PM
that probably would work.

very sneaky indeed - you should be ashamed :D