Ejemplo n.º 1
0
 public override void Serialize(MoSerializer archive)
 {
     archive.Serialize(new Vector3Wrapper(CenterPosition));
     archive.Serialize(new Vector3Wrapper(OffsetPosition));
     archive.Serialize(new Vector3Wrapper(Rotation));
     archive.WriteByte((byte)(IsPerspectiveEnabled ? 0 : 1));
 }
Ejemplo n.º 2
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteInt32(EyebrowIndex);
     archive.WriteInt32(EyeIndex);
     archive.WriteInt32(LipIndex);
     archive.WriteInt32(OtherIndex);
 }
Ejemplo n.º 3
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteInt32(CurrentKeyFrameIndex);
     archive.WriteInt32(NextKeyFrameIndex);
     archive.WriteInt32(ExternalParent.ModelIndex);
     archive.WriteInt32(ExternalParent.BoneIndex);
 }
Ejemplo n.º 4
0
 internal override void SerializeKeyFrameValue(MoSerializer archive)
 {
     archive.WriteByte((byte)(Value.IsNoiseEnabled ? 1 : 0));
     archive.WriteInt32(Value.NoiseAmount);
     archive.WriteSingle(Value.Acceleration);
     archive.Serialize(new Vector3Wrapper(Value.Direction));
 }
Ejemplo n.º 5
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteSingle(Acceleration);
     archive.WriteInt32(NoiseAmount);
     archive.Serialize(new Vector3Wrapper(Direction));
     archive.WriteByte((byte)(IsNoiseEnabled ? 1 : 0));
 }
Ejemplo n.º 6
0
 public override void Serialize(MoSerializer archive)
 {
     archive.Serialize(new PointWrapper(Position));
     archive.WriteSingle(Scale);
     archive.WriteByteString(Path, 256);
     archive.WriteByte((byte)(IsVisible ? 1 : 0));
 }
Ejemplo n.º 7
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteSingle(Value.X);
     archive.WriteSingle(Value.Y);
     archive.WriteSingle(Value.Z);
     archive.WriteSingle(Value.W);
 }
Ejemplo n.º 8
0
        public override void Serialize(MoSerializer archive)
        {
            archive.WriteByte(X.First.X);
            archive.WriteByte(X.Second.X);
            archive.WriteByte(X.First.Y);
            archive.WriteByte(X.Second.Y);

            archive.WriteByte(Y.First.X);
            archive.WriteByte(Y.Second.X);
            archive.WriteByte(Y.First.Y);
            archive.WriteByte(Y.Second.Y);

            archive.WriteByte(Z.First.X);
            archive.WriteByte(Z.Second.X);
            archive.WriteByte(Z.First.Y);
            archive.WriteByte(Z.Second.Y);

            archive.WriteByte(R.First.X);
            archive.WriteByte(R.Second.X);
            archive.WriteByte(R.First.Y);
            archive.WriteByte(R.Second.Y);

            archive.WriteByte(D.First.X);
            archive.WriteByte(D.Second.X);
            archive.WriteByte(D.First.Y);
            archive.WriteByte(D.Second.Y);

            archive.WriteByte(V.First.X);
            archive.WriteByte(V.Second.X);
            archive.WriteByte(V.First.Y);
            archive.WriteByte(V.Second.Y);
        }
Ejemplo n.º 9
0
 internal override void SerializeKeyFrame(MoSerializer archive)
 {
     archive.Serialize(Value.Interpolation);
     archive.Serialize(new Vector3Wrapper(Value.Position));
     archive.Serialize(new QuaternionWrapper(Value.Quaternion));
     archive.WriteByte((byte)(IsSelected ? 1 : 0));
     archive.WriteByte((byte)(Value.IsPhysicsEnabled ? 0 : 1));
 }
Ejemplo n.º 10
0
 public override void Serialize(MoSerializer archive)
 {
     archive.Serialize(new Vector3Wrapper(Position));
     archive.Serialize(new QuaternionWrapper(Quaternion));
     archive.WriteByte((byte)(IsSaved ? 0 : 1));
     archive.WriteByte((byte)(IsPhysicsEnabled ? 0 : 1));
     archive.WriteByte((byte)(IsRowSelected ? 1 : 0));
 }
Ejemplo n.º 11
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteByteString(BoneName, 15);
     archive.WriteInt32(KeyFrameIndex);
     archive.Serialize(new Vector3Wrapper(Position));
     archive.Serialize(new QuaternionWrapper(Quaternion));
     archive.Serialize(Interpolation);
 }
Ejemplo n.º 12
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteByte((byte)(IsRepeating ? 1 : 0));
     archive.WriteByte((byte)(IsStayingAtStoppedFrame ? 1 : 0));
     archive.WriteByte((byte)(IsStartingFromCurrentFrame ? 1 : 0));
     archive.WriteInt32(StartFrameIndex);
     archive.WriteInt32(EndFrameIndex);
 }
Ejemplo n.º 13
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteByte((byte)(Camera ? 1 : 0));
     archive.WriteByte((byte)(Light ? 1 : 0));
     archive.WriteByte((byte)(Accessory ? 1 : 0));
     archive.WriteByte((byte)(Bone ? 1 : 0));
     archive.WriteByte((byte)(Morph ? 1 : 0));
     archive.WriteByte((byte)(SelfShadow ? 1 : 0));
 }
