public void ToStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f = null)
        {
            PmxStreamHelper.WriteString(s, Name, f);
            PmxStreamHelper.WriteString(s, NameE, f);
            V4_BytesConvert.ToStream(s, Diffuse);
            V3_BytesConvert.ToStream(s, Specular);
            PmxStreamHelper.WriteElement_Float(s, Power);
            V3_BytesConvert.ToStream(s, Ambient);
            s.WriteByte((byte)Flags);
            V4_BytesConvert.ToStream(s, EdgeColor);
            PmxStreamHelper.WriteElement_Float(s, EdgeSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Tex), f.TexSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Sphere), f.TexSize);
            s.WriteByte((byte)SphereMode);
            int toonIndex = SystemToon.GetToonIndex(Toon);

            if (toonIndex < 0)
            {
                s.WriteByte(0);
                PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(Toon), f.TexSize);
            }
            else
            {
                s.WriteByte(1);
                s.WriteByte((byte)toonIndex);
            }
            PmxStreamHelper.WriteString(s, Memo, f);
            PmxStreamHelper.WriteElement_Int32(s, FaceCount);
            if (f.WithID)
            {
                PmxStreamHelper.WriteElement_UInt(s, base.UID);
                PmxStreamHelper.WriteElement_UInt(s, base.CID);
            }
        }
Esempio n. 2
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     if (Kind != 0 && f.Ver < 2.1f)
     {
         s.WriteByte(0);
     }
     else
     {
         s.WriteByte((byte)Kind);
     }
     PmxStreamHelper.WriteElement_Int32(s, BodyA, f.BodySize);
     PmxStreamHelper.WriteElement_Int32(s, BodyB, f.BodySize);
     V3_BytesConvert.ToStream(s, Position);
     V3_BytesConvert.ToStream(s, Rotation);
     V3_BytesConvert.ToStream(s, Limit_MoveLow);
     V3_BytesConvert.ToStream(s, Limit_MoveHigh);
     V3_BytesConvert.ToStream(s, Limit_AngleLow);
     V3_BytesConvert.ToStream(s, Limit_AngleHigh);
     V3_BytesConvert.ToStream(s, SpConst_Move);
     V3_BytesConvert.ToStream(s, SpConst_Rotate);
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
        // Token: 0x060001AB RID: 427 RVA: 0x000102D8 File Offset: 0x0000E4D8
        public void ToStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f)
        {
            PmxStreamHelper.WriteString(s, this.Name, f);
            PmxStreamHelper.WriteString(s, this.NameE, f);
            V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.Diffuse));
            V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Specular));
            PmxStreamHelper.WriteElement_Float(s, this.Power);
            V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Ambient));
            s.WriteByte((byte)this.Flags);
            V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.EdgeColor));
            PmxStreamHelper.WriteElement_Float(s, this.EdgeSize);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Tex), f.TexSize, true);
            PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Sphere), f.TexSize, true);
            s.WriteByte((byte)this.SphereMode);
            int  toonIndex = SystemToon.GetToonIndex(this.Toon);
            bool flag      = toonIndex < 0;

            if (flag)
            {
                s.WriteByte(0);
                PmxStreamHelper.WriteElement_Int32(s, tx.GetIndex(this.Toon), f.TexSize, true);
            }
            else
            {
                s.WriteByte(1);
                s.WriteByte((byte)toonIndex);
            }
            PmxStreamHelper.WriteString(s, this.Memo, f);
            PmxStreamHelper.WriteElement_Int32(s, this.FaceCount, 4, true);
        }
