public override void Serialize(MoSerializer archive) { archive.WriteByteString(Signature, 30); archive.Serialize(new SizeWrapper(OutputSize)); archive.WriteInt32(TimelinePanelWidth); archive.WriteSingle(AngleOfView); archive.WriteByte((byte)(IsModelSelected ? 0 : 1)); archive.Serialize(PanelExpansion); archive.WriteByte(SelectedModelIndex); archive.WriteByte((byte)Models.Count); foreach (var model in Models) { archive.Serialize(model); } archive.Serialize(Camera); archive.Serialize(Light); archive.WriteByte(SelectedAccessoryIndex); archive.WriteInt32(TimelinePanelTopAccessoryIndex); archive.WriteByte((byte)Accessories.Count); foreach (var acc in Accessories.OrderBy(p => p.RenderingOrder)) { archive.WriteByteString(acc.Name, 100); } archive.SerializeListWithoutCount(Accessories); archive.Serialize(TimelinePanelStatus); archive.WriteInt32((int)BoneSelectionType); archive.WriteByte((byte)(CameraFollowingType)); archive.Serialize(PreviewPanel); archive.Serialize(Media); archive.WriteByte((byte)(IsInformationVisible ? 1 : 0)); archive.WriteByte((byte)(IsAxesVisible ? 1 : 0)); archive.WriteByte((byte)(IsSurfaceShadowEnabled ? 1 : 0)); archive.WriteSingle(FpsLimit); archive.WriteInt32((int)ScreenCapturingMode); archive.WriteInt32(AccessoryRenderedAfterModelIndex); archive.WriteSingle(SurfaceShadowBrightness); archive.WriteByte((byte)(IsSurfaceShadowTransparent ? 1 : 0)); archive.WriteByte((byte)PhysicsMode); archive.Serialize(Gravity); archive.Serialize(SelfShadow); archive.Serialize(new Int32ColorWrapper(EdgeColor)); archive.WriteByte((byte)(IsBackgroundBlack ? 1 : 0)); archive.Serialize(new BoneReferenceWrapper(CameraFollowingBone)); // unknown 64bits sequence(like matrix) for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { archive.WriteSingle(i == j ? 1 : 0); } } archive.WriteByte((byte)(IsFollowingViewEnabled ? 1 : 0)); archive.WriteByte(0); // unknown archive.WriteByte((byte)(IsGroundPhysicsEnabled ? 1 : 0)); archive.WriteInt32(FrameJumpingBoxValue); archive.WriteByte(1); archive.SerializeListWithoutCount(RangeSelections); }
public override void Serialize(MoSerializer archive) { archive.WriteByte(Index); archive.WriteVariableString(Name); archive.WriteVariableString(NameEn); archive.WriteByteString(Path, 256); archive.WriteByte(TimelinePanelRowsCount); archive.WriteInt32(BoneNames.Count); foreach (string name in BoneNames) { archive.WriteVariableString(name); } archive.WriteInt32(MorphNames.Count); foreach (string name in MorphNames) { archive.WriteVariableString(name); } archive.WriteInt32(IKBoneIndices.Count); foreach (int idx in IKBoneIndices) { archive.WriteInt32(idx); } archive.WriteInt32(ExternalParentBoneIndices.Count); foreach (int idx in ExternalParentBoneIndices) { archive.WriteInt32(idx); } archive.WriteByte(RenderingOrder); archive.WriteByte((byte)(IsVisible ? 1 : 0)); archive.WriteInt32(SelectedBoneIndex); archive.Serialize(MorphPanel); archive.WriteByte((byte)BoneGroupsExpansion.Count); foreach (bool item in BoneGroupsExpansion) { archive.WriteByte((byte)(item ? 1 : 0)); } archive.WriteInt32(TimelinePanelTopRowIndex); archive.WriteInt32(LastFrameIndex); archive.SerializeListWithoutCount(InitialBoneKeyFrames); archive.SerializeList(BoneKeyFrames); archive.SerializeListWithoutCount(InitialMorphKeyFrames); archive.SerializeList(MorphKeyFrames); archive.Serialize(InitialModelKeyFrame); archive.SerializeList(ModelKeyFrames); archive.SerializeListWithoutCount(CurrentBoneStatuses); archive.SerializeListWithoutCount(CurrentMorphStatuses); foreach (bool status in IKBonesEnabled) { archive.WriteByte((byte)(status ? 1 : 0)); } archive.SerializeListWithoutCount(ExternalParentStatuses); archive.WriteByte((byte)(IsAdditiveBlending ? 1 : 0)); archive.WriteSingle(EdgeWidth); archive.WriteByte((byte)(IsSelfShadowEnabled ? 1 : 0)); archive.WriteByte(CalculationOrder); }