public void FromStreamEx_TexTable(Stream s, PmxTextureTable tx, PmxElementFormat f = null)
 {
     Name       = PmxStreamHelper.ReadString(s, f);
     NameE      = PmxStreamHelper.ReadString(s, f);
     Diffuse    = V4_BytesConvert.FromStream(s);
     Specular   = V3_BytesConvert.FromStream(s);
     Power      = PmxStreamHelper.ReadElement_Float(s);
     Ambient    = V3_BytesConvert.FromStream(s);
     Flags      = (MaterialFlags)s.ReadByte();
     EdgeColor  = V4_BytesConvert.FromStream(s);
     EdgeSize   = PmxStreamHelper.ReadElement_Float(s);
     Tex        = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     Sphere     = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     SphereMode = (SphereModeType)s.ReadByte();
     if (s.ReadByte() == 0)
     {
         Toon = tx.GetName(PmxStreamHelper.ReadElement_Int32(s, f.TexSize));
     }
     else
     {
         int n = s.ReadByte();
         Toon = SystemToon.GetToonName(n);
     }
     Memo = PmxStreamHelper.ReadString(s, f);
     UpdateAttributeFromMemo();
     FaceCount = PmxStreamHelper.ReadElement_Int32(s);
     if (f.WithID)
     {
         base.UID = PmxStreamHelper.ReadElement_UInt(s);
         base.CID = PmxStreamHelper.ReadElement_UInt(s);
     }
 }
 public void FromStreamEx(Stream s, PmxElementFormat f = null)
 {
     Name       = PmxStreamHelper.ReadString(s, f);
     NameE      = PmxStreamHelper.ReadString(s, f);
     Diffuse    = V4_BytesConvert.FromStream(s);
     Specular   = V3_BytesConvert.FromStream(s);
     Power      = PmxStreamHelper.ReadElement_Float(s);
     Ambient    = V3_BytesConvert.FromStream(s);
     Flags      = (MaterialFlags)s.ReadByte();
     EdgeColor  = V4_BytesConvert.FromStream(s);
     EdgeSize   = PmxStreamHelper.ReadElement_Float(s);
     Tex        = PmxStreamHelper.ReadString(s, f);
     Sphere     = PmxStreamHelper.ReadString(s, f);
     SphereMode = (SphereModeType)s.ReadByte();
     Toon       = PmxStreamHelper.ReadString(s, f);
     Memo       = PmxStreamHelper.ReadString(s, f);
     FaceCount  = PmxStreamHelper.ReadElement_Int32(s);
 }
 public PmxMaterial()
 {
     Name     = "";
     NameE    = "";
     Diffuse  = new Vector4(0f, 0f, 0f, 1f);
     Specular = new Vector3(0f, 0f, 0f);
     Power    = 0f;
     Ambient  = new Vector3(0f, 0f, 0f);
     ClearFlags();
     EdgeColor  = new Vector4(0f, 0f, 0f, 1f);
     EdgeSize   = 1f;
     Tex        = "";
     Sphere     = "";
     SphereMode = SphereModeType.Mul;
     Toon       = "";
     Memo       = "";
     OffsetMul  = default(PmxMaterialMorph.MorphData);
     OffsetAdd  = default(PmxMaterialMorph.MorphData);
     ClearOffset();
     ExDraw    = ExDrawMode.F3;
     Attribute = new PmxMaterialAttribute();
 }
 public void FromPmxMaterial(PmxMaterial m, bool nonStr = false)
 {
     Diffuse    = m.Diffuse;
     Specular   = m.Specular;
     Power      = m.Power;
     Ambient    = m.Ambient;
     Flags      = m.Flags;
     EdgeColor  = m.EdgeColor;
     EdgeSize   = m.EdgeSize;
     SphereMode = m.SphereMode;
     FaceCount  = m.FaceCount;
     ExDraw     = m.ExDraw;
     if (!nonStr)
     {
         Name   = m.Name;
         NameE  = m.NameE;
         Tex    = m.Tex;
         Sphere = m.Sphere;
         Toon   = m.Toon;
         Memo   = m.Memo;
     }
     Attribute = m.Attribute;
     FromID(m);
 }