public static MvdSection Parse(MvdDocument document, BinaryReader br) { var tag = (MvdTag)br.ReadByte(); MvdSection rt = null; switch (tag) { case MvdTag.NameList: rt = new MvdNameList(); break; case MvdTag.Bone: rt = new MvdBoneData(); break; case MvdTag.Morph: rt = new MvdMorphData(); break; case MvdTag.ModelProperty: rt = new MvdModelPropertyData(); break; case MvdTag.AccessoryProperty: rt = new MvdAccessoryPropertyData(); break; case MvdTag.EffectProperty: rt = new MvdEffectPropertyData(); break; case MvdTag.Camera: rt = new MvdCameraData(); break; case MvdTag.Light: rt = new MvdLightData(); break; case MvdTag.Project: rt = new MvdProjectData(); break; case MvdTag.Eof: return null; } rt.MinorType = br.ReadByte(); rt.RawKey = br.ReadInt32(); rt.RawItemSize = br.ReadInt32(); rt.RawCount = br.ReadInt32(); using (var exr = br.CreateSizedBufferReader()) rt.ReadExtensionRegion(document, exr); rt.Read(document, br); return rt; }
public string GetName(MvdNameList names, MvdBoneData boneData) { if (this.StageId == 0) { return(names.Names[boneData.Key]); } else { var key = boneData.Key * -1000 - this.StageId; return(names.Names.ContainsKey(key) ? names.Names[key] : this.StageId.ToString("000")); } }
public string GetName(MvdNameList names, MvdBoneData boneData) { if (this.StageId == 0) return names.Names[boneData.Key]; else { var key = boneData.Key * -1000 - this.StageId; return names.Names.ContainsKey(key) ? names.Names[key] : this.StageId.ToString("000"); } }
public static MvdSection Parse(MvdDocument document, BinaryReader br) { var tag = (MvdTag)br.ReadByte(); MvdSection rt = null; switch (tag) { case MvdTag.NameList: rt = new MvdNameList(); break; case MvdTag.Bone: rt = new MvdBoneData(); break; case MvdTag.Morph: rt = new MvdMorphData(); break; case MvdTag.ModelProperty: rt = new MvdModelPropertyData(); break; case MvdTag.AccessoryProperty: rt = new MvdAccessoryPropertyData(); break; case MvdTag.EffectProperty: rt = new MvdEffectPropertyData(); break; case MvdTag.Camera: rt = new MvdCameraData(); break; case MvdTag.Light: rt = new MvdLightData(); break; case MvdTag.Project: rt = new MvdProjectData(); break; case MvdTag.Eof: return(null); } rt.MinorType = br.ReadByte(); rt.RawKey = br.ReadInt32(); rt.RawItemSize = br.ReadInt32(); rt.RawCount = br.ReadInt32(); using (var exr = br.CreateSizedBufferReader()) rt.ReadExtensionRegion(document, exr); rt.Read(document, br); return(rt); }