Browse Source

added specific morph target test.

Vicente Penades 6 years ago
parent
commit
6baa2b4a72
1 changed files with 20 additions and 3 deletions
  1. 20 3
      tests/SharpGLTF.Tests/Schema2/LoadAndSave/LoadSampleTests.cs

+ 20 - 3
tests/SharpGLTF.Tests/Schema2/LoadAndSave/LoadSampleTests.cs

@@ -235,7 +235,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
             Assert.NotNull(model);
             Assert.NotNull(model);
 
 
             path = System.IO.Path.GetFileNameWithoutExtension(path);
             path = System.IO.Path.GetFileNameWithoutExtension(path);
-
             model.AttachToCurrentTest(path + ".glb");
             model.AttachToCurrentTest(path + ".glb");
 
 
             var triangles = model.DefaultScene
             var triangles = model.DefaultScene
@@ -252,9 +251,27 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 int tt = (int)(t * 1000.0f);
                 int tt = (int)(t * 1000.0f);
 
 
                 model.AttachToCurrentTest($"{path} at {tt}.obj",anim, t);
                 model.AttachToCurrentTest($"{path} at {tt}.obj",anim, t);
-            }
+            }            
+        }
 
 
-            
+        [Test]
+        public void LoadAnimatedMorphCube()
+        {
+            TestContext.CurrentContext.AttachShowDirLink();
+
+            var path = TestFiles
+                .GetSampleModelsPaths()
+                .FirstOrDefault(item => item.Contains("AnimatedMorphCube.glb"));
+
+            var model = ModelRoot.Load(path);
+            Assert.NotNull(model);
+
+            path = System.IO.Path.GetFileNameWithoutExtension(path);
+            model.AttachToCurrentTest(path + ".glb");
+
+            var triangles = model.DefaultScene
+                .Triangulate<Geometry.VertexTypes.VertexPosition, Geometry.VertexTypes.VertexEmpty>(null, 0)
+                .ToArray();
         }
         }
     }
     }
 }
 }