internal override void Write(ResourceWriter writer) { writer.WriteInt32(( int )KeyframeType); writer.WriteInt32(Keyframes.Count); KeyframeTimings.ForEach(writer.WriteSingle); Keyframes.ForEach(x => x.Write(writer)); if (UsesScaleVectors()) { writer.WriteVector3(PositionScale); writer.WriteVector3(ScaleScale); } }
protected override void WriteCore(ResourceWriter writer) { writer.WriteInt32(( int )KeyType); writer.WriteInt32(Keys.Count); Keys.ForEach(x => writer.WriteSingle(x.Time)); Keys.ForEach(x => x.Write(writer)); if (UsesScaleVectors) { writer.WriteVector3(PositionScale); if (!IsCatherineFullBodyData || KeyType != KeyType.Type31) { writer.WriteVector3(ScaleScale); } } }
internal override void Write(ResourceWriter writer) { writer.WriteInt32(Flags); writer.WriteInt32(VertexCount); foreach (var vertex in Vertices) { writer.WriteVector3(vertex); } }
internal override void Write(ResourceWriter writer) { switch (Type) { case KeyframeType.NodePR: case KeyframeType.NodePRS: writer.WriteVector3(Position); writer.WriteQuaternion(Rotation); if (Type == KeyframeType.NodePRS) { writer.WriteVector3(Scale); } break; case KeyframeType.NodePRHalf: case KeyframeType.NodePRSHalf: case KeyframeType.NodePRHalf_2: writer.WriteVector3Half(Position); writer.WriteQuaternionHalf(Rotation); if (Type == KeyframeType.NodePRSHalf) { writer.WriteVector3Half(Scale); } break; case KeyframeType.NodePHalf: writer.WriteVector3Half(Position); break; case KeyframeType.NodeRHalf: writer.WriteQuaternionHalf(Rotation); break; case KeyframeType.NodeSHalf: writer.WriteVector3Half(Scale); break; default: throw new InvalidOperationException(nameof(Type)); } }
protected override void WriteCore(ResourceWriter writer) { writer.WriteInt32(Count); foreach (var property in Values) { writer.WriteInt32(( int )property.ValueType); writer.WriteStringWithHash(Version, property.Name); switch (property.ValueType) { case UserPropertyValueType.Int: writer.WriteInt32(4); writer.WriteInt32(property.GetValue <int>()); break; case UserPropertyValueType.Float: writer.WriteInt32(4); writer.WriteSingle(property.GetValue <float>()); break; case UserPropertyValueType.Bool: writer.WriteInt32(1); writer.WriteBoolean(property.GetValue <bool>()); break; case UserPropertyValueType.String: { var value = property.GetValue <string>(); writer.WriteInt32(value.Length + 1); writer.WriteStringRaw(value); } break; case UserPropertyValueType.ByteVector3: writer.WriteInt32(3); writer.WriteByteVector3(property.GetValue <ByteVector3>()); break; case UserPropertyValueType.ByteVector4: writer.WriteInt32(4); writer.WriteByteVector4(property.GetValue <ByteVector4>()); break; case UserPropertyValueType.Vector3: writer.WriteInt32(12); writer.WriteVector3(property.GetValue <Vector3>()); break; case UserPropertyValueType.Vector4: writer.WriteInt32(16); writer.WriteVector4(property.GetValue <Vector4>()); break; case UserPropertyValueType.ByteArray: { var value = property.GetValue <byte[]>(); writer.WriteInt32(value.Length); writer.WriteBytes(value); } break; default: throw new InvalidOperationException($"Unknown node property type: {property.ValueType}"); } } }
internal override void Write(ResourceWriter writer) { writer.WriteVector3(Value); }