Esempio n. 4
0
        // Token: 0x06000188 RID: 392 RVA: 0x0000FA90 File Offset: 0x0000DC90
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            PmxStreamHelper.WriteString(s, this.Name, f);
            PmxStreamHelper.WriteString(s, this.NameE, f);
            bool flag = this.Kind != PmxJoint.JointKind.Sp6DOF && f.Ver < 2.1f;

            if (flag)
            {
                s.WriteByte(0);
            }
            else
            {
                s.WriteByte((byte)this.Kind);
            }
            PmxStreamHelper.WriteElement_Int32(s, this.BodyA, f.BodySize, true);
            PmxStreamHelper.WriteElement_Int32(s, this.BodyB, f.BodySize, true);
            V3_BytesConvert.ToStream(s, this.Position);
            V3_BytesConvert.ToStream(s, this.Rotation);
            V3_BytesConvert.ToStream(s, this.Limit_MoveLow);
            V3_BytesConvert.ToStream(s, this.Limit_MoveHigh);
            V3_BytesConvert.ToStream(s, this.Limit_AngleLow);
            V3_BytesConvert.ToStream(s, this.Limit_AngleHigh);
            V3_BytesConvert.ToStream(s, this.SpConst_Move);
            V3_BytesConvert.ToStream(s, this.SpConst_Rotate);
        }
 // Token: 0x060001DF RID: 479 RVA: 0x00010BC3 File Offset: 0x0000EDC3
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.ModelName, f);
     PmxStreamHelper.WriteString(s, this.ModelNameE, f);
     PmxStreamHelper.WriteString(s, this.Comment, f);
     PmxStreamHelper.WriteString(s, this.CommentE, f);
 }
        public void ToStreamEx(Stream s, PmxElementFormat f = null)
        {
            if (IsImpulse && f.Ver < 2.1f)
            {
                return;
            }
            PmxStreamHelper.WriteString(s, Name, f);
            PmxStreamHelper.WriteString(s, NameE, f);
            PmxStreamHelper.WriteElement_Int32(s, Panel, 1);
            if (IsFlip && f.Ver < 2.1f)
            {
                PmxStreamHelper.WriteElement_Int32(s, 0, 1);
            }
            else
            {
                PmxStreamHelper.WriteElement_Int32(s, (int)Kind, 1);
            }
            PmxStreamHelper.WriteElement_Int32(s, OffsetList.Count);
            for (int i = 0; i < OffsetList.Count; i++)
            {
                switch (Kind)
                {
                case OffsetKind.Group:
                case OffsetKind.Flip:
                    (OffsetList[i] as PmxGroupMorph).ToStreamEx(s, f);
                    break;

                case OffsetKind.Vertex:
                    (OffsetList[i] as PmxVertexMorph).ToStreamEx(s, f);
                    break;

                case OffsetKind.Bone:
                    (OffsetList[i] as PmxBoneMorph).ToStreamEx(s, f);
                    break;

                case OffsetKind.Impulse:
                    (OffsetList[i] as PmxImpulseMorph).ToStreamEx(s, f);
                    break;

                case OffsetKind.Material:
                    (OffsetList[i] as PmxMaterialMorph).ToStreamEx(s, f);
                    break;

                case OffsetKind.UV:
                case OffsetKind.UVA1:
                case OffsetKind.UVA2:
                case OffsetKind.UVA3:
                case OffsetKind.UVA4:
                    (OffsetList[i] as PmxUVMorph).ToStreamEx(s, f);
                    break;
                }
            }
            if (f.WithID)
            {
                PmxStreamHelper.WriteElement_UInt(s, base.UID);
                PmxStreamHelper.WriteElement_UInt(s, base.CID);
            }
        }
