コード例 #1
0
        public override HeadFile Apply()
        {
            if (this.target == null)
            {
                return(null);
            }
            HeadFile     ret         = new HeadFile(this.target);
            TRIMorphData targetMorph = null;

            foreach (TRIMorphData morph in ret.TRI.Morphs)
            {
                if (morph.Name.ToLower().StartsWith("vampiremorph"))
                {
                    targetMorph = morph;
                    break;
                }
            }
            if (targetMorph != null)
            {
                for (int i = 0; i < ret.TRI.Header.VertexCount; i++)
                {
                    targetMorph[i] = new VertexDisplacement(0, 0, 0);
                }
                this.applied = true;
                this.menu.appliedLabel.Text = "Applied: True";
            }
            return(ret);
        }
コード例 #2
0
        public EGMFile(FileStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            reader.ReadBytes(5);
            byte[] bytes = new byte[2];

            bytes[0] = reader.ReadByte();
            StringBuilder bld = new StringBuilder();

            bld.Append(BitConverter.ToChar(bytes, 0));
            bytes[0] = reader.ReadByte();
            bld.Append(BitConverter.ToChar(bytes, 0));
            bytes[0] = reader.ReadByte();
            bld.Append(BitConverter.ToChar(bytes, 0));
            this.version = bld.ToString();

            this.verticeCount = reader.ReadInt32();
            this.symSize      = reader.ReadInt32();
            this.asymSize     = reader.ReadInt32();
            this.dateStamp    = reader.ReadUInt32();

            this.unknown = new int[10];
            for (int i = 0; i < 10; i++)
            {
                this.unknown[i] = reader.ReadInt32();
            }

            this.symMorphs = new List <EGMMorphset>();
            for (int i = 0; i < this.symSize; i++)
            {
                EGMMorphset morph = new EGMMorphset();
                morph.Unknown = reader.ReadBytes(4);
                for (int j = 0; j < this.verticeCount; j++)
                {
                    VertexDisplacement data = new VertexDisplacement(reader);
                    morph.Add(data);
                }
                this.symMorphs.Add(morph);
            }

            this.asymMorphs = new List <EGMMorphset>();
            for (int i = 0; i < this.asymSize; i++)
            {
                EGMMorphset morph = new EGMMorphset();
                morph.Unknown = reader.ReadBytes(4);
                for (int j = 0; j < this.verticeCount; j++)
                {
                    VertexDisplacement data = new VertexDisplacement(reader);
                    morph.Add(data);
                }
                this.asymMorphs.Add(morph);
            }
        }
コード例 #3
0
 public override HeadFile Apply()
 {
     if (this.target == null)
         return null;
     HeadFile ret = new HeadFile(this.target);
     TRIMorphData targetMorph = null;
     foreach (TRIMorphData morph in ret.TRI.Morphs)
     {
         if(morph.Name.ToLower().StartsWith("vampiremorph"))
         {
             targetMorph = morph;
             break;
         }
     }
     if(targetMorph != null)
     {
         for (int i = 0; i < ret.TRI.Header.VertexCount; i++)
             targetMorph[i] = new VertexDisplacement(0, 0, 0);
         this.applied = true;
         this.menu.appliedLabel.Text = "Applied: True";
     }
     return ret;
 }
コード例 #4
0
 // Start is called before the first frame update
 void Start()
 {
     sphere = FindObjectOfType <VertexDisplacement>();
 }
コード例 #5
0
ファイル: EGMFile.cs プロジェクト: V-Italy/FaceMix
        public EGMFile(FileStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);
            reader.ReadBytes(5);
            byte[] bytes = new byte[2];

            bytes[0] = reader.ReadByte();
            StringBuilder bld = new StringBuilder();
            bld.Append(BitConverter.ToChar(bytes, 0));
            bytes[0] = reader.ReadByte();
            bld.Append(BitConverter.ToChar(bytes, 0));
            bytes[0] = reader.ReadByte();
            bld.Append(BitConverter.ToChar(bytes, 0));
            this.version = bld.ToString();

            this.verticeCount = reader.ReadInt32();
            this.symSize = reader.ReadInt32();
            this.asymSize = reader.ReadInt32();
            this.dateStamp = reader.ReadUInt32();

            this.unknown = new int[10];
            for (int i = 0; i < 10; i++)
                this.unknown[i] = reader.ReadInt32();

            this.symMorphs = new List<EGMMorphset>();
            for (int i = 0; i < this.symSize; i++)
            {
                EGMMorphset morph = new EGMMorphset();
                morph.Unknown = reader.ReadBytes(4);
                for (int j = 0; j < this.verticeCount; j++)
                {
                    VertexDisplacement data = new VertexDisplacement(reader);
                    morph.Add(data);
                }
                this.symMorphs.Add(morph);
            }

            this.asymMorphs = new List<EGMMorphset>();
            for (int i = 0; i < this.asymSize; i++)
            {
                EGMMorphset morph = new EGMMorphset();
                morph.Unknown = reader.ReadBytes(4);
                for (int j = 0; j < this.verticeCount; j++)
                {
                    VertexDisplacement data = new VertexDisplacement(reader);
                    morph.Add(data);
                }
                this.asymMorphs.Add(morph);
            }
        }