Skip to content

Commit 1571d32

Browse files
committed
refactor import settings to remove duplicate code
1 parent 7e83e41 commit 1571d32

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

com.unity.formats.fbx/Tests/FbxTests/ModelExporterTest.cs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -852,24 +852,15 @@ public void TestBlendShapeExport(string fbxPath)
852852
SkinnedMeshRenderer originalSMR, exportedSMR;
853853
SetImportSettings setImportSettings = (importer) =>
854854
{
855-
#if UNITY_2019_1_OR_NEWER
856855
importer.importBlendShapes = true;
857-
importer.optimizeMeshPolygons = false;
858-
importer.optimizeMeshVertices = false;
859856
importer.meshCompression = ModelImporterMeshCompression.Off;
860857

861-
importer.importNormals = ModelImporterNormals.Import;
862-
importer.importTangents = ModelImporterTangents.CalculateMikk;
863-
864-
// If either blendshape normals are imported or weldVertices is turned off (or both),
865-
// the vertex count between the original and exported meshes does not match.
866-
// TODO (UT-3410): investigate why the original and exported blendshape normals split the vertices differently.
867-
importer.importBlendShapeNormals = ModelImporterNormals.None;
868-
importer.weldVertices = true;
858+
#if UNITY_2019_1_OR_NEWER
859+
importer.optimizeMeshPolygons = false;
860+
importer.optimizeMeshVertices = false;
869861
#else
870-
importer.importBlendShapes = true;
871862
importer.optimizeMesh = false;
872-
importer.meshCompression = ModelImporterMeshCompression.Off;
863+
#endif // UNITY_2019_1_OR_NEWER
873864

874865
#if UNITY_2018_4_OR_NEWER
875866
importer.importNormals = ModelImporterNormals.Import;
@@ -879,13 +870,11 @@ public void TestBlendShapeExport(string fbxPath)
879870
// are imported.
880871
importer.importNormals = ModelImporterNormals.None;
881872
#endif
882-
883873
// If either blendshape normals are imported or weldVertices is turned off (or both),
884874
// the vertex count between the original and exported meshes does not match.
885875
// TODO (UT-3410): investigate why the original and exported blendshape normals split the vertices differently.
886876
importer.importBlendShapeNormals = ModelImporterNormals.None;
887877
importer.weldVertices = true;
888-
#endif // UNITY_2019_1_OR_NEWER
889878
};
890879

891880
var exportedFbxPath = ExportSkinnedMesh (fbxPath, out originalSMR, out exportedSMR, setImportSettings);

0 commit comments

Comments
 (0)