Esempio n. 7
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, (int)Shape, 1);
     PmxStreamHelper.WriteElement_Int32(s, Material, f.MaterialSize);
     PmxStreamHelper.WriteElement_Int32(s, Group, 1);
     PmxStreamHelper.WriteElement_Int32(s, PassGroup.ToFlagBits(), 2, signed: false);
     PmxStreamHelper.WriteElement_Int32(s, (int)Flags, 1, signed: false);
     PmxStreamHelper.WriteElement_Int32(s, BendingLinkDistance);
     PmxStreamHelper.WriteElement_Int32(s, ClusterCount);
     PmxStreamHelper.WriteElement_Float(s, TotalMass);
     PmxStreamHelper.WriteElement_Float(s, Margin);
     PmxStreamHelper.WriteElement_Int32(s, Config.AeroModel);
     PmxStreamHelper.WriteElement_Float(s, Config.VCF);
     PmxStreamHelper.WriteElement_Float(s, Config.DP);
     PmxStreamHelper.WriteElement_Float(s, Config.DG);
     PmxStreamHelper.WriteElement_Float(s, Config.LF);
     PmxStreamHelper.WriteElement_Float(s, Config.PR);
     PmxStreamHelper.WriteElement_Float(s, Config.VC);
     PmxStreamHelper.WriteElement_Float(s, Config.DF);
     PmxStreamHelper.WriteElement_Float(s, Config.MT);
     PmxStreamHelper.WriteElement_Float(s, Config.CHR);
     PmxStreamHelper.WriteElement_Float(s, Config.KHR);
     PmxStreamHelper.WriteElement_Float(s, Config.SHR);
     PmxStreamHelper.WriteElement_Float(s, Config.AHR);
     PmxStreamHelper.WriteElement_Float(s, Config.SRHR_CL);
     PmxStreamHelper.WriteElement_Float(s, Config.SKHR_CL);
     PmxStreamHelper.WriteElement_Float(s, Config.SSHR_CL);
     PmxStreamHelper.WriteElement_Float(s, Config.SR_SPLT_CL);
     PmxStreamHelper.WriteElement_Float(s, Config.SK_SPLT_CL);
     PmxStreamHelper.WriteElement_Float(s, Config.SS_SPLT_CL);
     PmxStreamHelper.WriteElement_Int32(s, Config.V_IT);
     PmxStreamHelper.WriteElement_Int32(s, Config.P_IT);
     PmxStreamHelper.WriteElement_Int32(s, Config.D_IT);
     PmxStreamHelper.WriteElement_Int32(s, Config.C_IT);
     PmxStreamHelper.WriteElement_Float(s, MaterialConfig.LST);
     PmxStreamHelper.WriteElement_Float(s, MaterialConfig.AST);
     PmxStreamHelper.WriteElement_Float(s, MaterialConfig.VST);
     PmxStreamHelper.WriteElement_Int32(s, BodyAnchorList.Count);
     for (int i = 0; i < BodyAnchorList.Count; i++)
     {
         PmxStreamHelper.WriteElement_Int32(s, BodyAnchorList[i].Body, f.BodySize);
         PmxStreamHelper.WriteElement_Int32(s, BodyAnchorList[i].Vertex, f.VertexSize, signed: false);
         PmxStreamHelper.WriteElement_Int32(s, BodyAnchorList[i].IsNear ? 1 : 0, 1);
     }
     PmxStreamHelper.WriteElement_Int32(s, VertexPinList.Count);
     for (int j = 0; j < VertexPinList.Count; j++)
     {
         PmxStreamHelper.WriteElement_Int32(s, VertexPinList[j].Vertex, f.VertexSize, signed: false);
     }
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
        public void ToStreamEx(Stream s, PmxElementFormat f = null)
        {
            int count = Count;

            PmxStreamHelper.WriteElement_Int32(s, count);
            for (int i = 0; i < count; i++)
            {
                PmxStreamHelper.WriteString(s, IndexToName[i], f);
            }
        }
        // Token: 0x0600025C RID: 604 RVA: 0x00013210 File Offset: 0x00011410
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            int count = this.Count;

            PmxStreamHelper.WriteElement_Int32(s, count, 4, true);
            for (int i = 0; i < count; i++)
            {
                PmxStreamHelper.WriteString(s, this.IndexToName[i], f);
            }
        }
