>: CG Forums on 3dtotal - The best forums for CG artists :.
threedy forums home
 


Go Back   3DTotal Forums > Archives > Archives > Scripting & coding

Reply
 
Thread Tools Display Modes
Old 03-04-2008, 11:36 AM   #1
poopipe
conscientious objector
 
poopipe's Avatar
 
 
Join Date: Sep 2007
Location: cambridge, uk
Posts: 4,313
Thanks: 3
Thanked 130 Times in 124 Posts
Awards Showcase
Threedy Top Poster - Gold: Contributing to the forums with 2,000+ posts - Issue reason: too much free time Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: he finished The Golden Grenade III: For participating in the Dominance War III and successfully finishing, well done soldier! - Issue reason: I finished Dominance War 3 Thumbs up!:  - Issue reason:  Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! 
Total Awards: 9
maxscript v7 : detecting whether a file is from newer version of max

Hello,

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?
poopipe is offline   Reply With Quote
Old 03-04-2008, 04:23 PM   #2
Mr. Bluesummers-3DT
Supplies Coordinator
 
Mr. Bluesummers-3DT's Avatar
 
Join Date: Oct 2004
Location: United States
Posts: 3,323
Thanks: 0
Thanked 11 Times in 8 Posts
Awards Showcase
Threedy Top Poster - Gold: Contributing to the forums with 2,000+ posts - Issue reason: Target reached! Threedy Top Poster - Silver: Contributing to the forums with 1,000+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: The particles tutorial got plugged along the top bar. Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Speed Modelling - Gold: Winner of a speed modelling challenge! - Issue reason: Winner of a speed modelling challenge! 
Total Awards: 8
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
__________________
Be sure to check out my blog because there's tons of useful resources there:
Mr. Bluesummers-3DT is offline   Reply With Quote
Old 03-04-2008, 05:16 PM   #3
poopipe
conscientious objector
 
poopipe's Avatar
 
 
Join Date: Sep 2007
Location: cambridge, uk
Posts: 4,313
Thanks: 3
Thanked 130 Times in 124 Posts
Awards Showcase
Threedy Top Poster - Gold: Contributing to the forums with 2,000+ posts - Issue reason: too much free time Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: he finished The Golden Grenade III: For participating in the Dominance War III and successfully finishing, well done soldier! - Issue reason: I finished Dominance War 3 Thumbs up!:  - Issue reason:  Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! 
Total Awards: 9
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.
poopipe is offline   Reply With Quote
Old 03-04-2008, 06:40 PM   #4
Mr. Bluesummers-3DT
Supplies Coordinator
 
Mr. Bluesummers-3DT's Avatar
 
Join Date: Oct 2004
Location: United States
Posts: 3,323
Thanks: 0
Thanked 11 Times in 8 Posts
Awards Showcase
Threedy Top Poster - Gold: Contributing to the forums with 2,000+ posts - Issue reason: Target reached! Threedy Top Poster - Silver: Contributing to the forums with 1,000+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: The particles tutorial got plugged along the top bar. Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Speed Modelling - Gold: Winner of a speed modelling challenge! - Issue reason: Winner of a speed modelling challenge! 
Total Awards: 8
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?
__________________
Be sure to check out my blog because there's tons of useful resources there:
Mr. Bluesummers-3DT is offline   Reply With Quote
Old 04-04-2008, 02:52 PM   #5
poopipe
conscientious objector
 
poopipe's Avatar
 
 
Join Date: Sep 2007
Location: cambridge, uk
Posts: 4,313
Thanks: 3
Thanked 130 Times in 124 Posts
Awards Showcase
Threedy Top Poster - Gold: Contributing to the forums with 2,000+ posts - Issue reason: too much free time Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! Threedy Top Poster - Bronze: Contributing to the forums with 100+ posts - Issue reason: Target reached! The Golden Eye: Producing art worthy of being linked from the frontpage of either forums or 3DTotal.com - Issue reason: he finished The Golden Grenade III: For participating in the Dominance War III and successfully finishing, well done soldier! - Issue reason: I finished Dominance War 3 Thumbs up!:  - Issue reason:  Thumbs up!:  - Issue reason: For doing a great job in helping out! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! Low Poly Game Art - Gold: Winner of a low poly challenge! - Issue reason: For Excellence at Low Poly Art - Well Done! 
Total Awards: 9
that probably would work.


very sneaky indeed - you should be ashamed
poopipe is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
all images displayed on this site are copyright the original artists and may not be reproduced, copied or published elsewhere without their express permission