Load anim type for anim targets and test

This commit is contained in:
Ammar Askar 2023-09-10 23:34:52 -04:00
parent 5b696e64d9
commit fc3cd33a91
2 changed files with 4 additions and 1 deletions

View file

@ -58,6 +58,8 @@ namespace OpenTS2.Files.Formats.DBPF.Scenegraph.Block
{
public string TagName;
public ushort AnimType;
public int NumSharedChannels;
public SharedChannel[] Channels;
@ -489,7 +491,7 @@ namespace OpenTS2.Files.Formats.DBPF.Scenegraph.Block
// 2 ignored uint32s
reader.ReadBytes(4 * 2);
var animType = reader.ReadUInt16();
animTargets[i].AnimType = reader.ReadUInt16();
animTargets[i].NumSharedChannels = reader.ReadUInt16();
animTargets[i].NumIKChains = reader.ReadByte();
var channelType = reader.ReadByte();

View file

@ -126,6 +126,7 @@ public class ScenegraphAnimationCodecTest
var skeletonTarget = animationAsset.AnimResource.AnimTargets[0];
Assert.That(skeletonTarget.TagName, Is.EqualTo("auskel"));
Assert.That(skeletonTarget.AnimType, Is.EqualTo(1));
var leftHandChannels = GetChannelsByName(skeletonTarget, "l_handcontrol0");
Assert.That(leftHandChannels.Length, Is.EqualTo(2));