我试图制作一个脚本,以便在将其导出到fbx之前在场景中进行一系列清理操作。
如何选择场景中的所有网格/多边形模型以将其删除? 我尝试使用isKindOf GeometryClass,但是也选择了骨骼...
我还试图将所有对象的显示属性更改为“按层”,但是我无法使其显示在Maxscript侦听器中。
这正是我需要做的:
最后,是否可以通过命令行在多个Max文件上运行此脚本?
谢谢
这就是我最终使用的(ExportAnimationFbx.ms):
filename=maxops.mxsCmdLineArgs[#filename]
loadmaxfile filename
hideByCategory.none()
unhide objects
unfreeze objects
objects.displayByLayer = on
delete (for obj in objects where isKindOf obj.baseObject Editable_Mesh or isKindOf obj.baseObject Editable_Poly or isKindOf obj Plane collect obj)
exportFileName = maxops.mxsCmdLineArgs[#exportfilename]
--Geometry------------------------------------------------------------------------
FBXExporterSetParam "SmoothingGroups" false
FBXExporterSetParam "NormalsPerPoly" false
FBXExporterSetParam "TangentSpaceExport" false
FBXExporterSetParam "SmoothMeshExport" false
FBXExporterSetParam "Preserveinstances" false
FBXExporterSetParam "SelectionSetExport" false
FBXExporterSetParam "GeomAsBone" true
FBXExporterSetParam "ColladaTriangulate" false
FBXExporterSetParam "PreserveEdgeOrientation" false
--Animation------------------------------------------------------------------------
FBXExporterSetParam "Animation" true
FBXExporterSetParam "ExportAnimationOnly" false
FBXExporterSetParam "BakeAnimation" true
FBXExporterSetParam "Skin" true
--Cameras------------------------------------------------------------------------
FBXExporterSetParam "Cameras" false
--Lights------------------------------------------------------------------------
FBXExporterSetParam "Lights" false
--Embed Media--------------------------------------------------------------------
FBXExporterSetParam "EmbedTextures" false
--Units----------------------------------------------------------------------------
--Axis Conversion-----------------------------------------------------------------
FBXExporterSetParam "AxisConversionMethod" "Fbx_Root" --"None", "Animation", or "Fbx_Root".
FBXExporterSetParam "UpAxis" "Z"
--UI----------------------------------------------------------------
FBXExporterSetParam "ShowWarnings" true
FBXExporterSetParam "GenerateLog" false
--FBX File Format----------------------------------------------------------------
FBXExporterSetParam "ASCII" false
FBXExporterSetParam "FileVersion" "FBX201400"
exportFile (exportFileName) #noprompt selectedOnly:false using:FBXEXP
这是我在批处理文件中循环通过的命令:
"C:\Program Files\Autodesk\3ds Max 2019\3dsmaxbatch.exe" ExportAnimationFbx.ms -mxsString filename:"myfoldername\maxfilename.max" -mxsString exportfilename:"assetname.fbx"
答案 0 :(得分:0)
对于初始场景设置:
hideByCategory.none()
unhide objects
unfreeze objects
objects.displayByLayer = on
delete (for obj in objects where isKindOf obj Editable_Mesh or isKindOf obj Editable_Poly collect obj)
关于FBX导出,请参考this How to control Max's FBX exporter post。如果您使用的是max 2018.4或更高版本,this series of blog posts将引导您完成3ds max命令行访问。