
I recently got the task to convert the n-th number of 3D models from Autodesk Collada (* .DAE) to OBJ and back. A search among batch converters did not lead to anything, although many have an extensive list of supported formats, they don’t know any of the above mentioned ones.
Since the mountain does not go to Mahomet Then I decided to use the 3ds Max opportunity to write custom scripts in
MAXScript , which would have realized my plans. The benefit of this powerful tool for 3D modeling supports most common formats, including the ones I need.
After learning a little about the MAXScript
documentation , this script was implemented. You can download
this link (in the archive also installation instructions).
The key function fit in a small number of lines:
fn DoExport inputpath outputpath ext pfxb pfxa = ( if (inputpath != undefined and outputpath != undefined) do ( if (pfxb != "") then Prefix1 = pfxb else Prefix1 = "" if (pfxa != "") then Prefix2 = pfxa else Prefix2 = "" files = getFiles ( (replaceChar (inputpath as string) "\\" "\\\\") + "\\*.*" ) for f in files do ( resetMaxFile #noPrompt importFile f #noPrompt max views redraw exportName = outputPath + "\\" + Prefix1 + getFilenameFile f + Prefix2 + "." + ext exportfile exportName #noPrompt selectedOnly:TRUE ) --end for ) --end if ) --end fn
')

The interface is extremely simple:
- specify the folder with the original models (Input Directory)
- specify the folder in which the converted models will be added (Output Directory)
- specify in what format we want to convert the model (without a dot)
- Optionally, you can add a prefix and / or postfix to the file names of the converted models
(subfolders are not processed)
The result was a relatively versatile 3D converter that supports all the variety of formats understood by 3ds Max. From the minuses I can single out the need for the installed 3ds Max.
ps I fully admit that I invented the bicycle, if so, I ask you to stick your nose in the camments