ScriptSpot

Forum topic · General Scripting

Batch Export .MAX files to Open Collada .DAE

By unsuns06 · 2012-08-07

Description

Hello everyone !

I need to batch export a lot of MAX files included in many folders (about 100 folders !) to OpenCollada DAE format, and save them into the same folders.

I tried some "batch export" MAXScripts, especially Batch It Max but none does what I want :(.

MASS Batch EXPORTER (http://www.scriptspot.com/3ds-max/scripts/mass-file-exporter) seems to fit the best, but I still can't make what I want.

MY Objective is just to select the folders and the script does it all on his own.

Can someone help me please ? Thank you all

Comments (19)

unsuns06 · 2012-08-08

This problem is solved fajar thanks to Graph's amazing tool, now take a look to my last post :).

Here is my problem :

unsuns06 · 2012-08-07

I get these messages when I open some max scenes :

http://img543.imageshack.us/img543/3817/message4.jpg
http://img13.imageshack.us/img13/8212/message5f.jpg

As you can see the paths he needs are quite complicated, I can definitely NOT do it for so many files, that are very different from each other :).

The trick is that the .jpg texture and map files have the RIGHT name !

I would like to be able to batch relink automatically these files and set them of course once for all !

I want just to select the MAIN folder containing all the files and the tool diggs and finds up the right files on his own.

Thank you mate !

unsuns06 · 2012-08-07

Relink Bitmap doesn't really make what I need :s

Graph · 2012-08-07

no need for the previous version, i uploaded the next one :P

You're right, this one works !!

unsuns06 · 2012-08-07

You're right, this one works perfectly !

Thank You So much again !

PS: Should I make a new thread to solve my Texture and Maps Filepaths problems ? Or should I continue on this thread ?(Relink Bitmap doesn't really make what I need).

I think

unsuns06 · 2012-08-07

You should just restore the previous version and simply add a "setVRaySilentMode()" line at the top.

I tried it, it works !

Could you reup the first version please ? I have lost it :s

Thank you

Graph · 2012-08-07

to fix 1 there are so many tools out there

and problem 2 should be fixed with the new version

Great !

unsuns06 · 2012-08-07

For problem 1 can you show me one that I can use ? Eventually works with Batch It Max?

Fot problem 2 you can fix it with just a setVRaySilentMode() line I believe.

It Works like a Charm... :) but I still have some Problems:

unsuns06 · 2012-08-07

Hi !
First of all thank you for your quick and efficient help, you're definitely an Expert ! ;)

1- For some (many) files, I have "Missing textures" message, even though the Texture and Map files have the correct names, 3DSMax doesn't load them as the filePaths are saved from other computers.

=> Is it possible to make a tool that also digs around the model files to find the textures and maps folder (and files) himself, without asking me to browse it for each file.

2- Then for some other files, I have 2 Vray version messages that pop up :
http://img7.imageshack.us/img7/9532/message1p.jpg
http://img18.imageshack.us/img18/3227/message2ni.jpg

=> So I have to hit OK and YES for every file.

Thank you again Boss !

Graph · 2012-08-07

so multiple source paths that are all gonna be deepSearched and the files collected, then exported in a selected output format using a selected plugin?!

Graph · 2012-08-07

so you want to give it a root folder and want the tool to dig through the folders, collect the files and continue it's way down the rabbithole and then convert/export the collected maxScenes to dae format?

Yes, But

unsuns06 · 2012-08-07

I just want to be able to select many folders instead of 1 Only like it's actually in the script, then I want OPEN COLLADA DAE format, which is different from the 'classic" Dae from autodesk.

Also, I want to set Destination Paths to be the Source Paths.
Thank you !

Here is the MASS Batch EXPORTER script code.

unsuns06 · 2012-08-07

/*
Maxscript to Batch Export Files to selected Format
Author :Preeth.P.G
Created on 19.04.2011
*/
global SourceDirectoryName_STR = "";
Global DestinationPath_STR = "";
rollout ExportASE "Export MAX Files"
(
group "Select Source and Destination Path"
(
label lbl1 "Select File Types :" align: #left
dropdownlist FileTypes_List items:#("ase", "fbx", "3ds", "obj") width:70 pos:[145,20]

edittext SourcePath "Source Max Files Path :" text: "" fieldWidth:270 align:#right pos:[15,50] readOnly:true
button SourceButton "Browse" align:#left width:60 height:20 pos:[430,50]
edittext DestinationPath "Destination Render Path :" text: "" fieldWidth:270 align:#right pos:[15,80] readOnly:true
button DestinationButton "Browse" align:#left width:60 height:20 pos:[430,80]
)
group "Generate ScreenShots"
(
button Export_BUT "BATCH Export Files" width:470 height:30
)
on SourceButton pressed do
(
SourcePath_Var=getSavePath caption:"Please select the source MAX files folder";
Global SourceDirectoryName_STR = SourcePath_Var as string
SourcePath.text = SourceDirectoryName_STR
)
on DestinationButton pressed do
(
DestinationPath_Var=getSavePath caption:"Please select the target Export folder";
Global DestinationPath_STR = DestinationPath_Var as string
DestinationPath.text = DestinationPath_STR
)
on Export_BUT pressed do
(
try
(
if SourcePath.text != "" then
(
if DestinationPath.text != "" then
(
MaxFilesinFolder_Var = SourcePath.text + "/*.max";
maxFileList = getFiles MaxFilesinFolder_Var
FileFormatSelected = FileTypes_List.selected
for i = 1 to maxFileList.count do
(

loadMaxFile maxFileList[i] useFileUnits:true quiet:true
MaxFileName_VAR = getFilenameFile maxFileList[i]

destinationFile = DestinationPath_STR + "\\" + MaxFileName_VAR + "." + FileFormatSelected
if i == 1 then
(
exportfile (destinationFile)
)
else
(
exportfile (destinationFile) #noPrompt
)
-----------------------------------------------------------------------------------------------------------------
)
)
else( messageBox "Please select a valid Destination path")
)else (messageBox "Please select a valid Source path")
---------------------------------------------------------------------------------------------------------------------------------------
-- Resetting the script Window
SourcePath.text = ""
DestinationPath.text = ""
---------------------------------------------------------------------------------------------------------------------------------------
)catch( messageBox "Unknown Error. Please try Again")
)
)
createDialog ExportASE width:500 height:170