Esempio n. 10
0
        // Token: 0x060001F7 RID: 503 RVA: 0x000110B0 File Offset: 0x0000F2B0
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            bool flag = !this.IsImpulse || f.Ver >= 2.1f;

            if (flag)
            {
                PmxStreamHelper.WriteString(s, this.Name, f);
                PmxStreamHelper.WriteString(s, this.NameE, f);
                PmxStreamHelper.WriteElement_Int32(s, this.Panel, 1, true);
                bool flag2 = this.IsFlip && f.Ver < 2.1f;
                if (flag2)
                {
                    PmxStreamHelper.WriteElement_Int32(s, 0, 1, true);
                }
                else
                {
                    PmxStreamHelper.WriteElement_Int32(s, (int)this.Kind, 1, true);
                }
                PmxStreamHelper.WriteElement_Int32(s, this.OffsetList.Count, 4, true);
                for (int i = 0; i < this.OffsetList.Count; i++)
                {
                    switch (this.Kind)
                    {
                    case PmxMorph.OffsetKind.Group:
                    case PmxMorph.OffsetKind.Flip:
                        (this.OffsetList[i] as PmxGroupMorph).ToStreamEx(s, f);
                        break;

                    case PmxMorph.OffsetKind.Vertex:
                        (this.OffsetList[i] as PmxVertexMorph).ToStreamEx(s, f);
                        break;

                    case PmxMorph.OffsetKind.Bone:
                        (this.OffsetList[i] as PmxBoneMorph).ToStreamEx(s, f);
                        break;

                    case PmxMorph.OffsetKind.UV:
                    case PmxMorph.OffsetKind.UVA1:
                    case PmxMorph.OffsetKind.UVA2:
                    case PmxMorph.OffsetKind.UVA3:
                    case PmxMorph.OffsetKind.UVA4:
                        (this.OffsetList[i] as PmxUVMorph).ToStreamEx(s, f);
                        break;

                    case PmxMorph.OffsetKind.Material:
                        (this.OffsetList[i] as PmxMaterialMorph).ToStreamEx(s, f);
                        break;

                    case PmxMorph.OffsetKind.Impulse:
                        (this.OffsetList[i] as PmxImpulseMorph).ToStreamEx(s, f);
                        break;
                    }
                }
            }
        }
Esempio n. 11
0
 // Token: 0x06000205 RID: 517 RVA: 0x00011468 File Offset: 0x0000F668
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.Name, f);
     PmxStreamHelper.WriteString(s, this.NameE, f);
     s.WriteByte(this.SystemNode ? 1 : 0);
     PmxStreamHelper.WriteElement_Int32(s, this.ElementList.Count, 4, true);
     for (int i = 0; i < this.ElementList.Count; i++)
     {
         this.ElementList[i].ToStreamEx(s, f);
     }
 }
Esempio n. 12
0
        // Token: 0x06000107 RID: 263 RVA: 0x0000E6B4 File Offset: 0x0000C8B4
        public void ToStreamEx(Stream s, PmxElementFormat f)
        {
            PmxStreamHelper.WriteString(s, this.Name, f);
            PmxStreamHelper.WriteString(s, this.NameE, f);
            V3_BytesConvert.ToStream(s, this.Position);
            PmxStreamHelper.WriteElement_Int32(s, this.Parent, f.BoneSize, true);
            PmxStreamHelper.WriteElement_Int32(s, this.Level, 4, true);
            PmxStreamHelper.WriteElement_Int32(s, (int)this.Flags, 2, false);
            bool flag = this.GetFlag(PmxBone.BoneFlags.ToBone);

            if (flag)
            {
                PmxStreamHelper.WriteElement_Int32(s, this.To_Bone, f.BoneSize, true);
            }
            else
            {
                V3_BytesConvert.ToStream(s, this.To_Offset);
            }
            bool flag2 = this.GetFlag(PmxBone.BoneFlags.AppendRotation) || this.GetFlag(PmxBone.BoneFlags.AppendTranslation);

            if (flag2)
            {
                PmxStreamHelper.WriteElement_Int32(s, this.AppendParent, f.BoneSize, true);
                PmxStreamHelper.WriteElement_Float(s, this.AppendRatio);
            }
            bool flag3 = this.GetFlag(PmxBone.BoneFlags.FixAxis);

            if (flag3)
            {
                V3_BytesConvert.ToStream(s, this.Axis);
            }
            bool flag4 = this.GetFlag(PmxBone.BoneFlags.LocalFrame);

            if (flag4)
            {
                this.NormalizeLocal();
                V3_BytesConvert.ToStream(s, this.LocalX);
                V3_BytesConvert.ToStream(s, this.LocalZ);
            }
            bool flag5 = this.GetFlag(PmxBone.BoneFlags.ExtParent);

            if (flag5)
            {
                PmxStreamHelper.WriteElement_Int32(s, this.ExtKey, 4, true);
            }
            bool flag6 = this.GetFlag(PmxBone.BoneFlags.IK);

            if (flag6)
            {
                this.IK.ToStreamEx(s, f);
            }
        }
