Correct preview ground placement and expose original animation clips

This commit is contained in:
UnixNight committed 2026-10-23 18:12:54 -04:00
1 parent 670adb4795
commit 37fa18094f
22 files changed
+398 -33

No files matched your search

+2
View File
@@ -9,6 +9,7 @@ public sealed class MorphAnimation
public Mesh Base { get; }
public PngImage Texture { get; }
public double SampleInterval { get; }
public bool HasVertexMotion { get; }
private readonly Mesh[] frames;
public MorphAnimation(string manifestPath)
@@ -31,6 +32,7 @@ public sealed class MorphAnimation
for (var i = 0; i < Base.Vertices.Length; i++)
if (frames.Any(f => f.Vertices[i].Uv != Base.Vertices[i].Uv))
throw new InvalidDataException("Morph sample UV differs from base");
HasVertexMotion = frames.Any(f => f.Vertices.Where((v, i) => v.Position != Base.Vertices[i].Position).Any());
SampleInterval = frames.Length > 1
? (samples[1].GetProperty("time").GetDouble() - samples[0].GetProperty("time").GetDouble()) / ticks / fps
: 1 / fps;