public void ToStreamEx(Stream s, PmxElementFormat f = null) { V3_BytesConvert.ToStream(s, Position); V3_BytesConvert.ToStream(s, Normal); V2_BytesConvert.ToStream(s, UV); for (int i = 0; i < f.UVACount; i++) { V4_BytesConvert.ToStream(s, UVA[i]); } if (Deform == DeformType.QDEF && f.Ver < 2.1f) { s.WriteByte(2); } else { s.WriteByte((byte)Deform); } switch (Deform) { case DeformType.BDEF1: PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize); break; case DeformType.BDEF2: PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Int32(s, Weight[1].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Float(s, Weight[0].Value); break; case DeformType.BDEF4: case DeformType.QDEF: PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Int32(s, Weight[1].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Int32(s, Weight[2].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Int32(s, Weight[3].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Float(s, Weight[0].Value); PmxStreamHelper.WriteElement_Float(s, Weight[1].Value); PmxStreamHelper.WriteElement_Float(s, Weight[2].Value); PmxStreamHelper.WriteElement_Float(s, Weight[3].Value); break; case DeformType.SDEF: PmxStreamHelper.WriteElement_Int32(s, Weight[0].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Int32(s, Weight[1].Bone, f.BoneSize); PmxStreamHelper.WriteElement_Float(s, Weight[0].Value); V3_BytesConvert.ToStream(s, C0); V3_BytesConvert.ToStream(s, R0); V3_BytesConvert.ToStream(s, R1); break; } PmxStreamHelper.WriteElement_Float(s, EdgeScale); if (f.WithID) { PmxStreamHelper.WriteElement_UInt(s, base.UID); PmxStreamHelper.WriteElement_UInt(s, base.CID); } }
// Token: 0x06000282 RID: 642 RVA: 0x0001417C File Offset: 0x0001237C public void ToStreamEx(Stream s, PmxElementFormat f) { V3_BytesConvert.ToStream(s, this.Position); V3_BytesConvert.ToStream(s, this.Normal); V2_BytesConvert.ToStream(s, this.UV); for (int i = 0; i < f.UVACount; i++) { V4_BytesConvert.ToStream(s, this.UVA[i]); } bool flag = this.Deform == PmxVertex.DeformType.QDEF && f.Ver < 2.1f; if (flag) { s.WriteByte(2); } else { s.WriteByte((byte)this.Deform); } switch (this.Deform) { case PmxVertex.DeformType.BDEF1: PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true); break; case PmxVertex.DeformType.BDEF2: PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value); break; case PmxVertex.DeformType.BDEF4: case PmxVertex.DeformType.QDEF: PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Int32(s, this.Weight[2].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Int32(s, this.Weight[3].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value); PmxStreamHelper.WriteElement_Float(s, this.Weight[1].Value); PmxStreamHelper.WriteElement_Float(s, this.Weight[2].Value); PmxStreamHelper.WriteElement_Float(s, this.Weight[3].Value); break; case PmxVertex.DeformType.SDEF: PmxStreamHelper.WriteElement_Int32(s, this.Weight[0].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Int32(s, this.Weight[1].Bone, f.BoneSize, true); PmxStreamHelper.WriteElement_Float(s, this.Weight[0].Value); V3_BytesConvert.ToStream(s, this.C0); V3_BytesConvert.ToStream(s, this.R0); V3_BytesConvert.ToStream(s, this.R1); break; } PmxStreamHelper.WriteElement_Float(s, this.EdgeScale); }