Esempio n. 13
0
 // Token: 0x0600022B RID: 555 RVA: 0x0001214C File Offset: 0x0001034C
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.Name, f);
     PmxStreamHelper.WriteString(s, this.NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, (int)this.Shape, 1, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Material, f.MaterialSize, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Group, 1, true);
     PmxStreamHelper.WriteElement_Int32(s, (int)this.PassGroup.ToFlagBits(), 2, false);
     PmxStreamHelper.WriteElement_Int32(s, (int)this.Flags, 1, false);
     PmxStreamHelper.WriteElement_Int32(s, this.BendingLinkDistance, 4, true);
     PmxStreamHelper.WriteElement_Int32(s, this.ClusterCount, 4, true);
     PmxStreamHelper.WriteElement_Float(s, this.TotalMass);
     PmxStreamHelper.WriteElement_Float(s, this.Margin);
     PmxStreamHelper.WriteElement_Int32(s, this.Config.AeroModel, 4, true);
     PmxStreamHelper.WriteElement_Float(s, this.Config.VCF);
     PmxStreamHelper.WriteElement_Float(s, this.Config.DP);
     PmxStreamHelper.WriteElement_Float(s, this.Config.DG);
     PmxStreamHelper.WriteElement_Float(s, this.Config.LF);
     PmxStreamHelper.WriteElement_Float(s, this.Config.PR);
     PmxStreamHelper.WriteElement_Float(s, this.Config.VC);
     PmxStreamHelper.WriteElement_Float(s, this.Config.DF);
     PmxStreamHelper.WriteElement_Float(s, this.Config.MT);
     PmxStreamHelper.WriteElement_Float(s, this.Config.CHR);
     PmxStreamHelper.WriteElement_Float(s, this.Config.KHR);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SHR);
     PmxStreamHelper.WriteElement_Float(s, this.Config.AHR);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SRHR_CL);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SKHR_CL);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SSHR_CL);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SR_SPLT_CL);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SK_SPLT_CL);
     PmxStreamHelper.WriteElement_Float(s, this.Config.SS_SPLT_CL);
     PmxStreamHelper.WriteElement_Int32(s, this.Config.V_IT, 4, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Config.P_IT, 4, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Config.D_IT, 4, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Config.C_IT, 4, true);
     PmxStreamHelper.WriteElement_Float(s, this.MaterialConfig.LST);
     PmxStreamHelper.WriteElement_Float(s, this.MaterialConfig.AST);
     PmxStreamHelper.WriteElement_Float(s, this.MaterialConfig.VST);
     PmxStreamHelper.WriteElement_Int32(s, this.BodyAnchorList.Count, 4, true);
     for (int i = 0; i < this.BodyAnchorList.Count; i++)
     {
         PmxStreamHelper.WriteElement_Int32(s, this.BodyAnchorList[i].Body, f.BodySize, true);
         PmxStreamHelper.WriteElement_Int32(s, this.BodyAnchorList[i].Vertex, f.VertexSize, false);
         PmxStreamHelper.WriteElement_Int32(s, this.BodyAnchorList[i].IsNear ? 1 : 0, 1, true);
     }
     PmxStreamHelper.WriteElement_Int32(s, this.VertexPinList.Count, 4, true);
     for (int j = 0; j < this.VertexPinList.Count; j++)
     {
         PmxStreamHelper.WriteElement_Int32(s, this.VertexPinList[j].Vertex, f.VertexSize, false);
     }
 }
Esempio n. 14
0
 // Token: 0x060000DE RID: 222 RVA: 0x0000DE5C File Offset: 0x0000C05C
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.Name, f);
     PmxStreamHelper.WriteString(s, this.NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, this.Bone, f.BoneSize, true);
     PmxStreamHelper.WriteElement_Int32(s, this.Group, 1, true);
     PmxStreamHelper.WriteElement_Int32(s, (int)this.PassGroup.ToFlagBits(), 2, false);
     s.WriteByte((byte)this.BoxType);
     V3_BytesConvert.ToStream(s, this.BoxSize);
     V3_BytesConvert.ToStream(s, this.Position);
     V3_BytesConvert.ToStream(s, this.Rotation);
     PmxStreamHelper.WriteElement_Float(s, this.Mass);
     V4_BytesConvert.ToStream(s, new Vector4(this.PositionDamping, this.RotationDamping, this.Restitution, this.Friction));
     s.WriteByte((byte)this.Mode);
 }
