public void Deserialize(BSReader reader) { this.Name = reader.ReadString(); this.Diffuse = reader.ReadColor4(); this.Ambient = reader.ReadColor4(); this.Specular = reader.ReadColor4(); this.Emissive = reader.ReadColor4(); this.UnkFloat01 = reader.ReadSingle(); this.Flags = reader.ReadUInt32(); // MaterialEntryFlags (64 is default often used with 256 and/or 512 only a few exceptions have 1 2 4 8...) this.DiffuseMapPath = reader.ReadString(); this.UnkFloat02 = reader.ReadSingle(); this.UnkByte01 = reader.ReadByte(); this.UnkByte02 = reader.ReadByte(); this.IsAbsolutePath = reader.ReadBoolean(); if ((this.Flags & (uint)PrimMtrlFlag.Bit14) != 0) { this.NormalMapPath = reader.ReadString(); this.UnkUInt01 = reader.ReadUInt32(); } }