Replace all .Max files with .Fbx in my project - Tip/trick/fix?

So basically we have a “finished” project with a lot of .Max files (Working from windows).
I used to copy the entire project to the mac. But for our subversion tool we want to exclude the library folder to reduce file size on our backup server.

And since OSX can’t import .Max files i have a problem :-).

Is there a way to replace/convert all the .Max files to .Fbx automatically? (or is that just a dream)

What we have done to only have .fbx files in the project, is not to actually have the .max files elsewhere, but to have the extension of them not being recognized by unity. So we have two maxScript functions. One will save the file as .max2011 (which is the max version we use), and one will save a .fbx in the same directory. These two could obviously be one function, but that is just not how we did it. And so we have max file in the project, but unity won’t try to import them. It works perfectly for us. But it can’t convert an entire project automatically. Each file has to be opened, and re-saved (and the old .max file would therefore still be present, and every reference to meshes would have to be remapped to the .fbx file) If you want them, the scripts, you can have them.

EDIT: Here they are:

Save with extension that won’t be recognized:

macroScript Save_max2011
	category:"Save Tools"
	toolTip:"Save as 3ds max 2011 file with .max2011 extension"
	buttonText:"Save_max2011"
	icon:#("Containers", 13)
(
	if (maxFileName == "") then
	(
		strNewFileName = getSaveFileName caption:"Save File As Max 2011:" filename:"Untitled.max2011" types:"Max 2011(*.max2011)|*.max2011|Max(*.max)|*.max|All(*.*)|*.*"
		if (strNewFileName != undefined) then
		(
			printBuffer = "Successfully saved file as " + strNewFileName
			print printBuffer
			saveMaxFile strNewFileName clearNeedSaveFlag:true saveAsVersion:2011 useNewFile:true quiet:false
		)
	)
	else
	(
		strCompleteFilePath = (maxFilePath + maxFileName)
		printBuffer = "Successfully saved file as " + maxFileName
		print printBuffer
		saveMaxFile strCompleteFilePath clearNeedSaveFlag:true saveAsVersion:2011 useNewFile:true quiet:false
	)
)

Save as .fbx in same directory:

macroScript FBX_Export
	category:"Save Tools"
	toolTip:"Exports selected objects to an FBX in same the folder"
	buttonText:"FBX_Export"
	icon:#("Containers", 6)
(
	strSrcName = maxFileName
	
	rgx = dotNetClass "System.Text.RegularExpressions.RegEx"

	strPattern = "\w+$"

	arrMatch = rgx.match strSrcName strPattern
	strFileLastName = arrMatch.value

	strNewFileName = trimright strSrcName strFileLastName + "fbx"
	
	
	strCompleteFilePath = (maxFilePath + strNewFileName)
	print ("Successfully exported selection to " + strNewFileName)
	
	exportFile strCompleteFilePath #noPrompt selectedOnly:true
)

That sounds like a nice solution! I guess i have to manually re-assign the references.
Would be lovely if you could share the functions, thanks in advance.

Do you set the .max files “hidden” to keep them from importing?

Edit: Thanks, i will try it ASAP.

Nope, not as hidden. They won’t import because of the extension alone. It is a messy solution, but it works fine for us.

So the FBX export in the same folder seems to be working (very nice).

However unity still imports the .max file as the file is still being saved as .Max
Iam not a programmer, so importing/using scripts in 3dsMax is as far as my knowledge goes. Am i missing something?

The two scripts is imported the same into max, and if you have the one working, I have no idea why the other doesn’t. I’m not the author of these scripts, and I will try to speak to the guy who made them :slight_smile: All I can say is it works perfectly on my end…

EDIT: It seems when I read it myself, that it will only save with the new extension, if it isn’t already saved. I will try and get it working with existing files, though I probably have to get the solution from the original author.

I think i got it working now. I changed the extension from .max to .max2011 manually and now the save works aswell : )

Thanks again.