-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTest_LoadAndSaveAllAccessories.ms
More file actions
53 lines (41 loc) · 1.99 KB
/
Copy pathTest_LoadAndSaveAllAccessories.ms
File metadata and controls
53 lines (41 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
fn ProcessAllAccessories inputPath outputPath:unsupplied skipTo:0 = (
format "Looking in folder %\n" (inputPath+"Accessories\\")
local rootAccessoryFolders = getDirectories (inputPath+"Accessories\\*")
local levelFolders = getDirectories (inputPath+"Levels\\*")
for levelFolder in levelFolders do (
rootAccessoryFolders = rootAccessoryFolders + (getDirectories (levelFolder+"Accessories\\*"))
)
rootAccessoryFolders = rootAccessoryFolders + (getDirectories (inputPath+"Pickups\\*"))
format "Found % accessories\n" rootAccessoryFolders.count
local numProcessed = 0
for filePath in rootAccessoryFolders do (
if numProcessed >= skipTo then (
format "Loading accessory %\n" filePath
local file = filePath+"accessory.cnt"
local importTextures = CarmaSettings.ImportSettings.importTextures
local forcePrep = CarmaSettings.ImportSettings.UsePrepData
local useTriStrips = CarmaSettings.ImportSettings.UseTriStrips
local mergeSplits = CarmaSettings.ImportSettings.MergeSplits
local SpawnOctree = false
local rootMesh = ImportCNT file importTextures:importTextures forcePREP:forcePREP useTriStrips:useTriStrips mergeMDLs:false mergeSplits:mergeSplits SpawnOctree:SpawnOctree
local accessoryTxtPath = (dotnetclass "System.IO.Path").Combine filePath "accessory.txt"
local accessoryTxt = ImportAccessoryTXT accessoryTxtPath rootMesh
if outputPath != unsupplied and accessoryTxt != undefined then (
select rootMesh
local destination = outputPath + (substring filePath inputPath.count filePath.count)
makedir destination
local outputfile = destination + "accessory.txt"
ExportAccessoryTXT outputfile rootMesh
)
select objects
if $ != undefined then
(
delete $
)
resetMaxFile #noprompt
)
numProcessed = numProcessed+1
--if numProcessed > 855 then return 0
)
)
ProcessAllAccessories "D:\\Steam\\steamapps\\common\\Carmageddon Max Damage\\Data_Core\\Content\\" outputPath:"D:\\Work\\ReincarnationTools\\MaxScriptTools\\text_exports\\accessories"-- skipto:970