Esempio n. 15
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     V3_BytesConvert.ToStream(s, Position);
     PmxStreamHelper.WriteElement_Int32(s, Parent, f.BoneSize);
     PmxStreamHelper.WriteElement_Int32(s, Level);
     PmxStreamHelper.WriteElement_Int32(s, (int)Flags, 2, signed: false);
     if (GetFlag(BoneFlags.ToBone))
     {
         PmxStreamHelper.WriteElement_Int32(s, To_Bone, f.BoneSize);
     }
     else
     {
         V3_BytesConvert.ToStream(s, To_Offset);
     }
     if (GetFlag(BoneFlags.AddRotation) || GetFlag(BoneFlags.AddTranslation))
     {
         PmxStreamHelper.WriteElement_Int32(s, AddParent, f.BoneSize);
         PmxStreamHelper.WriteElement_Float(s, AddRatio);
     }
     if (GetFlag(BoneFlags.FixAxis))
     {
         V3_BytesConvert.ToStream(s, Axis);
     }
     if (GetFlag(BoneFlags.LocalFrame))
     {
         if (!f.WithID)
         {
             NormalizeLocal();
         }
         V3_BytesConvert.ToStream(s, LocalX);
         V3_BytesConvert.ToStream(s, LocalZ);
     }
     if (GetFlag(BoneFlags.ExtParent))
     {
         PmxStreamHelper.WriteElement_Int32(s, ExtKey);
     }
     if (GetFlag(BoneFlags.IK))
     {
         IK.ToStreamEx(s, f);
     }
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
Esempio n. 16
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     s.WriteByte((byte)(SystemNode ? 1u : 0u));
     PmxStreamHelper.WriteElement_Int32(s, ElementList.Count);
     for (int i = 0; i < ElementList.Count; i++)
     {
         ElementList[i].ToStreamEx(s, f);
     }
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     V4_BytesConvert.ToStream(s, Diffuse);
     V3_BytesConvert.ToStream(s, Specular);
     PmxStreamHelper.WriteElement_Float(s, Power);
     V3_BytesConvert.ToStream(s, Ambient);
     s.WriteByte((byte)Flags);
     V4_BytesConvert.ToStream(s, EdgeColor);
     PmxStreamHelper.WriteElement_Float(s, EdgeSize);
     PmxStreamHelper.WriteString(s, Tex, f);
     PmxStreamHelper.WriteString(s, Sphere, f);
     s.WriteByte((byte)SphereMode);
     PmxStreamHelper.WriteString(s, Toon, f);
     PmxStreamHelper.WriteString(s, Memo, f);
     PmxStreamHelper.WriteElement_Int32(s, FaceCount);
 }
 // Token: 0x060001A9 RID: 425 RVA: 0x000100B0 File Offset: 0x0000E2B0
 public void ToStreamEx(Stream s, PmxElementFormat f)
 {
     PmxStreamHelper.WriteString(s, this.Name, f);
     PmxStreamHelper.WriteString(s, this.NameE, f);
     V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.Diffuse));
     V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Specular));
     PmxStreamHelper.WriteElement_Float(s, this.Power);
     V3_BytesConvert.ToStream(s, V3_BytesConvert.ColorToVector3(this.Ambient));
     s.WriteByte((byte)this.Flags);
     V4_BytesConvert.ToStream(s, V4_BytesConvert.ColorToVector4(this.EdgeColor));
     PmxStreamHelper.WriteElement_Float(s, this.EdgeSize);
     PmxStreamHelper.WriteString(s, this.Tex, f);
     PmxStreamHelper.WriteString(s, this.Sphere, f);
     s.WriteByte((byte)this.SphereMode);
     PmxStreamHelper.WriteString(s, this.Toon, f);
     PmxStreamHelper.WriteString(s, this.Memo, f);
     PmxStreamHelper.WriteElement_Int32(s, this.FaceCount, 4, true);
 }
