Skip to content

Instantly share code, notes, and snippets.

@gonchar
Created June 9, 2019 18:09
Show Gist options
  • Save gonchar/eb8a5e6187710258ee66d90855f78752 to your computer and use it in GitHub Desktop.
Save gonchar/eb8a5e6187710258ee66d90855f78752 to your computer and use it in GitHub Desktop.
3dsmax export fbx
import MaxPlus
import os
import os.path
import pymxs
rt = pymxs.runtime
def convertAllToMeshes(n, indent=''):
objName = n.GetActualINode().Name
if "Line" in objName:
n.Convert(MaxPlus.ClassIds.PolyMeshObject)
for c in n.Children:
convertAllToMeshes(c, indent + '--')
convertAllToMeshes(MaxPlus.Core.GetRootNode())
folder = "PATH_TO_DIR"
fm = MaxPlus.FileManager
for dirpath, dirnames, filenames in os.walk(folder):
for filename in [f for f in filenames if f.endswith(".max")]:
fullPath = os.path.join(dirpath, filename)
fullPathFBX = os.path.join(dirpath, filename) + ".fbx"
fm.Open(fullPath)
fm.Export(fullPathFBX)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment