Skip to content

Instantly share code, notes, and snippets.

@umiyuki
Created April 11, 2020 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umiyuki/9a5ff7098a02db73e9f7c87a10cec103 to your computer and use it in GitHub Desktop.
Save umiyuki/9a5ff7098a02db73e9f7c87a10cec103 to your computer and use it in GitHub Desktop.
v-rayとdatasmithプラグインが入ってる3dsMaxで任意のフォルダの中にあるv-ray向けmaxファイルをバッチ処理で全部udatasmithに変換するMaxScript
(
--VRayの警告を非表示
setVRaySilentMode()
--フォルダの中の全てのmaxファイルについて
local files = getFiles @"C:\変換したいmaxファイルがあるフォルダのパス\*.max"
for f in files do (
dirName = getFilenamePath f
fileName = getFilenameFile f
outputName = dirName + fileName + ".udatasmith"
isThereFile = doesFileExist outputName
--すでにudatasmithがファイルがあれば処理スキップ
if isThereFile == false then (
loadMAXFile f quiet:true
--udatasmithファイルを出力
DatasmithExport.IncludeTarget = #VisibleObjects
DatasmithExport.AnimatedTransforms = #ActiveTimeSegment
DatasmithExport.Export outputName false
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment