Simple export script wanted.

I want a script that can export a mesh to the scene directory (fbx). The scene directory being the last saved or opened directory. or if no directory (new document) don't export.

The exported mesh gets its name from the mesh name. If more than one mesh is selected get the name from the last selected mesh. export all meshes as one fbx.

If a "singular mesh is selected" move to 0,0,0 export then move back. if more than one is selected export in world space.

I want this to be a keybindable action. (no menu)

The main function I'm looking for in the script is exporting to the scene directory.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
meteorkid's picture

simple export script

Hello this script has been super useful to me. Ive used it now a few years.

I'm looking for a slightly different version of this script. Instead of export to the max file directory. Could I have it export to a (static) path specified in the user defined properties (inside the object properties). Of whatever the last selected object is.

Thankyou Innocent

miauu's picture

...

The last object must be selected with a single mouse click. It must have User Defined Properti like this:

ExportPath=D:\FBX_Export_Folder

macroscript miauuCustomFBXExport
category:"miauu"
tooltip:"Custom FBX export"
buttonText:"Custom FBX export"
(	
	selObjsArr = selection as array
 
	if selObjsArr.count != 0 do
	(
		if (expPath = getUserProp selObjsArr[selObjsArr.count] "ExportPath") != undefined do
		(
			if doesDirectoryExist expPath do
			(
				if selObjsArr.count == 1 do selObjsArr[selObjsArr.count].pos = [0,0,0]
				exportFile (expPath + selObjsArr[selObjsArr.count].name + ".fbx") #noPrompt selectedOnly:true
			)
		)
	)
)
miauu's picture

.

Change the tooltip and the buttonText if you want. Save as mcr and drag and drop onto your 3ds max vierpots.

macroscript miauuCustomFBXExport
category:"miauu"
tooltip:"Custom FBX export"
buttonText:"Custom FBX export"
(
	selObjsArr = selection as array
	if selObjsArr.count != 0 and maxFilePath != "" do
	(
		fileName = (selObjsArr[selObjsArr.count]).name
 
		if selObjsArr.count == 1 do selObjsArr[selObjsArrw.count].pos = [0,0,0]
 
		exportFile (maxFilePath + fileName + ".fbx") #noPrompt selectedOnly:true
	)
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.