Also export non-root shapes

This commit is contained in:
kaetemi 2014-12-12 21:17:13 +01:00
parent 88702799dd
commit 19b0693dbf
2 changed files with 64 additions and 68 deletions

View file

@ -187,6 +187,8 @@ fn haveCoarseMesh node =
return false return false
) )
fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node
fn runNelMaxExportSub inputMaxFile retryCount = fn runNelMaxExportSub inputMaxFile retryCount =
( (
tagThisFile = false tagThisFile = false
@ -273,55 +275,51 @@ fn runNelMaxExportSub inputMaxFile retryCount =
-- For each node -- For each node
for node in array_node do for node in array_node do
( (
-- It is root ? -- Is not a skeleton ?
if (node.parent == undefined) then if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then
( (
-- Is not a skeleton ? -- Can be exported ?
if (node.name != "Bip01") then if (isToBeExported node == true) then
( (
-- Can be exported ? -- Not a lod ?
if (isToBeExported node == true) then if ((isLod node) == false) then
( (
-- Not a lod ? -- Output directory
if ((isLod node) == false) then if (haveCoarseMesh node) == true then
output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape")
else
output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape")
-- Compare file date
if (NeLTestFileDate output inputMaxFile) == true then
( (
-- Output directory try
if (haveCoarseMesh node) == true then
output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape")
else
output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape")
-- Compare file date
if (NeLTestFileDate output inputMaxFile) == true then
( (
try -- Export the shape
if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then
( (
-- Export the shape nlerror("OK "+output)
if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then exported = exported +1
(
nlerror("OK "+output)
exported = exported +1
)
else
(
-- Error
nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false
)
) )
catch else
( (
-- Error -- Error
nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false tagThisFile = false
) )
) )
else catch
( (
nlerror("SKIPPED " + output) -- Error
exported = exported + 1 nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false
) )
) )
else
(
nlerror("SKIPPED " + output)
exported = exported + 1
)
) )
) )
) )

View file

@ -253,6 +253,8 @@ fn haveCoarseMesh node =
return false return false
) )
fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node
fn runNelMaxExportSub inputMaxFile retryCount = fn runNelMaxExportSub inputMaxFile retryCount =
( (
tagThisFile = false tagThisFile = false
@ -339,55 +341,51 @@ fn runNelMaxExportSub inputMaxFile retryCount =
-- For each node -- For each node
for node in array_node do for node in array_node do
( (
-- It is root ? -- Is not a skeleton ?
if (node.parent == undefined) then if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then
( (
-- Is not a skeleton ? -- Can be exported ?
if (node.name != "Bip01") then if (isToBeExported node == true) then
( (
-- Can be exported ? -- Not a lod ?
if (isToBeExported node == true) then if ((isLod node) == false) then
( (
-- Not a lod ? -- Output directory
if ((isLod node) == false) then if (haveCoarseMesh node) == true then
output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape")
else
output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape")
-- Compare file date
if (NeLTestFileDate output inputMaxFile) == true then
( (
-- Output directory try
if (haveCoarseMesh node) == true then
output = ("%OutputDirectoryWithCoarseMesh%/" + (node.name) + ".shape")
else
output = ("%OutputDirectoryWithoutCoarseMesh%/" + (node.name) + ".shape")
-- Compare file date
if (NeLTestFileDate output inputMaxFile) == true then
( (
try -- Export the shape
if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then
( (
-- Export the shape nlerror("OK "+output)
if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then exported = exported +1
(
nlerror("OK "+output)
exported = exported +1
)
else
(
-- Error
nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false
)
) )
catch else
( (
-- Error -- Error
nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false tagThisFile = false
) )
) )
else catch
( (
nlerror("SKIPPED " + output) -- Error
exported = exported + 1 nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile)
tagThisFile = false
) )
) )
else
(
nlerror("SKIPPED " + output)
exported = exported + 1
)
) )
) )
) )