Esempio n. 19
0
 public void ToStreamEx(Stream s, PmxElementFormat f = null)
 {
     PmxStreamHelper.WriteString(s, Name, f);
     PmxStreamHelper.WriteString(s, NameE, f);
     PmxStreamHelper.WriteElement_Int32(s, Bone, f.BoneSize);
     PmxStreamHelper.WriteElement_Int32(s, Group, 1);
     PmxStreamHelper.WriteElement_Int32(s, PassGroup.ToFlagBits(), 2, signed: false);
     s.WriteByte((byte)BoxType);
     V3_BytesConvert.ToStream(s, BoxSize);
     V3_BytesConvert.ToStream(s, Position);
     V3_BytesConvert.ToStream(s, Rotation);
     PmxStreamHelper.WriteElement_Float(s, Mass);
     V4_BytesConvert.ToStream(s, new Vector4(PositionDamping, RotationDamping, Restitution, Friction));
     s.WriteByte((byte)Mode);
     if (f.WithID)
     {
         PmxStreamHelper.WriteElement_UInt(s, base.UID);
         PmxStreamHelper.WriteElement_UInt(s, base.CID);
     }
 }
Esempio n. 20
0
        public virtual void ToStream(Stream s, bool id)
        {
            PmxHeader header = Header;

            header.ElementFormat.WithID = id;
            PmxTextureTable pmxTextureTable = new PmxTextureTable(MaterialList);

            UpdateElementFormatSize(header.ElementFormat, pmxTextureTable);
            header.ToStreamEx(s);
            ModelInfo.ToStreamEx(s, header.ElementFormat);
            PmxStreamHelper.WriteElement_Int32(s, VertexList.Count);
            for (int i = 0; i < VertexList.Count; i++)
            {
                VertexList[i].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, FaceList.Count);
            for (int j = 0; j < FaceList.Count; j++)
            {
                PmxStreamHelper.WriteElement_Int32(s, FaceList[j], header.ElementFormat.VertexSize, signed: false);
            }
            pmxTextureTable.ToStreamEx(s, header.ElementFormat);
            PmxStreamHelper.WriteElement_Int32(s, MaterialList.Count);
            for (int k = 0; k < MaterialList.Count; k++)
            {
                MaterialList[k].ToStreamEx_TexTable(s, pmxTextureTable, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, BoneList.Count);
            for (int l = 0; l < BoneList.Count; l++)
            {
                BoneList[l].ToStreamEx(s, header.ElementFormat);
            }
            if (header.Ver < 2.1f)
            {
                int num = MorphList.Where((PmxMorph mp) => mp.IsImpulse).Count();
                PmxStreamHelper.WriteElement_Int32(s, MorphList.Count - num);
            }
            else
            {
                PmxStreamHelper.WriteElement_Int32(s, MorphList.Count);
            }
            for (int m = 0; m < MorphList.Count; m++)
            {
                MorphList[m].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, NodeList.Count);
            for (int n = 0; n < NodeList.Count; n++)
            {
                NodeList[n].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, BodyList.Count);
            for (int num2 = 0; num2 < BodyList.Count; num2++)
            {
                BodyList[num2].ToStreamEx(s, header.ElementFormat);
            }
            PmxStreamHelper.WriteElement_Int32(s, JointList.Count);
            for (int num3 = 0; num3 < JointList.Count; num3++)
            {
                JointList[num3].ToStreamEx(s, header.ElementFormat);
            }
            if (header.Ver >= 2.1f)
            {
                PmxStreamHelper.WriteElement_Int32(s, SoftBodyList.Count);
                for (int num4 = 0; num4 < SoftBodyList.Count; num4++)
                {
                    SoftBodyList[num4].ToStreamEx(s, header.ElementFormat);
                }
            }
            if (id)
            {
                PmxStreamHelper.WriteString(s, FilePath, header.ElementFormat);
            }
            header.ElementFormat.WithID = false;
        }