3ds Max Batch 3D Converter


    Recently I faced the task of converting the nth number of 3D models from Autodesk Collada (* .DAE) to OBJ and vice versa. A search among batch converters did not lead to anything, although many have an extensive list of supported formats, they do not necessarily know any of the above.

    Since the mountain does not go to Mohammed, Then I decided to take advantage of the 3ds Max'a opportunity to write custom scripts in MAXScript , which would implement the plan. Fortunately, this powerful 3D modeling tool supports most common formats, including the ones I need.

    Having studied the MAXScript documentation a bit , this script was implemented. You can download this link(the archive also contains installation instructions).

    The key function fits 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 source models (Input Directory)
    - specify the folder into which the converted models will be folded (Output Directory)
    - specify the format in which we want to convert the models (without a dot)
    - optionally add the converted models to the file names prefix and / or postfix
    (subfolders are not processed)

    The result is a relatively universal 3D converter that supports all the variety of formats understood by 3ds Max. Of the minuses, I can highlight the need for the installed 3ds Max.

    ps I completely admit that I invented a bicycle, if so, please poke my nose in kamment

    Also popular now: