From d7ea4033f74eaea4298f1c56470d5a36a0099f19 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 12 Dec 2014 21:17:13 +0100 Subject: [PATCH] Also export non-root shapes --- .../generators/max_exporter_scripts/shape.ms | 66 +++++++++---------- .../processes/shape/maxscript/shape_export.ms | 66 +++++++++---------- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms index d8d6c8d9d..2a52947ec 100755 --- a/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms +++ b/code/nel/tools/build_gamedata/generators/max_exporter_scripts/shape.ms @@ -187,6 +187,8 @@ fn haveCoarseMesh node = return false ) +fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node + fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false @@ -273,55 +275,51 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- For each node for node in array_node do ( - -- It is root ? - if (node.parent == undefined) then + -- Is not a skeleton ? + if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can be exported ? - if (isToBeExported node == true) then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Not a lod ? - if ((isLod node) == false) then + -- Output directory + 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 - 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 ( - try + -- Export the shape + if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then ( - -- Export the shape - if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then - ( - nlerror("OK "+output) - exported = exported +1 - ) - else - ( - -- Error - nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) - tagThisFile = false - ) + nlerror("OK "+output) + exported = exported +1 ) - catch + else ( -- Error - nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) tagThisFile = false ) ) - else + catch ( - nlerror("SKIPPED " + output) - exported = exported + 1 + -- Error + nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) + else + ( + nlerror("SKIPPED " + output) + exported = exported + 1 + ) ) ) ) diff --git a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms index 16c6dcec9..5bece0c50 100755 --- a/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms +++ b/code/nel/tools/build_gamedata/processes/shape/maxscript/shape_export.ms @@ -253,6 +253,8 @@ fn haveCoarseMesh node = return false ) +fn getRoot node = if isvalidnode node.parent then getRoot node.parent else node + fn runNelMaxExportSub inputMaxFile retryCount = ( tagThisFile = false @@ -339,55 +341,51 @@ fn runNelMaxExportSub inputMaxFile retryCount = -- For each node for node in array_node do ( - -- It is root ? - if (node.parent == undefined) then + -- Is not a skeleton ? + if (((substring node.name 1 3) != "Bip") and ((substring (getRoot node).name 1 3) != "Bip")) then ( - -- Is not a skeleton ? - if (node.name != "Bip01") then + -- Can be exported ? + if (isToBeExported node == true) then ( - -- Can be exported ? - if (isToBeExported node == true) then + -- Not a lod ? + if ((isLod node) == false) then ( - -- Not a lod ? - if ((isLod node) == false) then + -- Output directory + 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 - 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 ( - try + -- Export the shape + if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then ( - -- Export the shape - if (NelExportShapeEx node output %ShapeExportOptShadow% %ShapeExportOptExportLighting% "%OutputDirectoryLightmap%" %ShapeExportOptLightingLimit% %ShapeExportOptLumelSize% %ShapeExportOptOversampling% true false %ShapeExportOptLightmapLog%) == true then - ( - nlerror("OK "+output) - exported = exported +1 - ) - else - ( - -- Error - nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) - tagThisFile = false - ) + nlerror("OK "+output) + exported = exported +1 ) - catch + else ( -- Error - nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + nlerror("ERROR exporting shape " + node.name + " in file " + inputMaxFile) tagThisFile = false ) ) - else + catch ( - nlerror("SKIPPED " + output) - exported = exported + 1 + -- Error + nlerror("ERROR fatal error exporting shape " + node.name + " in file " + inputMaxFile) + tagThisFile = false ) ) + else + ( + nlerror("SKIPPED " + output) + exported = exported + 1 + ) ) ) )