Created
June 9, 2019 18:09
-
-
Save gonchar/eb8a5e6187710258ee66d90855f78752 to your computer and use it in GitHub Desktop.
3dsmax export fbx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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