khanat-opennel-code/code/nel/tools/build_gamedata/generators/max_exporter_scripts/anim.ms
kaetemi a3b71cdb3e Added: #929 Generators for ecosystem projects, all four ecosystem projects, generators for max exporter scripts, rbank cmb export.
Changed: #929 Improved skipping of exported max files, corrected search paths for some tools configurations.
2010-09-03 12:37:35 +02:00

69 lines
1.5 KiB
Text

NEL3D_APPDATA_EXPORT_NODE_ANIMATION = 1423062800
fn runNelMaxExport inputMaxFile =
(
outputNelFile = ("%OutputDirectory%/" + (getFilenameFile inputMaxFile) + ".%PreGenFileExtension%")
tagThisFile = false
-- Unhide category
unhidecategory()
-- Select Bip01, not very smart
if $Bip01 != undefined then
(
select $Bip01
-- Always uncheck triangle pelvis
if (classof $Bip01) == Biped_Object then
(
$Bip01.controller.figureMode = true
$Bip01.controller.trianglepelvis = false
$Bip01.controller.figureMode = false
)
)
-- For each node
for node in objects do
(
exportNodeAnmation = getappdata node NEL3D_APPDATA_EXPORT_NODE_ANIMATION
if (exportNodeAnmation != undefined) then
(
if (exportNodeAnmation == "1") then
(
selectmore node
-- Is it a biped ?
if (classof node.controller) == Vertical_Horizontal_Turn then
(
-- Always uncheck triangle pelvis
node.controller.trianglepelvis = false
)
)
)
)
if ((selection as array).count != 0) then
(
-- Export the animation
if (NelExportAnimation (selection as array) outputNelFile false) == false then
(
nlerror("ERROR exporting animation " + inputMaxFile)
tagThisFile = false
)
else
(
nlerror("OK " + outputNelFile)
tagThisFile = true
)
)
else
(
-- Error
nlerror("ERROR exporting animation: no node animated to export in file " + inputMaxFile)
)
return tagThisFile
)