Ejemplo n.º 14
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteInt32(KeyFrameIndex);
     archive.WriteSingle(-Distance);
     archive.Serialize(new Vector3Wrapper(Position));
     archive.Serialize(new Vector3Wrapper(new Vector3(-Rotation.X, Rotation.Y, Rotation.Z)));
     archive.Serialize(Interpolation);
     archive.WriteInt32(AngleOfView);
     archive.WriteByte((byte)(IsPerspectiveEnabled ? 0 : 1));
 }
Ejemplo n.º 15
0
 public override void Serialize(MoSerializer archive)
 {
     archive.Serialize(CurrentStatus);
     if (!InitialKeyFrame.IsInitialKeyFrame)
     {
         throw new InvalidOperationException("IsInitial property of InitialKeyFrame must be true.");
     }
     archive.Serialize(InitialKeyFrame);
     archive.SerializeList(KeyFrames);
 }
Ejemplo n.º 16
0
 internal override void SerializeKeyFrameValue(MoSerializer archive)
 {
     archive.WriteSingle(-Distance);
     archive.Serialize(new Vector3Wrapper(Value.CenterPosition));
     archive.Serialize(new Vector3Wrapper(new Vector3(-Value.Rotation.X, Value.Rotation.Y, Value.Rotation.Z)));
     archive.WriteInt32(FollowingBone.ModelIndex);
     archive.WriteInt32(FollowingBone.BoneIndex);
     archive.Serialize(Interpolation);
     archive.WriteByte((byte)(Value.IsPerspectiveEnabled ? 0 : 1));
     archive.WriteInt32(AngleOfView);
 }
Ejemplo n.º 17
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteByteString(Signature, 30);
     archive.WriteByteString(ModelName, 20);
     archive.SerializeList(BoneKeyFrames);
     archive.SerializeList(MorphKeyFrames);
     archive.SerializeList(CameraKeyFrames);
     archive.SerializeList(LightKeyFrames);
     archive.SerializeList(SelfShadowKeyFrames);
     archive.SerializeList(ModelKeyFrames);
 }
Ejemplo n.º 18
0
 public override void Serialize(MoSerializer archive)
 {
     if (!IsInitialKeyFrame)
     {
         archive.WriteInt32(DataIndex);
     }
     archive.WriteInt32(KeyFrameIndex);
     archive.WriteInt32(PreviousDataIndex);
     archive.WriteInt32(NextDataIndex);
     SerializeKeyFrame(archive);
 }
Ejemplo n.º 19
0
        public override void Serialize(MoSerializer archive)
        {
            byte data = (byte)((int)(100 - 100 * Opacity) << 1);

            data |= (byte)(IsVisible ? 1 : 0);
            archive.WriteByte(data);
            archive.WriteInt32(ExternalParent.ModelIndex);
            archive.WriteInt32(ExternalParent.BoneIndex);
            archive.Serialize(new Vector3Wrapper(Position));
            archive.Serialize(new Vector3Wrapper(Rotation));
            archive.WriteSingle(Scale);
            archive.WriteByte((byte)(IsShadowEnabled ? 1 : 0));
        }
Ejemplo n.º 20
0
        public override void Serialize(MoSerializer archive)
        {
            archive.WriteByte((byte)(IsVisible ? 1 : 0));

            foreach (bool status in IKEnabled)
            {
                archive.WriteByte((byte)(status ? 1 : 0));
            }

            foreach (var item in ExternalParentBoneStatuses)
            {
                new BoneReferenceWrapper(item).Serialize(archive);
            }
        }
Ejemplo n.º 21
0
        public override void Serialize(MoSerializer archive)
        {
            archive.WriteByte(Index);
            archive.WriteByteString(Name, 100);
            archive.WriteByteString(Path, 256);
            archive.WriteByte(RenderingOrder);

            if (!InitialKeyFrame.IsInitialKeyFrame)
            {
                throw new InvalidOperationException("IsInitial property of InitialKeyFrame must be true.");
            }
            archive.Serialize(InitialKeyFrame);
            archive.SerializeList(KeyFrames);
            archive.Serialize(CurrentStatus);
            archive.WriteByte((byte)(IsAdditiveBlending ? 1 : 0));
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
 internal override void SerializeKeyFrameValue(MoSerializer archive)
 {
     archive.Serialize(Value);
 }
Ejemplo n.º 24
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteByte(ModelIndex);
     archive.WriteInt32(SelectedIndex);
 }
Ejemplo n.º 25
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteSingle((float)((10000 - Distance) / 100000.0));
 }
Ejemplo n.º 26
0
 internal override void SerializeKeyFrameValue(MoSerializer archive)
 {
     archive.WriteByte((byte)SelfShadowType);
     base.SerializeKeyFrameValue(archive);
 }
Ejemplo n.º 27
0
 /// <summary>
 /// When overridden in a derived class, serializes the value of this key frame by its own way.
 /// </summary>
 /// <param name="archive">The instance of <see cref="MoSerializer"/> to serialize</param>
 internal virtual void SerializeKeyFrameValue(MoSerializer archive)
 {
     archive.Serialize(Value);
 }
Ejemplo n.º 28
0
 public override void Serialize(MoSerializer archive)
 {
     throw new InvalidOperationException("This instance will not be serialized directly.");
 }
Ejemplo n.º 29
0
 public override void Serialize(MoSerializer archive)
 {
     archive.WriteSingle((float)(Value.R / 256.0));
     archive.WriteSingle((float)(Value.G / 256.0));
     archive.WriteSingle((float)(Value.B / 256.0));
 }
Ejemplo n.º 30
0
        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);
        }