You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Tools/maxscript/cryAnim/ui/batch/Scripts/anmExport.ms

82 lines
2.3 KiB
Plaintext

try
(
if cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile].subRanges.count == 0 then
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[2].btnImportANM.pressed()
local listEntries = cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile]
local tempStatus = ""
local tempCheckBeforeExport = cryTools.checkbeforeexport
local tempSuppressWarnings = cryTools.suppresswarnings
cryTools.checkbeforeexport = false
cryTools.suppresswarnings = true
UtilityPanel.OpenUtility CryEngine2_Exporter
local tempRange = animationRange
if listEntries.subRanges.count == 0 then
tempStatus = "Error: No Sub-Ranges found"
else
(
for i = 1 to listEntries.subRanges.count do
(
if listEntries.subRanges[i].range.start.frame == listEntries.subRanges[i].range.end.frame then
(
tempStatus = listEntries.subRanges[i].export + " has wrong animation range"
continue
)
else
(
if listEntries.subRanges[i].range.start.frame > listEntries.subRanges[i].range.end.frame then
(
local tempTime = listEntries.subRanges[i].range.start
listEntries.subRanges[i].range.start = listEntries.subRanges[i].range.end
listEntries.subRanges[i].range.end = tempTime
cryTools.cryAnim.UI.batchProcess._f.subRangeUpdateList()
tempStatus += "Switched Start and Stop of " + listEntries.subRanges[i].export
)
)
animationRange = listEntries.subRanges[i].range
saveMaxFile (maxFilePath + listEntries.subRangePrefix + "_" + listEntries.subRanges[i].export + ".max") quiet:true
local newObjects = #()
for f = 1 to listEntries.subRanges[i].objects.count do
(
if (local tempNode = getNodeByName listEntries.subRanges[i].objects[f]) != undefined then
newObjects[f] = tempNode
else
tempStatus += "; Can't find " + listEntries.subRanges[i].objects[f]
)
if newObjects.count > 0 then
(
csexport.set_node_list newObjects
csexport.export_nodes()
)
else
tempStatus += "; No Node Found"
deleteFile (maxFilePath + maxFileName)
)
)
animationRange = tempRange
cryTools.checkbeforeexport = tempCheckBeforeExport
cryTools.suppresswarnings = tempSuppressWarnings
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = tempStatus
)
catch()