You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
917 B
39 lines
917 B
-- Export function, takes an input dir (where max scene files are), |
|
-- and an output dir, where the exported files should go |
|
-- |
|
|
|
function ExportScenes = |
|
( |
|
scnInDir = GetSavePath caption:"Choose Max Source Directory" |
|
if scnInDir == undefined then return "Cancel" |
|
scnInDir = scnInDir + "\\" |
|
|
|
scnOutFile = GetSaveFileName caption:"Choose Dest File" types:"PRD(*.prd)|*.prd|" |
|
if scnOutFile == undefined then return "Cancel" |
|
scnOutDir = getFileNamePath(scnOutFile) + "dat\\" |
|
|
|
makeDir scnOutDir |
|
files = getFiles (scnInDir + "*.max") |
|
start = timeStamp() |
|
for f in files do |
|
( |
|
format "Exporting file % to %\n" f scnOutFile |
|
loadMAXFile f |
|
exportFile scnOutFile #noPrompt |
|
) |
|
end = TimeStamp() |
|
format "Exporting took % minutes\n" (( end - start) / 60000.0) |
|
) |
|
|
|
|
|
-- |
|
-- main |
|
-- |
|
utility main_panel "Build Data" |
|
( |
|
button convert_scenes "Plasma Exporter" |
|
on convert_scenes pressed do |
|
( |
|
ExportScenes () |
|
) |
|
) |