diff --git a/File_Format_Library/FileFormats/Pokemon/GFBANIM/FlatBuffers/gfbanim.cs b/File_Format_Library/FileFormats/Pokemon/GFBANIM/FlatBuffers/gfbanim.cs
new file mode 100644
index 00000000..d35bf3c0
--- /dev/null
+++ b/File_Format_Library/FileFormats/Pokemon/GFBANIM/FlatBuffers/gfbanim.cs
@@ -0,0 +1,1391 @@
+//
+// automatically generated by the FlatBuffers compiler, do not modify
+//
+
+namespace Gfbanim
+{
+
+ using global::System;
+ using global::FlatBuffers;
+
+ public enum TriggerParams : byte
+ {
+ NONE = 0,
+ TriggerParameterInt = 1,
+ TriggerParameterFloat = 2,
+ TriggerParameterByte = 3,
+ TriggerParameterString = 4,
+ };
+
+ public enum VectorTrack : byte
+ {
+ NONE = 0,
+ FixedVectorTrack = 1,
+ DynamicVectorTrack = 2,
+ FramedVectorTrack = 3,
+ };
+
+ public enum QuatTrack : byte
+ {
+ NONE = 0,
+ FixedQuatTrack = 1,
+ DynamicQuatTrack = 2,
+ FramedQuatTrack = 3,
+ };
+
+ public enum BooleanTrack : byte
+ {
+ NONE = 0,
+ FixedBooleanTrack = 1,
+ DynamicBooleanTrack = 2,
+ FramedBooleanTrack = 3,
+ };
+
+ public enum ValueTrack : byte
+ {
+ NONE = 0,
+ FixedValueTrack = 1,
+ DynamicValueTrack = 2,
+ FramedValueTrack = 3,
+ };
+
+ public struct Animation : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Animation GetRootAsAnimation(ByteBuffer _bb) { return GetRootAsAnimation(_bb, new Animation()); }
+ public static Animation GetRootAsAnimation(ByteBuffer _bb, Animation obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Animation __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Config? AnimConfig { get { int o = __p.__offset(4); return o != 0 ? (Config?)(new Config()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public BoneList? Bones { get { int o = __p.__offset(6); return o != 0 ? (BoneList?)(new BoneList()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public MaterialList? Materials { get { int o = __p.__offset(8); return o != 0 ? (MaterialList?)(new MaterialList()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public GroupList? Groups { get { int o = __p.__offset(10); return o != 0 ? (GroupList?)(new GroupList()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public TriggerList? Triggers { get { int o = __p.__offset(12); return o != 0 ? (TriggerList?)(new TriggerList()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateAnimation(FlatBufferBuilder builder,
+ Offset AnimConfigOffset = default(Offset),
+ Offset BonesOffset = default(Offset),
+ Offset MaterialsOffset = default(Offset),
+ Offset GroupsOffset = default(Offset),
+ Offset TriggersOffset = default(Offset))
+ {
+ builder.StartObject(5);
+ Animation.AddTriggers(builder, TriggersOffset);
+ Animation.AddGroups(builder, GroupsOffset);
+ Animation.AddMaterials(builder, MaterialsOffset);
+ Animation.AddBones(builder, BonesOffset);
+ Animation.AddAnimConfig(builder, AnimConfigOffset);
+ return Animation.EndAnimation(builder);
+ }
+
+ public static void StartAnimation(FlatBufferBuilder builder) { builder.StartObject(5); }
+ public static void AddAnimConfig(FlatBufferBuilder builder, Offset AnimConfigOffset) { builder.AddOffset(0, AnimConfigOffset.Value, 0); }
+ public static void AddBones(FlatBufferBuilder builder, Offset BonesOffset) { builder.AddOffset(1, BonesOffset.Value, 0); }
+ public static void AddMaterials(FlatBufferBuilder builder, Offset MaterialsOffset) { builder.AddOffset(2, MaterialsOffset.Value, 0); }
+ public static void AddGroups(FlatBufferBuilder builder, Offset GroupsOffset) { builder.AddOffset(3, GroupsOffset.Value, 0); }
+ public static void AddTriggers(FlatBufferBuilder builder, Offset TriggersOffset) { builder.AddOffset(4, TriggersOffset.Value, 0); }
+ public static Offset EndAnimation(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ public static void FinishAnimationBuffer(FlatBufferBuilder builder, Offset offset) { builder.Finish(offset.Value); }
+ public static void FinishSizePrefixedAnimationBuffer(FlatBufferBuilder builder, Offset offset) { builder.FinishSizePrefixed(offset.Value); }
+ };
+
+ public struct TriggerList : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerList GetRootAsTriggerList(ByteBuffer _bb) { return GetRootAsTriggerList(_bb, new TriggerList()); }
+ public static TriggerList GetRootAsTriggerList(ByteBuffer _bb, TriggerList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Trigger? Triggers(int j) { int o = __p.__offset(4); return o != 0 ? (Trigger?)(new Trigger()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int TriggersLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateTriggerList(FlatBufferBuilder builder,
+ VectorOffset TriggersOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ TriggerList.AddTriggers(builder, TriggersOffset);
+ return TriggerList.EndTriggerList(builder);
+ }
+
+ public static void StartTriggerList(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddTriggers(FlatBufferBuilder builder, VectorOffset TriggersOffset) { builder.AddOffset(0, TriggersOffset.Value, 0); }
+ public static VectorOffset CreateTriggersVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateTriggersVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartTriggersVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndTriggerList(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Trigger : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Trigger GetRootAsTrigger(ByteBuffer _bb) { return GetRootAsTrigger(_bb, new Trigger()); }
+ public static Trigger GetRootAsTrigger(ByteBuffer _bb, Trigger obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Trigger __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public int FrameStart { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
+ public int FrameEnd { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
+ public TriggerParameter? Parameter { get { int o = __p.__offset(10); return o != 0 ? (TriggerParameter?)(new TriggerParameter()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateTrigger(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ int FrameStart = 0,
+ int FrameEnd = 0,
+ Offset ParameterOffset = default(Offset))
+ {
+ builder.StartObject(4);
+ Trigger.AddParameter(builder, ParameterOffset);
+ Trigger.AddFrameEnd(builder, FrameEnd);
+ Trigger.AddFrameStart(builder, FrameStart);
+ Trigger.AddName(builder, NameOffset);
+ return Trigger.EndTrigger(builder);
+ }
+
+ public static void StartTrigger(FlatBufferBuilder builder) { builder.StartObject(4); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddFrameStart(FlatBufferBuilder builder, int FrameStart) { builder.AddInt(1, FrameStart, 0); }
+ public static void AddFrameEnd(FlatBufferBuilder builder, int FrameEnd) { builder.AddInt(2, FrameEnd, 0); }
+ public static void AddParameter(FlatBufferBuilder builder, Offset ParameterOffset) { builder.AddOffset(3, ParameterOffset.Value, 0); }
+ public static Offset EndTrigger(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct TriggerParameter : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerParameter GetRootAsTriggerParameter(ByteBuffer _bb) { return GetRootAsTriggerParameter(_bb, new TriggerParameter()); }
+ public static TriggerParameter GetRootAsTriggerParameter(ByteBuffer _bb, TriggerParameter obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerParameter __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public TriggerParams ParamsType { get { int o = __p.__offset(6); return o != 0 ? (TriggerParams)__p.bb.Get(o + __p.bb_pos) : TriggerParams.NONE; } }
+ public TTable? Params() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+
+ public static Offset CreateTriggerParameter(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ TriggerParams Params_type = TriggerParams.NONE,
+ int ParamsOffset = 0)
+ {
+ builder.StartObject(3);
+ TriggerParameter.AddParams(builder, ParamsOffset);
+ TriggerParameter.AddName(builder, NameOffset);
+ TriggerParameter.AddParamsType(builder, Params_type);
+ return TriggerParameter.EndTriggerParameter(builder);
+ }
+
+ public static void StartTriggerParameter(FlatBufferBuilder builder) { builder.StartObject(3); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddParamsType(FlatBufferBuilder builder, TriggerParams ParamsType) { builder.AddByte(1, (byte)ParamsType, 0); }
+ public static void AddParams(FlatBufferBuilder builder, int ParamsOffset) { builder.AddOffset(2, ParamsOffset, 0); }
+ public static Offset EndTriggerParameter(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct TriggerParameterInt : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerParameterInt GetRootAsTriggerParameterInt(ByteBuffer _bb) { return GetRootAsTriggerParameterInt(_bb, new TriggerParameterInt()); }
+ public static TriggerParameterInt GetRootAsTriggerParameterInt(ByteBuffer _bb, TriggerParameterInt obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerParameterInt __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public int Value { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
+
+ public static Offset CreateTriggerParameterInt(FlatBufferBuilder builder,
+ int Value = 0)
+ {
+ builder.StartObject(1);
+ TriggerParameterInt.AddValue(builder, Value);
+ return TriggerParameterInt.EndTriggerParameterInt(builder);
+ }
+
+ public static void StartTriggerParameterInt(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, int Value) { builder.AddInt(0, Value, 0); }
+ public static Offset EndTriggerParameterInt(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct TriggerParameterFloat : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerParameterFloat GetRootAsTriggerParameterFloat(ByteBuffer _bb) { return GetRootAsTriggerParameterFloat(_bb, new TriggerParameterFloat()); }
+ public static TriggerParameterFloat GetRootAsTriggerParameterFloat(ByteBuffer _bb, TriggerParameterFloat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerParameterFloat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float Value { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
+
+ public static Offset CreateTriggerParameterFloat(FlatBufferBuilder builder,
+ float Value = 0.0f)
+ {
+ builder.StartObject(1);
+ TriggerParameterFloat.AddValue(builder, Value);
+ return TriggerParameterFloat.EndTriggerParameterFloat(builder);
+ }
+
+ public static void StartTriggerParameterFloat(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, float Value) { builder.AddFloat(0, Value, 0.0f); }
+ public static Offset EndTriggerParameterFloat(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct TriggerParameterByte : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerParameterByte GetRootAsTriggerParameterByte(ByteBuffer _bb) { return GetRootAsTriggerParameterByte(_bb, new TriggerParameterByte()); }
+ public static TriggerParameterByte GetRootAsTriggerParameterByte(ByteBuffer _bb, TriggerParameterByte obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerParameterByte __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public sbyte Value { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }
+
+ public static Offset CreateTriggerParameterByte(FlatBufferBuilder builder,
+ sbyte Value = 0)
+ {
+ builder.StartObject(1);
+ TriggerParameterByte.AddValue(builder, Value);
+ return TriggerParameterByte.EndTriggerParameterByte(builder);
+ }
+
+ public static void StartTriggerParameterByte(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, sbyte Value) { builder.AddSbyte(0, Value, 0); }
+ public static Offset EndTriggerParameterByte(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct TriggerParameterString : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static TriggerParameterString GetRootAsTriggerParameterString(ByteBuffer _bb) { return GetRootAsTriggerParameterString(_bb, new TriggerParameterString()); }
+ public static TriggerParameterString GetRootAsTriggerParameterString(ByteBuffer _bb, TriggerParameterString obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public TriggerParameterString __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Value { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetValueBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetValueBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetValueArray() { return __p.__vector_as_array(4); }
+
+ public static Offset CreateTriggerParameterString(FlatBufferBuilder builder,
+ StringOffset ValueOffset = default(StringOffset))
+ {
+ builder.StartObject(1);
+ TriggerParameterString.AddValue(builder, ValueOffset);
+ return TriggerParameterString.EndTriggerParameterString(builder);
+ }
+
+ public static void StartTriggerParameterString(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, StringOffset ValueOffset) { builder.AddOffset(0, ValueOffset.Value, 0); }
+ public static Offset EndTriggerParameterString(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct BoneList : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static BoneList GetRootAsBoneList(ByteBuffer _bb) { return GetRootAsBoneList(_bb, new BoneList()); }
+ public static BoneList GetRootAsBoneList(ByteBuffer _bb, BoneList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public BoneList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Bone? Bones(int j) { int o = __p.__offset(4); return o != 0 ? (Bone?)(new Bone()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int BonesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+ public BoneDefaults? Defaults { get { int o = __p.__offset(6); return o != 0 ? (BoneDefaults?)(new BoneDefaults()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateBoneList(FlatBufferBuilder builder,
+ VectorOffset BonesOffset = default(VectorOffset),
+ Offset DefaultsOffset = default(Offset))
+ {
+ builder.StartObject(2);
+ BoneList.AddDefaults(builder, DefaultsOffset);
+ BoneList.AddBones(builder, BonesOffset);
+ return BoneList.EndBoneList(builder);
+ }
+
+ public static void StartBoneList(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddBones(FlatBufferBuilder builder, VectorOffset BonesOffset) { builder.AddOffset(0, BonesOffset.Value, 0); }
+ public static VectorOffset CreateBonesVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateBonesVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartBonesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static void AddDefaults(FlatBufferBuilder builder, Offset DefaultsOffset) { builder.AddOffset(1, DefaultsOffset.Value, 0); }
+ public static Offset EndBoneList(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct MaterialList : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static MaterialList GetRootAsMaterialList(ByteBuffer _bb) { return GetRootAsMaterialList(_bb, new MaterialList()); }
+ public static MaterialList GetRootAsMaterialList(ByteBuffer _bb, MaterialList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public MaterialList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Material? Materials(int j) { int o = __p.__offset(4); return o != 0 ? (Material?)(new Material()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int MaterialsLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateMaterialList(FlatBufferBuilder builder,
+ VectorOffset MaterialsOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ MaterialList.AddMaterials(builder, MaterialsOffset);
+ return MaterialList.EndMaterialList(builder);
+ }
+
+ public static void StartMaterialList(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddMaterials(FlatBufferBuilder builder, VectorOffset MaterialsOffset) { builder.AddOffset(0, MaterialsOffset.Value, 0); }
+ public static VectorOffset CreateMaterialsVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateMaterialsVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartMaterialsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndMaterialList(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct GroupList : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static GroupList GetRootAsGroupList(ByteBuffer _bb) { return GetRootAsGroupList(_bb, new GroupList()); }
+ public static GroupList GetRootAsGroupList(ByteBuffer _bb, GroupList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public GroupList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Group? Groups(int j) { int o = __p.__offset(4); return o != 0 ? (Group?)(new Group()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int GroupsLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateGroupList(FlatBufferBuilder builder,
+ VectorOffset GroupsOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ GroupList.AddGroups(builder, GroupsOffset);
+ return GroupList.EndGroupList(builder);
+ }
+
+ public static void StartGroupList(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddGroups(FlatBufferBuilder builder, VectorOffset GroupsOffset) { builder.AddOffset(0, GroupsOffset.Value, 0); }
+ public static VectorOffset CreateGroupsVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateGroupsVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartGroupsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndGroupList(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Bone : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Bone GetRootAsBone(ByteBuffer _bb) { return GetRootAsBone(_bb, new Bone()); }
+ public static Bone GetRootAsBone(ByteBuffer _bb, Bone obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Bone __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public VectorTrack ScaleType { get { int o = __p.__offset(6); return o != 0 ? (VectorTrack)__p.bb.Get(o + __p.bb_pos) : VectorTrack.NONE; } }
+ public TTable? Scale() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public QuatTrack RotateType { get { int o = __p.__offset(10); return o != 0 ? (QuatTrack)__p.bb.Get(o + __p.bb_pos) : QuatTrack.NONE; } }
+ public TTable? Rotate() where TTable : struct, IFlatbufferObject { int o = __p.__offset(12); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public VectorTrack TranslateType { get { int o = __p.__offset(14); return o != 0 ? (VectorTrack)__p.bb.Get(o + __p.bb_pos) : VectorTrack.NONE; } }
+ public TTable? Translate() where TTable : struct, IFlatbufferObject { int o = __p.__offset(16); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public FrameRanges? ScaleFrames { get { int o = __p.__offset(18); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public FrameRanges? RotationFrames { get { int o = __p.__offset(20); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+ public FrameRanges? TranslationFrames { get { int o = __p.__offset(22); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateBone(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ VectorTrack Scale_type = VectorTrack.NONE,
+ int ScaleOffset = 0,
+ QuatTrack Rotate_type = QuatTrack.NONE,
+ int RotateOffset = 0,
+ VectorTrack Translate_type = VectorTrack.NONE,
+ int TranslateOffset = 0,
+ Offset ScaleFramesOffset = default(Offset),
+ Offset RotationFramesOffset = default(Offset),
+ Offset TranslationFramesOffset = default(Offset))
+ {
+ builder.StartObject(10);
+ Bone.AddTranslationFrames(builder, TranslationFramesOffset);
+ Bone.AddRotationFrames(builder, RotationFramesOffset);
+ Bone.AddScaleFrames(builder, ScaleFramesOffset);
+ Bone.AddTranslate(builder, TranslateOffset);
+ Bone.AddRotate(builder, RotateOffset);
+ Bone.AddScale(builder, ScaleOffset);
+ Bone.AddName(builder, NameOffset);
+ Bone.AddTranslateType(builder, Translate_type);
+ Bone.AddRotateType(builder, Rotate_type);
+ Bone.AddScaleType(builder, Scale_type);
+ return Bone.EndBone(builder);
+ }
+
+ public static void StartBone(FlatBufferBuilder builder) { builder.StartObject(10); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddScaleType(FlatBufferBuilder builder, VectorTrack ScaleType) { builder.AddByte(1, (byte)ScaleType, 0); }
+ public static void AddScale(FlatBufferBuilder builder, int ScaleOffset) { builder.AddOffset(2, ScaleOffset, 0); }
+ public static void AddRotateType(FlatBufferBuilder builder, QuatTrack RotateType) { builder.AddByte(3, (byte)RotateType, 0); }
+ public static void AddRotate(FlatBufferBuilder builder, int RotateOffset) { builder.AddOffset(4, RotateOffset, 0); }
+ public static void AddTranslateType(FlatBufferBuilder builder, VectorTrack TranslateType) { builder.AddByte(5, (byte)TranslateType, 0); }
+ public static void AddTranslate(FlatBufferBuilder builder, int TranslateOffset) { builder.AddOffset(6, TranslateOffset, 0); }
+ public static void AddScaleFrames(FlatBufferBuilder builder, Offset ScaleFramesOffset) { builder.AddOffset(7, ScaleFramesOffset.Value, 0); }
+ public static void AddRotationFrames(FlatBufferBuilder builder, Offset RotationFramesOffset) { builder.AddOffset(8, RotationFramesOffset.Value, 0); }
+ public static void AddTranslationFrames(FlatBufferBuilder builder, Offset TranslationFramesOffset) { builder.AddOffset(9, TranslationFramesOffset.Value, 0); }
+ public static Offset EndBone(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct BoneDefaults : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static BoneDefaults GetRootAsBoneDefaults(ByteBuffer _bb) { return GetRootAsBoneDefaults(_bb, new BoneDefaults()); }
+ public static BoneDefaults GetRootAsBoneDefaults(ByteBuffer _bb, BoneDefaults obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public BoneDefaults __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public uint Unknown { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
+ public SRT? Transform(int j) { int o = __p.__offset(6); return o != 0 ? (SRT?)(new SRT()).__assign(__p.__vector(o) + j * 40, __p.bb) : null; }
+ public int TransformLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateBoneDefaults(FlatBufferBuilder builder,
+ uint Unknown = 0,
+ VectorOffset TransformOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ BoneDefaults.AddTransform(builder, TransformOffset);
+ BoneDefaults.AddUnknown(builder, Unknown);
+ return BoneDefaults.EndBoneDefaults(builder);
+ }
+
+ public static void StartBoneDefaults(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddUnknown(FlatBufferBuilder builder, uint Unknown) { builder.AddUint(0, Unknown, 0); }
+ public static void AddTransform(FlatBufferBuilder builder, VectorOffset TransformOffset) { builder.AddOffset(1, TransformOffset.Value, 0); }
+ public static void StartTransformVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(40, numElems, 4); }
+ public static Offset EndBoneDefaults(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Material : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Material GetRootAsMaterial(ByteBuffer _bb) { return GetRootAsMaterial(_bb, new Material()); }
+ public static Material GetRootAsMaterial(ByteBuffer _bb, Material obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Material __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public MatSwitch? Switches(int j) { int o = __p.__offset(6); return o != 0 ? (MatSwitch?)(new MatSwitch()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int SwitchesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+ public MatValue? Values(int j) { int o = __p.__offset(8); return o != 0 ? (MatValue?)(new MatValue()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int ValuesLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } }
+ public MatVector? Vectors(int j) { int o = __p.__offset(10); return o != 0 ? (MatVector?)(new MatVector()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
+ public int VectorsLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateMaterial(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ VectorOffset SwitchesOffset = default(VectorOffset),
+ VectorOffset ValuesOffset = default(VectorOffset),
+ VectorOffset VectorsOffset = default(VectorOffset))
+ {
+ builder.StartObject(4);
+ Material.AddVectors(builder, VectorsOffset);
+ Material.AddValues(builder, ValuesOffset);
+ Material.AddSwitches(builder, SwitchesOffset);
+ Material.AddName(builder, NameOffset);
+ return Material.EndMaterial(builder);
+ }
+
+ public static void StartMaterial(FlatBufferBuilder builder) { builder.StartObject(4); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddSwitches(FlatBufferBuilder builder, VectorOffset SwitchesOffset) { builder.AddOffset(1, SwitchesOffset.Value, 0); }
+ public static VectorOffset CreateSwitchesVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateSwitchesVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartSwitchesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(2, ValuesOffset.Value, 0); }
+ public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static void AddVectors(FlatBufferBuilder builder, VectorOffset VectorsOffset) { builder.AddOffset(3, VectorsOffset.Value, 0); }
+ public static VectorOffset CreateVectorsVector(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
+ public static VectorOffset CreateVectorsVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartVectorsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndMaterial(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct MatSwitch : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static MatSwitch GetRootAsMatSwitch(ByteBuffer _bb) { return GetRootAsMatSwitch(_bb, new MatSwitch()); }
+ public static MatSwitch GetRootAsMatSwitch(ByteBuffer _bb, MatSwitch obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public MatSwitch __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public BooleanTrack ValueType { get { int o = __p.__offset(6); return o != 0 ? (BooleanTrack)__p.bb.Get(o + __p.bb_pos) : BooleanTrack.NONE; } }
+ public TTable? Value() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public FrameRanges? FrameRanges { get { int o = __p.__offset(10); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateMatSwitch(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ BooleanTrack Value_type = BooleanTrack.NONE,
+ int ValueOffset = 0,
+ Offset frameRangesOffset = default(Offset))
+ {
+ builder.StartObject(4);
+ MatSwitch.AddFrameRanges(builder, frameRangesOffset);
+ MatSwitch.AddValue(builder, ValueOffset);
+ MatSwitch.AddName(builder, NameOffset);
+ MatSwitch.AddValueType(builder, Value_type);
+ return MatSwitch.EndMatSwitch(builder);
+ }
+
+ public static void StartMatSwitch(FlatBufferBuilder builder) { builder.StartObject(4); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddValueType(FlatBufferBuilder builder, BooleanTrack ValueType) { builder.AddByte(1, (byte)ValueType, 0); }
+ public static void AddValue(FlatBufferBuilder builder, int ValueOffset) { builder.AddOffset(2, ValueOffset, 0); }
+ public static void AddFrameRanges(FlatBufferBuilder builder, Offset frameRangesOffset) { builder.AddOffset(3, frameRangesOffset.Value, 0); }
+ public static Offset EndMatSwitch(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct MatValue : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static MatValue GetRootAsMatValue(ByteBuffer _bb) { return GetRootAsMatValue(_bb, new MatValue()); }
+ public static MatValue GetRootAsMatValue(ByteBuffer _bb, MatValue obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public MatValue __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public ValueTrack ValueType { get { int o = __p.__offset(6); return o != 0 ? (ValueTrack)__p.bb.Get(o + __p.bb_pos) : ValueTrack.NONE; } }
+ public TTable? Value() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public FrameRanges? FrameRanges { get { int o = __p.__offset(10); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateMatValue(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ ValueTrack Value_type = ValueTrack.NONE,
+ int ValueOffset = 0,
+ Offset frameRangesOffset = default(Offset))
+ {
+ builder.StartObject(4);
+ MatValue.AddFrameRanges(builder, frameRangesOffset);
+ MatValue.AddValue(builder, ValueOffset);
+ MatValue.AddName(builder, NameOffset);
+ MatValue.AddValueType(builder, Value_type);
+ return MatValue.EndMatValue(builder);
+ }
+
+ public static void StartMatValue(FlatBufferBuilder builder) { builder.StartObject(4); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddValueType(FlatBufferBuilder builder, ValueTrack ValueType) { builder.AddByte(1, (byte)ValueType, 0); }
+ public static void AddValue(FlatBufferBuilder builder, int ValueOffset) { builder.AddOffset(2, ValueOffset, 0); }
+ public static void AddFrameRanges(FlatBufferBuilder builder, Offset frameRangesOffset) { builder.AddOffset(3, frameRangesOffset.Value, 0); }
+ public static Offset EndMatValue(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct MatVector : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static MatVector GetRootAsMatVector(ByteBuffer _bb) { return GetRootAsMatVector(_bb, new MatVector()); }
+ public static MatVector GetRootAsMatVector(ByteBuffer _bb, MatVector obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public MatVector __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public VectorTrack ValueType { get { int o = __p.__offset(6); return o != 0 ? (VectorTrack)__p.bb.Get(o + __p.bb_pos) : VectorTrack.NONE; } }
+ public TTable? Value() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+ public FrameRanges? FrameRanges { get { int o = __p.__offset(10); return o != 0 ? (FrameRanges?)(new FrameRanges()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
+
+ public static Offset CreateMatVector(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ VectorTrack Value_type = VectorTrack.NONE,
+ int ValueOffset = 0,
+ Offset frameRangesOffset = default(Offset))
+ {
+ builder.StartObject(4);
+ MatVector.AddFrameRanges(builder, frameRangesOffset);
+ MatVector.AddValue(builder, ValueOffset);
+ MatVector.AddName(builder, NameOffset);
+ MatVector.AddValueType(builder, Value_type);
+ return MatVector.EndMatVector(builder);
+ }
+
+ public static void StartMatVector(FlatBufferBuilder builder) { builder.StartObject(4); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddValueType(FlatBufferBuilder builder, VectorTrack ValueType) { builder.AddByte(1, (byte)ValueType, 0); }
+ public static void AddValue(FlatBufferBuilder builder, int ValueOffset) { builder.AddOffset(2, ValueOffset, 0); }
+ public static void AddFrameRanges(FlatBufferBuilder builder, Offset frameRangesOffset) { builder.AddOffset(3, frameRangesOffset.Value, 0); }
+ public static Offset EndMatVector(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Group : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Group GetRootAsGroup(ByteBuffer _bb) { return GetRootAsGroup(_bb, new Group()); }
+ public static Group GetRootAsGroup(ByteBuffer _bb, Group obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Group __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
+#if ENABLE_SPAN_T
+ public Span GetNameBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public byte[] GetNameArray() { return __p.__vector_as_array(4); }
+ public BooleanTrack ValueType { get { int o = __p.__offset(6); return o != 0 ? (BooleanTrack)__p.bb.Get(o + __p.bb_pos) : BooleanTrack.NONE; } }
+ public TTable? Value() where TTable : struct, IFlatbufferObject { int o = __p.__offset(8); return o != 0 ? (TTable?)__p.__union(o) : null; }
+
+ public static Offset CreateGroup(FlatBufferBuilder builder,
+ StringOffset NameOffset = default(StringOffset),
+ BooleanTrack Value_type = BooleanTrack.NONE,
+ int ValueOffset = 0)
+ {
+ builder.StartObject(3);
+ Group.AddValue(builder, ValueOffset);
+ Group.AddName(builder, NameOffset);
+ Group.AddValueType(builder, Value_type);
+ return Group.EndGroup(builder);
+ }
+
+ public static void StartGroup(FlatBufferBuilder builder) { builder.StartObject(3); }
+ public static void AddName(FlatBufferBuilder builder, StringOffset NameOffset) { builder.AddOffset(0, NameOffset.Value, 0); }
+ public static void AddValueType(FlatBufferBuilder builder, BooleanTrack ValueType) { builder.AddByte(1, (byte)ValueType, 0); }
+ public static void AddValue(FlatBufferBuilder builder, int ValueOffset) { builder.AddOffset(2, ValueOffset, 0); }
+ public static Offset EndGroup(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Config : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static Config GetRootAsConfig(ByteBuffer _bb) { return GetRootAsConfig(_bb, new Config()); }
+ public static Config GetRootAsConfig(ByteBuffer _bb, Config obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Config __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public uint Unknown { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
+ public uint KeyFrames { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
+ public uint FramesPerSecond { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
+
+ public static Offset CreateConfig(FlatBufferBuilder builder,
+ uint Unknown = 0,
+ uint KeyFrames = 0,
+ uint FramesPerSecond = 0)
+ {
+ builder.StartObject(3);
+ Config.AddFramesPerSecond(builder, FramesPerSecond);
+ Config.AddKeyFrames(builder, KeyFrames);
+ Config.AddUnknown(builder, Unknown);
+ return Config.EndConfig(builder);
+ }
+
+ public static void StartConfig(FlatBufferBuilder builder) { builder.StartObject(3); }
+ public static void AddUnknown(FlatBufferBuilder builder, uint Unknown) { builder.AddUint(0, Unknown, 0); }
+ public static void AddKeyFrames(FlatBufferBuilder builder, uint KeyFrames) { builder.AddUint(1, KeyFrames, 0); }
+ public static void AddFramesPerSecond(FlatBufferBuilder builder, uint FramesPerSecond) { builder.AddUint(2, FramesPerSecond, 0); }
+ public static Offset EndConfig(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FixedVectorTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FixedVectorTrack GetRootAsFixedVectorTrack(ByteBuffer _bb) { return GetRootAsFixedVectorTrack(_bb, new FixedVectorTrack()); }
+ public static FixedVectorTrack GetRootAsFixedVectorTrack(ByteBuffer _bb, FixedVectorTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FixedVectorTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Vector3? Value { get { int o = __p.__offset(4); return o != 0 ? (Vector3?)(new Vector3()).__assign(o + __p.bb_pos, __p.bb) : null; } }
+
+ public static void StartFixedVectorTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, Offset ValueOffset) { builder.AddStruct(0, ValueOffset.Value, 0); }
+ public static Offset EndFixedVectorTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct DynamicVectorTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static DynamicVectorTrack GetRootAsDynamicVectorTrack(ByteBuffer _bb) { return GetRootAsDynamicVectorTrack(_bb, new DynamicVectorTrack()); }
+ public static DynamicVectorTrack GetRootAsDynamicVectorTrack(ByteBuffer _bb, DynamicVectorTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public DynamicVectorTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Vector3? Values(int j) { int o = __p.__offset(4); return o != 0 ? (Vector3?)(new Vector3()).__assign(__p.__vector(o) + j * 12, __p.bb) : null; }
+ public int ValuesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateDynamicVectorTrack(FlatBufferBuilder builder,
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ DynamicVectorTrack.AddValues(builder, ValuesOffset);
+ return DynamicVectorTrack.EndDynamicVectorTrack(builder);
+ }
+
+ public static void StartDynamicVectorTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(0, ValuesOffset.Value, 0); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(12, numElems, 4); }
+ public static Offset EndDynamicVectorTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FramedVectorTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FramedVectorTrack GetRootAsFramedVectorTrack(ByteBuffer _bb) { return GetRootAsFramedVectorTrack(_bb, new FramedVectorTrack()); }
+ public static FramedVectorTrack GetRootAsFramedVectorTrack(ByteBuffer _bb, FramedVectorTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FramedVectorTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort Frames(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int FramesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetFramesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetFramesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetFramesArray() { return __p.__vector_as_array(4); }
+ public Vector3? Values(int j) { int o = __p.__offset(6); return o != 0 ? (Vector3?)(new Vector3()).__assign(__p.__vector(o) + j * 12, __p.bb) : null; }
+ public int ValuesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateFramedVectorTrack(FlatBufferBuilder builder,
+ VectorOffset FramesOffset = default(VectorOffset),
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ FramedVectorTrack.AddValues(builder, ValuesOffset);
+ FramedVectorTrack.AddFrames(builder, FramesOffset);
+ return FramedVectorTrack.EndFramedVectorTrack(builder);
+ }
+
+ public static void StartFramedVectorTrack(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddFrames(FlatBufferBuilder builder, VectorOffset FramesOffset) { builder.AddOffset(0, FramesOffset.Value, 0); }
+ public static VectorOffset CreateFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(1, ValuesOffset.Value, 0); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(12, numElems, 4); }
+ public static Offset EndFramedVectorTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FixedQuatTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FixedQuatTrack GetRootAsFixedQuatTrack(ByteBuffer _bb) { return GetRootAsFixedQuatTrack(_bb, new FixedQuatTrack()); }
+ public static FixedQuatTrack GetRootAsFixedQuatTrack(ByteBuffer _bb, FixedQuatTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FixedQuatTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Quaternion? Value { get { int o = __p.__offset(4); return o != 0 ? (Quaternion?)(new Quaternion()).__assign(o + __p.bb_pos, __p.bb) : null; } }
+
+ public static void StartFixedQuatTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, Offset ValueOffset) { builder.AddStruct(0, ValueOffset.Value, 0); }
+ public static Offset EndFixedQuatTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct DynamicQuatTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static DynamicQuatTrack GetRootAsDynamicQuatTrack(ByteBuffer _bb) { return GetRootAsDynamicQuatTrack(_bb, new DynamicQuatTrack()); }
+ public static DynamicQuatTrack GetRootAsDynamicQuatTrack(ByteBuffer _bb, DynamicQuatTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public DynamicQuatTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public Quaternion? Values(int j) { int o = __p.__offset(4); return o != 0 ? (Quaternion?)(new Quaternion()).__assign(__p.__vector(o) + j * 6, __p.bb) : null; }
+ public int ValuesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateDynamicQuatTrack(FlatBufferBuilder builder,
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ DynamicQuatTrack.AddValues(builder, ValuesOffset);
+ return DynamicQuatTrack.EndDynamicQuatTrack(builder);
+ }
+
+ public static void StartDynamicQuatTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(0, ValuesOffset.Value, 0); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(6, numElems, 2); }
+ public static Offset EndDynamicQuatTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FramedQuatTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FramedQuatTrack GetRootAsFramedQuatTrack(ByteBuffer _bb) { return GetRootAsFramedQuatTrack(_bb, new FramedQuatTrack()); }
+ public static FramedQuatTrack GetRootAsFramedQuatTrack(ByteBuffer _bb, FramedQuatTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FramedQuatTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort Frames(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int FramesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetFramesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetFramesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetFramesArray() { return __p.__vector_as_array(4); }
+ public Quaternion? Values(int j) { int o = __p.__offset(6); return o != 0 ? (Quaternion?)(new Quaternion()).__assign(__p.__vector(o) + j * 6, __p.bb) : null; }
+ public int ValuesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+
+ public static Offset CreateFramedQuatTrack(FlatBufferBuilder builder,
+ VectorOffset FramesOffset = default(VectorOffset),
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ FramedQuatTrack.AddValues(builder, ValuesOffset);
+ FramedQuatTrack.AddFrames(builder, FramesOffset);
+ return FramedQuatTrack.EndFramedQuatTrack(builder);
+ }
+
+ public static void StartFramedQuatTrack(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddFrames(FlatBufferBuilder builder, VectorOffset FramesOffset) { builder.AddOffset(0, FramesOffset.Value, 0); }
+ public static VectorOffset CreateFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(1, ValuesOffset.Value, 0); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(6, numElems, 2); }
+ public static Offset EndFramedQuatTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FixedBooleanTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FixedBooleanTrack GetRootAsFixedBooleanTrack(ByteBuffer _bb) { return GetRootAsFixedBooleanTrack(_bb, new FixedBooleanTrack()); }
+ public static FixedBooleanTrack GetRootAsFixedBooleanTrack(ByteBuffer _bb, FixedBooleanTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FixedBooleanTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public sbyte Value { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }
+
+ public static Offset CreateFixedBooleanTrack(FlatBufferBuilder builder,
+ sbyte Value = 0)
+ {
+ builder.StartObject(1);
+ FixedBooleanTrack.AddValue(builder, Value);
+ return FixedBooleanTrack.EndFixedBooleanTrack(builder);
+ }
+
+ public static void StartFixedBooleanTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, sbyte Value) { builder.AddSbyte(0, Value, 0); }
+ public static Offset EndFixedBooleanTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct DynamicBooleanTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static DynamicBooleanTrack GetRootAsDynamicBooleanTrack(ByteBuffer _bb) { return GetRootAsDynamicBooleanTrack(_bb, new DynamicBooleanTrack()); }
+ public static DynamicBooleanTrack GetRootAsDynamicBooleanTrack(ByteBuffer _bb, DynamicBooleanTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public DynamicBooleanTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort Values(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int ValuesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetValuesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetValuesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetValuesArray() { return __p.__vector_as_array(4); }
+
+ public static Offset CreateDynamicBooleanTrack(FlatBufferBuilder builder,
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ DynamicBooleanTrack.AddValues(builder, ValuesOffset);
+ return DynamicBooleanTrack.EndDynamicBooleanTrack(builder);
+ }
+
+ public static void StartDynamicBooleanTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(0, ValuesOffset.Value, 0); }
+ public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static Offset EndDynamicBooleanTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FramedBooleanTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FramedBooleanTrack GetRootAsFramedBooleanTrack(ByteBuffer _bb) { return GetRootAsFramedBooleanTrack(_bb, new FramedBooleanTrack()); }
+ public static FramedBooleanTrack GetRootAsFramedBooleanTrack(ByteBuffer _bb, FramedBooleanTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FramedBooleanTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort Frames(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int FramesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetFramesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetFramesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetFramesArray() { return __p.__vector_as_array(4); }
+ public ushort Values(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int ValuesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetValuesBytes() { return __p.__vector_as_span(6); }
+#else
+ public ArraySegment? GetValuesBytes() { return __p.__vector_as_arraysegment(6); }
+#endif
+ public ushort[] GetValuesArray() { return __p.__vector_as_array(6); }
+
+ public static Offset CreateFramedBooleanTrack(FlatBufferBuilder builder,
+ VectorOffset FramesOffset = default(VectorOffset),
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ FramedBooleanTrack.AddValues(builder, ValuesOffset);
+ FramedBooleanTrack.AddFrames(builder, FramesOffset);
+ return FramedBooleanTrack.EndFramedBooleanTrack(builder);
+ }
+
+ public static void StartFramedBooleanTrack(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddFrames(FlatBufferBuilder builder, VectorOffset FramesOffset) { builder.AddOffset(0, FramesOffset.Value, 0); }
+ public static VectorOffset CreateFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(1, ValuesOffset.Value, 0); }
+ public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static Offset EndFramedBooleanTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FixedValueTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FixedValueTrack GetRootAsFixedValueTrack(ByteBuffer _bb) { return GetRootAsFixedValueTrack(_bb, new FixedValueTrack()); }
+ public static FixedValueTrack GetRootAsFixedValueTrack(ByteBuffer _bb, FixedValueTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FixedValueTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float Value { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
+
+ public static Offset CreateFixedValueTrack(FlatBufferBuilder builder,
+ float Value = 0.0f)
+ {
+ builder.StartObject(1);
+ FixedValueTrack.AddValue(builder, Value);
+ return FixedValueTrack.EndFixedValueTrack(builder);
+ }
+
+ public static void StartFixedValueTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValue(FlatBufferBuilder builder, float Value) { builder.AddFloat(0, Value, 0.0f); }
+ public static Offset EndFixedValueTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct DynamicValueTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static DynamicValueTrack GetRootAsDynamicValueTrack(ByteBuffer _bb) { return GetRootAsDynamicValueTrack(_bb, new DynamicValueTrack()); }
+ public static DynamicValueTrack GetRootAsDynamicValueTrack(ByteBuffer _bb, DynamicValueTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public DynamicValueTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float Values(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetFloat(__p.__vector(o) + j * 4) : (float)0; }
+ public int ValuesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetValuesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetValuesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public float[] GetValuesArray() { return __p.__vector_as_array(4); }
+
+ public static Offset CreateDynamicValueTrack(FlatBufferBuilder builder,
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(1);
+ DynamicValueTrack.AddValues(builder, ValuesOffset);
+ return DynamicValueTrack.EndDynamicValueTrack(builder);
+ }
+
+ public static void StartDynamicValueTrack(FlatBufferBuilder builder) { builder.StartObject(1); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(0, ValuesOffset.Value, 0); }
+ public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddFloat(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndDynamicValueTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FramedValueTrack : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FramedValueTrack GetRootAsFramedValueTrack(ByteBuffer _bb) { return GetRootAsFramedValueTrack(_bb, new FramedValueTrack()); }
+ public static FramedValueTrack GetRootAsFramedValueTrack(ByteBuffer _bb, FramedValueTrack obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FramedValueTrack __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort Frames(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int FramesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetFramesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetFramesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetFramesArray() { return __p.__vector_as_array(4); }
+ public float Values(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetFloat(__p.__vector(o) + j * 4) : (float)0; }
+ public int ValuesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetValuesBytes() { return __p.__vector_as_span(6); }
+#else
+ public ArraySegment? GetValuesBytes() { return __p.__vector_as_arraysegment(6); }
+#endif
+ public float[] GetValuesArray() { return __p.__vector_as_array(6); }
+
+ public static Offset CreateFramedValueTrack(FlatBufferBuilder builder,
+ VectorOffset FramesOffset = default(VectorOffset),
+ VectorOffset ValuesOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ FramedValueTrack.AddValues(builder, ValuesOffset);
+ FramedValueTrack.AddFrames(builder, FramesOffset);
+ return FramedValueTrack.EndFramedValueTrack(builder);
+ }
+
+ public static void StartFramedValueTrack(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddFrames(FlatBufferBuilder builder, VectorOffset FramesOffset) { builder.AddOffset(0, FramesOffset.Value, 0); }
+ public static VectorOffset CreateFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(1, ValuesOffset.Value, 0); }
+ public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddFloat(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateValuesVectorBlock(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
+ public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
+ public static Offset EndFramedValueTrack(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct FrameRanges : IFlatbufferObject
+ {
+ private Table __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public static FrameRanges GetRootAsFrameRanges(ByteBuffer _bb) { return GetRootAsFrameRanges(_bb, new FrameRanges()); }
+ public static FrameRanges GetRootAsFrameRanges(ByteBuffer _bb, FrameRanges obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public FrameRanges __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort StartFrames(int j) { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int StartFramesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetStartFramesBytes() { return __p.__vector_as_span(4); }
+#else
+ public ArraySegment? GetStartFramesBytes() { return __p.__vector_as_arraysegment(4); }
+#endif
+ public ushort[] GetStartFramesArray() { return __p.__vector_as_array(4); }
+ public ushort EndFrames(int j) { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUshort(__p.__vector(o) + j * 2) : (ushort)0; }
+ public int EndFramesLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
+#if ENABLE_SPAN_T
+ public Span GetEndFramesBytes() { return __p.__vector_as_span(6); }
+#else
+ public ArraySegment? GetEndFramesBytes() { return __p.__vector_as_arraysegment(6); }
+#endif
+ public ushort[] GetEndFramesArray() { return __p.__vector_as_array(6); }
+
+ public static Offset CreateFrameRanges(FlatBufferBuilder builder,
+ VectorOffset StartFramesOffset = default(VectorOffset),
+ VectorOffset EndFramesOffset = default(VectorOffset))
+ {
+ builder.StartObject(2);
+ FrameRanges.AddEndFrames(builder, EndFramesOffset);
+ FrameRanges.AddStartFrames(builder, StartFramesOffset);
+ return FrameRanges.EndFrameRanges(builder);
+ }
+
+ public static void StartFrameRanges(FlatBufferBuilder builder) { builder.StartObject(2); }
+ public static void AddStartFrames(FlatBufferBuilder builder, VectorOffset StartFramesOffset) { builder.AddOffset(0, StartFramesOffset.Value, 0); }
+ public static VectorOffset CreateStartFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateStartFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartStartFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static void AddEndFrames(FlatBufferBuilder builder, VectorOffset EndFramesOffset) { builder.AddOffset(1, EndFramesOffset.Value, 0); }
+ public static VectorOffset CreateEndFramesVector(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); for (int i = data.Length - 1; i >= 0; i--) builder.AddUshort(data[i]); return builder.EndVector(); }
+ public static VectorOffset CreateEndFramesVectorBlock(FlatBufferBuilder builder, ushort[] data) { builder.StartVector(2, data.Length, 2); builder.Add(data); return builder.EndVector(); }
+ public static void StartEndFramesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(2, numElems, 2); }
+ public static Offset EndFrameRanges(FlatBufferBuilder builder)
+ {
+ int o = builder.EndObject();
+ return new Offset(o);
+ }
+ };
+
+ public struct Vector3 : IFlatbufferObject
+ {
+ private Struct __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Vector3 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float X { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }
+ public float Y { get { return __p.bb.GetFloat(__p.bb_pos + 4); } }
+ public float Z { get { return __p.bb.GetFloat(__p.bb_pos + 8); } }
+
+ public static Offset CreateVector3(FlatBufferBuilder builder, float X, float Y, float Z)
+ {
+ builder.Prep(4, 12);
+ builder.PutFloat(Z);
+ builder.PutFloat(Y);
+ builder.PutFloat(X);
+ return new Offset(builder.Offset);
+ }
+ };
+
+ public struct Vector4 : IFlatbufferObject
+ {
+ private Struct __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Vector4 __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float X { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }
+ public float Y { get { return __p.bb.GetFloat(__p.bb_pos + 4); } }
+ public float Z { get { return __p.bb.GetFloat(__p.bb_pos + 8); } }
+ public float W { get { return __p.bb.GetFloat(__p.bb_pos + 12); } }
+
+ public static Offset CreateVector4(FlatBufferBuilder builder, float X, float Y, float Z, float W)
+ {
+ builder.Prep(4, 16);
+ builder.PutFloat(W);
+ builder.PutFloat(Z);
+ builder.PutFloat(Y);
+ builder.PutFloat(X);
+ return new Offset(builder.Offset);
+ }
+ };
+
+ public struct Quaternion : IFlatbufferObject
+ {
+ private Struct __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public Quaternion __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public ushort X { get { return __p.bb.GetUshort(__p.bb_pos + 0); } }
+ public ushort Y { get { return __p.bb.GetUshort(__p.bb_pos + 2); } }
+ public ushort Z { get { return __p.bb.GetUshort(__p.bb_pos + 4); } }
+
+ public static Offset CreateQuaternion(FlatBufferBuilder builder, ushort X, ushort Y, ushort Z)
+ {
+ builder.Prep(2, 6);
+ builder.PutUshort(Z);
+ builder.PutUshort(Y);
+ builder.PutUshort(X);
+ return new Offset(builder.Offset);
+ }
+ };
+
+ public struct SRT : IFlatbufferObject
+ {
+ private Struct __p;
+ public ByteBuffer ByteBuffer { get { return __p.bb; } }
+ public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
+ public SRT __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
+
+ public float ScaleX { get { return __p.bb.GetFloat(__p.bb_pos + 0); } }
+ public float ScaleY { get { return __p.bb.GetFloat(__p.bb_pos + 4); } }
+ public float ScaleZ { get { return __p.bb.GetFloat(__p.bb_pos + 8); } }
+ public float RotateX { get { return __p.bb.GetFloat(__p.bb_pos + 12); } }
+ public float RotateY { get { return __p.bb.GetFloat(__p.bb_pos + 16); } }
+ public float RotateZ { get { return __p.bb.GetFloat(__p.bb_pos + 20); } }
+ public float RotateW { get { return __p.bb.GetFloat(__p.bb_pos + 24); } }
+ public float TranslateX { get { return __p.bb.GetFloat(__p.bb_pos + 28); } }
+ public float TranslateY { get { return __p.bb.GetFloat(__p.bb_pos + 32); } }
+ public float TranslateZ { get { return __p.bb.GetFloat(__p.bb_pos + 36); } }
+
+ public static Offset CreateSRT(FlatBufferBuilder builder, float ScaleX, float ScaleY, float ScaleZ, float RotateX, float RotateY, float RotateZ, float RotateW, float TranslateX, float TranslateY, float TranslateZ)
+ {
+ builder.Prep(4, 40);
+ builder.PutFloat(TranslateZ);
+ builder.PutFloat(TranslateY);
+ builder.PutFloat(TranslateX);
+ builder.PutFloat(RotateW);
+ builder.PutFloat(RotateZ);
+ builder.PutFloat(RotateY);
+ builder.PutFloat(RotateX);
+ builder.PutFloat(ScaleZ);
+ builder.PutFloat(ScaleY);
+ builder.PutFloat(ScaleX);
+ return new Offset(builder.Offset);
+ }
+ };
+
+
+}
diff --git a/File_Format_Library/FileFormats/Pokemon/GFBANIM/GFBANM.cs b/File_Format_Library/FileFormats/Pokemon/GFBANIM/GFBANM.cs
index 9234e5cd..814f28f5 100644
--- a/File_Format_Library/FileFormats/Pokemon/GFBANIM/GFBANM.cs
+++ b/File_Format_Library/FileFormats/Pokemon/GFBANIM/GFBANM.cs
@@ -9,11 +9,16 @@ using Toolbox.Library;
using Toolbox.Library.IO;
using OpenTK;
using System.Reflection;
+using Toolbox.Library.IO.FlatBuffer;
+using Toolbox.Library.Animations;
+using FirstPlugin.Forms;
namespace FirstPlugin
{
- public class GFBANM : IFileFormat
+ public class GFBANM : TreeNodeFile, IFileFormat, IAnimationContainer
{
+ public STAnimation AnimationController => AnimationData;
+
public FileType FileType { get; set; } = FileType.Model;
public bool CanSave { get; set; }
@@ -28,6 +33,17 @@ namespace FirstPlugin
return Utils.GetExtension(FileName) == ".gfbanm";
}
+ public override void OnClick(TreeView treeView)
+ {
+ ViewportEditor editor = (ViewportEditor)LibraryGUI.GetActiveContent(typeof(ViewportEditor));
+ if (editor == null)
+ {
+ editor = new ViewportEditor(true);
+ editor.Dock = DockStyle.Fill;
+ LibraryGUI.LoadEditor(editor);
+ }
+ }
+
public Type[] Types
{
get
@@ -37,12 +53,31 @@ namespace FirstPlugin
}
}
- Header header;
+ Animation AnimationData;
public void Load(System.IO.Stream stream)
{
- using (var reader = new FileReader(stream))
- {
- header = new Header(reader);
+ Text = FileName;
+ Gfbanim.Animation anim = Gfbanim.Animation.GetRootAsAnimation(
+ new FlatBuffers.ByteBuffer(stream.ToBytes()));
+
+ AnimationData = new Animation();
+ AnimationData.FrameCount = anim.AnimConfig.Value.KeyFrames;
+
+ if (anim.Bones.HasValue) {
+ for (int i = 0; i < anim.Bones.Value.BonesLength; i++)
+ AnimationData.LoadBoneGroup(anim.Bones.Value.Bones(i).Value);
+ }
+ if (anim.Materials.HasValue) {
+ for (int i = 0; i < anim.Materials.Value.MaterialsLength; i++)
+ AnimationData.LoadMaterialGroup(anim.Materials.Value.Materials(i).Value);
+ }
+ if (anim.Groups.HasValue) {
+ for (int i = 0; i < anim.Groups.Value.GroupsLength; i++)
+ AnimationData.LoadVisibilyGroup(anim.Groups.Value.Groups(i).Value);
+ }
+ if (anim.Triggers.HasValue) {
+ for (int i = 0; i < anim.Triggers.Value.TriggersLength; i++)
+ AnimationData.LoadTriggerGroup(anim.Triggers.Value.Triggers(i).Value);
}
}
@@ -55,199 +90,426 @@ namespace FirstPlugin
{
}
- public class Header
+ public class Animation : STSkeletonAnimation
{
- public Config config;
- public BoneList boneList;
-
- public Header(FileReader reader)
+ public override void NextFrame()
{
- config = ParseSection(reader, this);
- boneList = ParseSection(reader, this);
+ if (Frame > FrameCount) return;
- Console.WriteLine($"config NumKeyFrames {config.NumKeyFrames}");
- Console.WriteLine($"config FramesPerSecond {config.FramesPerSecond}");
- }
- }
+ var skeleton = GetActiveSkeleton();
+ if (skeleton == null) return;
- private static T ParseSection(FileReader reader, Header header)
- where T : GFSection, new()
- {
- var offset = reader.ReadOffset(true, typeof(uint));
- reader.SeekBegin(offset);
+ if (Frame == 0)
+ skeleton.reset();
- long origin = reader.Position;
-
- int layoutOffset = reader.ReadInt32();
- var dataOffset = reader.ReadOffset(true, typeof(uint));
-
- T section = new T();
- using (reader.TemporarySeek(origin - layoutOffset, System.IO.SeekOrigin.Begin))
- {
- ushort layoutSize = reader.ReadUInt16();
- ushort layoutStride = reader.ReadUInt16();
-
- List pointers = new List();
- uint looper = 4;
- while (looper < layoutSize) {
- pointers.Add(reader.ReadUInt16());
- looper += 2;
- }
-
- section.LayoutPointers = reader.ReadUInt16s((int)(layoutSize / 4));
- }
-
- using (reader.TemporarySeek(dataOffset, System.IO.SeekOrigin.Begin)) {
- section.Read(reader, header);
- }
-
- return section;
- }
-
- public class GFSection
- {
- public ushort LayoutSize { get; set; }
- public ushort LayoutStride { get; set; }
-
- public ushort[] LayoutPointers { get; set; }
-
- public void Read(FileReader reader, Header header)
- {
- long origin = reader.Position;
-
- PropertyInfo[] types = new PropertyInfo[(int)LayoutPointers?.Length];
-
- var sectionType = this.GetType();
-
- int index = 0;
- foreach (var prop in sectionType.GetProperties()) {
- if (!Attribute.IsDefined(prop, typeof(FlatTableParse)))
- continue;
-
- types[index++] = prop;
- }
-
- for (int i = 0; i < LayoutPointers?.Length; i++)
+ bool Updated = false; // no need to update skeleton of animations that didn't change
+ foreach (var animGroup in AnimGroups)
{
- reader.SeekBegin(origin + LayoutPointers[i]);
- if (types[i] != null)
+ if (animGroup is BoneGroup)
{
- var prop = types[i];
- var propertyType = prop.PropertyType;
+ var node = animGroup as BoneGroup;
- if (propertyType == typeof(uint))
- prop.SetValue(this, reader.ReadUInt32());
- else if (propertyType == typeof(int))
- prop.SetValue(this, reader.ReadInt32());
- else if(propertyType == typeof(byte))
- prop.SetValue(this, reader.ReadByte());
- else if(propertyType == typeof(sbyte))
- prop.SetValue(this, reader.ReadSByte());
- else if (propertyType == typeof(ushort))
- prop.SetValue(this, reader.ReadUInt16());
- else if (propertyType == typeof(short))
- prop.SetValue(this, reader.ReadInt16());
- else if (propertyType == typeof(Vector2))
- prop.SetValue(this, new Vector2(
- reader.ReadSingle(),
- reader.ReadSingle())
- );
- else if (propertyType == typeof(Vector3))
- prop.SetValue(this, new Vector3(
- reader.ReadSingle(),
- reader.ReadSingle(),
- reader.ReadSingle())
- );
- else if (propertyType == typeof(Vector4))
- prop.SetValue(this, new Vector4(
- reader.ReadSingle(),
- reader.ReadSingle(),
- reader.ReadSingle(),
- reader.ReadSingle())
- );
- else if (propertyType == typeof(GFSection))
+ STBone b = null;
+ b = skeleton.GetBone(node.Name);
+ if (b == null) continue;
+
+ Updated = true;
+
+ if (node.TranslateX.HasKeys)
+ b.pos.X = node.TranslateX.GetFrameValue(Frame);
+ if (node.TranslateY.HasKeys)
+ b.pos.Y = node.TranslateY.GetFrameValue(Frame);
+ if (node.TranslateZ.HasKeys)
+ b.pos.Z = node.TranslateZ.GetFrameValue(Frame);
+
+ if (node.ScaleX.HasKeys)
+ b.sca.X = node.ScaleX.GetFrameValue(Frame);
+ else b.sca.X = 1;
+ if (node.ScaleY.HasKeys)
+ b.sca.Y = node.ScaleY.GetFrameValue(Frame);
+ else b.sca.Y = 1;
+ if (node.ScaleZ.HasKeys)
+ b.sca.Z = node.ScaleZ.GetFrameValue(Frame);
+ else b.sca.Z = 1;
+
+ if (node.RotationX.HasKeys || node.RotationY.HasKeys || node.RotationZ.HasKeys)
{
- var offset = reader.ReadOffset(true, typeof(uint));
- reader.SeekBegin(offset);
- }
- else if (propertyType is IEnumerable) {
+ float x = node.RotationX.HasKeys ? node.RotationX.GetFrameValue(Frame) : b.rotation[0];
+ float y = node.RotationY.HasKeys ? node.RotationY.GetFrameValue(Frame) : b.rotation[1];
+ float z = node.RotationZ.HasKeys ? node.RotationZ.GetFrameValue(Frame) : b.rotation[2];
+ var Rotation = new Vector3(x / 0xffff, y/ 0xffff, z / 0xffff).Normalized();
+ b.rot = EulerToQuat(Rotation.Z, Rotation.Y, Rotation.X);
+
+ // b.rot = EulerToQuat(Rotation.Z, Rotation.Y, Rotation.X);
+
+ float Angle = Rotation.Length;
+ Console.WriteLine($"{node.Name} Angle {Angle}");
+
+ // b.rot = Angle > 0
+ // ? Quaternion.FromAxisAngle(Vector3.Normalize(Rotation), Angle)
+ // : Quaternion.Identity;
+ }
+ else
+ {
+ b.rot = EulerToQuat(b.rotation[2], b.rotation[1], b.rotation[0]);
}
}
}
+
+ if (Updated)
+ {
+ skeleton.update();
+ }
+ }
+
+ public static Quaternion EulerToQuat(float z, float y, float x)
+ {
+ Quaternion xRotation = Quaternion.FromAxisAngle(Vector3.UnitX, x);
+ Quaternion yRotation = Quaternion.FromAxisAngle(Vector3.UnitY, y);
+ Quaternion zRotation = Quaternion.FromAxisAngle(Vector3.UnitZ, z);
+ return (zRotation * yRotation * xRotation);
+ }
+
+ public void LoadBoneGroup(Gfbanim.Bone boneAnim)
+ {
+ BoneGroup groupAnim = new BoneGroup();
+ groupAnim.Name = boneAnim.Name;
+ AnimGroups.Add(groupAnim);
+
+ //Tracks use 3 types
+ // Fixed/constant
+ // Dynamic (baked and multiple keys, no frames)
+ // Framed (multiple keys and frames)
+
+ List Frames = new List();
+
+ Console.WriteLine($"BoneGroup {groupAnim.Name }");
+
+ switch (boneAnim.RotateType)
+ {
+ case Gfbanim.QuatTrack.DynamicQuatTrack:
+ {
+ var rotate = boneAnim.Rotate();
+ if (rotate.HasValue)
+ {
+ var values = LoadRotationTrack(rotate.Value);
+ groupAnim.RotationX = values[0];
+ groupAnim.RotationY = values[1];
+ groupAnim.RotationZ = values[2];
+ }
+ }
+ break;
+ case Gfbanim.QuatTrack.FixedQuatTrack:
+ {
+ var rotate = boneAnim.Rotate();
+ if (rotate.HasValue)
+ {
+ var vec = rotate.Value.Value.Value;
+ groupAnim.RotationX.KeyFrames.Add(new STKeyFrame(0, ConvertRotation(vec.X)));
+ groupAnim.RotationY.KeyFrames.Add(new STKeyFrame(0, ConvertRotation(vec.Y)));
+ groupAnim.RotationZ.KeyFrames.Add(new STKeyFrame(0, ConvertRotation(vec.Z)));
+ }
+ }
+ break;
+ case Gfbanim.QuatTrack.FramedQuatTrack:
+ {
+ var rotate = boneAnim.Rotate();
+ if (rotate.HasValue)
+ {
+ var values = LoadRotationTrack(rotate.Value);
+ groupAnim.RotationX = values[0];
+ groupAnim.RotationY = values[1];
+ groupAnim.RotationZ = values[2];
+ }
+ }
+ break;
+ }
+ switch (boneAnim.ScaleType)
+ {
+ case Gfbanim.VectorTrack.FixedVectorTrack:
+ {
+ var scale = boneAnim.Scale();
+ if (scale.HasValue)
+ {
+ var vec = scale.Value.Value.Value;
+ groupAnim.ScaleX.KeyFrames.Add(new STKeyFrame(0, vec.X));
+ groupAnim.ScaleY.KeyFrames.Add(new STKeyFrame(0, vec.Y));
+ groupAnim.ScaleZ.KeyFrames.Add(new STKeyFrame(0, vec.Z));
+ }
+ }
+ break;
+ }
+ switch (boneAnim.ScaleType)
+ {
+ case Gfbanim.VectorTrack.DynamicVectorTrack:
+ {
+ var scale = boneAnim.Scale();
+ if (scale.HasValue)
+ {
+ var values = LoadVectorTrack(scale.Value);
+ groupAnim.ScaleX = values[0];
+ groupAnim.ScaleY = values[1];
+ groupAnim.ScaleZ = values[2];
+ }
+ }
+ break;
+ case Gfbanim.VectorTrack.FramedVectorTrack:
+ {
+ var scale = boneAnim.Scale();
+ if (scale.HasValue)
+ {
+ var values = LoadVectorTrack(scale.Value);
+ groupAnim.ScaleX = values[0];
+ groupAnim.ScaleY = values[1];
+ groupAnim.ScaleZ = values[2];
+ }
+ }
+ break;
+ case Gfbanim.VectorTrack.FixedVectorTrack:
+ {
+ var scale = boneAnim.Scale();
+ if (scale.HasValue)
+ {
+ var vec = scale.Value.Value.Value;
+ groupAnim.ScaleX.KeyFrames.Add(new STKeyFrame(0, vec.X));
+ groupAnim.ScaleY.KeyFrames.Add(new STKeyFrame(0, vec.Y));
+ groupAnim.ScaleZ.KeyFrames.Add(new STKeyFrame(0, vec.Z));
+ }
+ }
+ break;
+ }
+ switch (boneAnim.TranslateType)
+ {
+ case Gfbanim.VectorTrack.DynamicVectorTrack:
+ {
+ var trans = boneAnim.Translate();
+ if (trans.HasValue)
+ {
+ var values = LoadVectorTrack(trans.Value);
+ groupAnim.TranslateX = values[0];
+ groupAnim.TranslateY = values[1];
+ groupAnim.TranslateZ = values[2];
+ }
+ }
+ break;
+ case Gfbanim.VectorTrack.FramedVectorTrack:
+ {
+ var trans = boneAnim.Translate();
+ if (trans.HasValue)
+ {
+ var values = LoadVectorTrack(trans.Value);
+ groupAnim.TranslateX = values[0];
+ groupAnim.TranslateY = values[1];
+ groupAnim.TranslateZ = values[2];
+ }
+ }
+ break;
+ case Gfbanim.VectorTrack.FixedVectorTrack:
+ {
+ var trans = boneAnim.Translate();
+ if (trans.HasValue)
+ {
+ var vec = trans.Value.Value.Value;
+ groupAnim.TranslateX.KeyFrames.Add(new STKeyFrame(0, vec.X));
+ groupAnim.TranslateY.KeyFrames.Add(new STKeyFrame(0, vec.Y));
+ groupAnim.TranslateZ.KeyFrames.Add(new STKeyFrame(0, vec.Z));
+ }
+ }
+ break;
+ }
+ }
+
+ public float ConvertRotation(ushort val)
+ {
+ return val;
+ }
+
+ public STAnimationTrack[] LoadRotationTrack(Gfbanim.DynamicQuatTrack dynamicTrack)
+ {
+ STAnimationTrack[] tracks = new STAnimationTrack[3];
+ tracks[0] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[1] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[2] = new STAnimationTrack(STInterpoaltionType.Linear);
+
+ for (int i = 0; i < dynamicTrack.ValuesLength; i++)
+ {
+ var quat = dynamicTrack.Values(i).Value;
+ tracks[0].KeyFrames.Add(new STKeyFrame(i, ConvertRotation(quat.X)));
+ tracks[1].KeyFrames.Add(new STKeyFrame(i, ConvertRotation(quat.Y)));
+ tracks[2].KeyFrames.Add(new STKeyFrame(i, ConvertRotation(quat.Z)));
+
+ Console.WriteLine($"{i} { ConvertRotation(quat.X)} { ConvertRotation(quat.Y)} {ConvertRotation(quat.Z)}");
+ }
+ return tracks;
+ }
+
+ public STAnimationTrack[] LoadVectorTrack(Gfbanim.DynamicVectorTrack dynamicTrack)
+ {
+ STAnimationTrack[] tracks = new STAnimationTrack[3];
+ tracks[0] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[1] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[2] = new STAnimationTrack(STInterpoaltionType.Linear);
+
+ for (int i = 0; i < dynamicTrack.ValuesLength; i++)
+ {
+ var vec = dynamicTrack.Values(i).Value;
+ tracks[0].KeyFrames.Add(new STKeyFrame(i, vec.X));
+ tracks[1].KeyFrames.Add(new STKeyFrame(i, vec.Y));
+ tracks[2].KeyFrames.Add(new STKeyFrame(i, vec.Z));
+ }
+ return tracks;
+ }
+
+ public STAnimationTrack[] LoadVectorTrack(Gfbanim.FramedVectorTrack framedTrack)
+ {
+ ushort[] frames = framedTrack.GetFramesArray();
+
+ STAnimationTrack[] tracks = new STAnimationTrack[3];
+ tracks[0] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[1] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[2] = new STAnimationTrack(STInterpoaltionType.Linear);
+
+ for (int i = 0; i < framedTrack.ValuesLength; i++)
+ {
+ var vec = framedTrack.Values(i).Value;
+ int frame = i;
+
+ if (i < frames?.Length) frame = frames[i];
+
+ tracks[0].KeyFrames.Add(new STKeyFrame(frame, vec.X));
+ tracks[1].KeyFrames.Add(new STKeyFrame(frame, vec.Y));
+ tracks[2].KeyFrames.Add(new STKeyFrame(frame, vec.Z));
+ }
+ return tracks;
+ }
+
+ public STAnimationTrack[] LoadRotationTrack(Gfbanim.FramedQuatTrack framedTrack)
+ {
+ ushort[] frames = framedTrack.GetFramesArray();
+
+ STAnimationTrack[] tracks = new STAnimationTrack[3];
+ tracks[0] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[1] = new STAnimationTrack(STInterpoaltionType.Linear);
+ tracks[2] = new STAnimationTrack(STInterpoaltionType.Linear);
+
+ for (int i = 0; i < framedTrack.ValuesLength; i++)
+ {
+ var quat = framedTrack.Values(i).Value;
+ int frame = i;
+
+ if (i < frames?.Length) frame = frames[i];
+
+ tracks[0].KeyFrames.Add(new STKeyFrame(frame, ConvertRotation(quat.X)));
+ tracks[1].KeyFrames.Add(new STKeyFrame(frame, ConvertRotation(quat.Y)));
+ tracks[2].KeyFrames.Add(new STKeyFrame(frame, ConvertRotation(quat.Z)));
+ }
+ return tracks;
+ }
+
+ public void LoadMaterialGroup(Gfbanim.Material matAnim)
+ {
+
+ }
+
+ public void LoadVisibilyGroup(Gfbanim.Group visAnim)
+ {
+
+ }
+
+ public void LoadTriggerGroup(Gfbanim.Trigger triggerAnim)
+ {
+
+ }
+
+ private STAnimationTrack LoadTrack(float[] Frames, float[] Values)
+ {
+ STAnimationTrack track = new STAnimationTrack();
+ track.InterpolationType = STInterpoaltionType.Linear;
+ for (int i = 0; i < Values?.Length; i++)
+ {
+ STKeyFrame keyFrame = new STKeyFrame();
+ keyFrame.Value = Values[i];
+ keyFrame.Value = Frames[i];
+ track.KeyFrames.Add(keyFrame);
+ }
+ return track;
}
}
- public class FlatTableParse : Attribute { }
- public class OffsetProperty : Attribute { }
-
- [OffsetProperty]
- public class Config : GFSection
+ public class BoneGroup : STAnimGroup
{
- [FlatTableParse]
- public int Unknown { get; set; }
- [FlatTableParse]
- public uint NumKeyFrames { get; set; }
- [FlatTableParse]
- public uint FramesPerSecond { get; set; }
+ public STAnimationTrack TranslateX = new STAnimationTrack();
+ public STAnimationTrack TranslateY = new STAnimationTrack();
+ public STAnimationTrack TranslateZ = new STAnimationTrack();
+
+ public STAnimationTrack RotationX = new STAnimationTrack();
+ public STAnimationTrack RotationY = new STAnimationTrack();
+ public STAnimationTrack RotationZ = new STAnimationTrack();
+ public STAnimationTrack RotationW = new STAnimationTrack();
+
+ public STAnimationTrack ScaleX = new STAnimationTrack();
+ public STAnimationTrack ScaleY = new STAnimationTrack();
+ public STAnimationTrack ScaleZ = new STAnimationTrack();
+
+ public override List GetTracks()
+ {
+ List anims = new List();
+ anims.Add(TranslateX); anims.Add(TranslateY); anims.Add(TranslateZ);
+ anims.Add(RotationX); anims.Add(RotationY); anims.Add(RotationZ);
+ anims.Add(ScaleX); anims.Add(ScaleY); anims.Add(ScaleZ);
+ return anims;
+ }
}
- [OffsetProperty]
- public class BoneList : GFSection
+ public class MaterialGroup : STAnimGroup
{
- [FlatTableParse]
- public List Bones = new List