public void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.TargetBone); bw.Write(this.LoopCount); bw.Write(this.AngleLimitUnit); bw.Write(this.BindedBones.Count); this.BindedBones.ForEach(_ => _.Write(bw, doc, cache)); }
public void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Bone); bw.Write(this.IsAngleLimitEnabled); if (this.IsAngleLimitEnabled) { this.LowerAngleLimit.ForEach(bw.Write); this.HigherAngleLimit.ForEach(bw.Write); } }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Bone); this.MovementOffset.ForEach(bw.Write); this.RotationOffset.ForEach(bw.Write); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Vertex); this.Offset.ForEach(bw.Write); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Material); bw.Write((byte)this.Kind); this.Diffuse.ForEach(bw.Write); this.Specular.ForEach(bw.Write); bw.Write(this.Power); this.Ambient.ForEach(bw.Write); this.EdgeColor.ForEach(bw.Write); bw.Write(this.EdgeSize); this.Texture.ForEach(bw.Write); this.SubTexture.ForEach(bw.Write); this.ToonTexture.ForEach(bw.Write); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Rigid); bw.Write(this.IsLocal); this.CentralImpulse.ForEach(bw.Write); this.TorqueImpulse.ForEach(bw.Write); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Morph); bw.Write(this.Weight); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { this.Bones.ForEach(_ => cache.Write(_)); bw.Write(this.Weight); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { cache.Write(this.Bone); }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { this.Bones.ForEach(_ => cache.Write(_)); bw.Write(this.Weight); this.Center.ForEach(bw.Write); this.RangeZero.ForEach(bw.Write); this.RangeOne.ForEach(bw.Write); }
public void Write(Stream stream) { // leave open var bw = new BinaryWriter(stream); var cache = new PmxIndexCache(this, bw); this.Header.VertexIndexSize = cache.Vertices.Count <= byte.MaxValue ? PmxVertexIndexSize.UInt8 : cache.Vertices.Count <= ushort.MaxValue ? PmxVertexIndexSize.UInt16 : PmxVertexIndexSize.Int32; this.Header.MaterialIndexSize = cache.Materials.Count <= sbyte.MaxValue ? PmxIndexSize.Int8 : cache.Materials.Count <= short.MaxValue ? PmxIndexSize.Int16 : PmxIndexSize.Int32; this.Header.TextureIndexSize = cache.Textures.Count <= sbyte.MaxValue ? PmxIndexSize.Int8 : cache.Textures.Count <= short.MaxValue ? PmxIndexSize.Int16 : PmxIndexSize.Int32; this.Header.BoneIndexSize = cache.Bones.Count <= sbyte.MaxValue ? PmxIndexSize.Int8 : cache.Bones.Count <= short.MaxValue ? PmxIndexSize.Int16 : PmxIndexSize.Int32; this.Header.MorphIndexSize = cache.Morphs.Count <= sbyte.MaxValue ? PmxIndexSize.Int8 : cache.Morphs.Count <= short.MaxValue ? PmxIndexSize.Int16 : PmxIndexSize.Int32; this.Header.RigidIndexSize = cache.Rigids.Count <= sbyte.MaxValue ? PmxIndexSize.Int8 : cache.Rigids.Count <= short.MaxValue ? PmxIndexSize.Int16 : PmxIndexSize.Int32; bw.Write(Encoding.ASCII.GetBytes("PMX ")); bw.Write(this.Version); this.Header.Write(bw); this.ModelInformation.Write(bw, this); bw.Write(this.Vertices.Count); this.Vertices.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.Indices.Count); this.Indices.ForEach(_ => cache.Write(_)); bw.Write(this.Textures.Count); this.Textures.ForEach(_ => _.Write(bw, this)); bw.Write(this.Materials.Count); this.Materials.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.Bones.Count); this.Bones.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.Morphs.Count); this.Morphs.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.DisplayList.Count); this.DisplayList.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.Rigids.Count); this.Rigids.ForEach(_ => _.Write(bw, this, cache)); bw.Write(this.Constraints.Count); this.Constraints.ForEach(_ => _.Write(bw, this, cache)); if (this.Version > 2) { bw.Write(this.SoftBodies.Count); this.SoftBodies.ForEach(_ => _.Write(bw, this, cache)); } }
public override void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { base.Write(bw, doc, cache); cache.Write(this.Morph); }
public void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { doc.WriteString(bw, this.Name); doc.WriteString(bw, this.EnglishName); cache.Write(this.RelatedBone); bw.Write(this.Group); bw.Write((ushort)this.CollidableGroups); bw.Write((byte)this.Shape); this.Size.ForEach(bw.Write); this.Position.ForEach(bw.Write); this.Rotation.ForEach(bw.Write); bw.Write(this.Mass); bw.Write(this.LinearDamping); bw.Write(this.AngularDamping); bw.Write(this.Restitution); bw.Write(this.Friction); bw.Write((byte)this.Kind); }
public void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Name)); bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.EnglishName)); this.Diffuse.ForEach(bw.Write); this.Specular.ForEach(bw.Write); bw.Write(this.Power); this.Ambient.ForEach(bw.Write); bw.Write((byte)this.Options); this.EdgeColor.ForEach(bw.Write); bw.Write(this.EdgeSize); cache.Write(this.MainTexture); cache.Write(this.SubTexture); bw.Write((byte)this.SubTextureMode); bw.Write(this.UseSharedToonTexture); if (this.UseSharedToonTexture) bw.Write((byte)this.SharedToonTexture); else cache.Write(this.CustomToonTexture); bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Comment)); bw.Write(this.IndexCount); }
public void Write(BinaryWriter bw, PmxDocument doc, PmxIndexCache cache) { doc.WriteString(bw, this.Name); doc.WriteString(bw, this.EnglishName); this.Position.ForEach(bw.Write); cache.Write(this.ParentBone); bw.Write(this.Priority); bw.Write((ushort)this.Capabilities); if (this.Capabilities.HasFlag(PmxBoneCapabilities.ConnectToBone)) cache.Write(this.ConnectToBone); else this.ConnectToOffset.ForEach(bw.Write); if (this.Capabilities.HasFlag(PmxBoneCapabilities.RotationAffected) || this.Capabilities.HasFlag(PmxBoneCapabilities.MovementAffected)) { cache.Write(this.AffectedBone); bw.Write(this.AffectionRate); } if (this.Capabilities.HasFlag(PmxBoneCapabilities.FixedAxis)) this.FixedAxis.ForEach(bw.Write); if (this.Capabilities.HasFlag(PmxBoneCapabilities.LocalAxis)) { this.LocalVectorX.ForEach(bw.Write); this.LocalVectorZ.ForEach(bw.Write); } if (this.Capabilities.HasFlag(PmxBoneCapabilities.TransformByExternalParent)) bw.Write(this.ExternalParentKey); if (this.Capabilities.HasFlag(PmxBoneCapabilities.IK)) this.IK.Write(bw, doc, cache); }