Example #1
0
        public void Read(BinaryReader reader, CoordinateType coordinate, float scale)
        {
            Coordinate = coordinate;
            ModelName  = MMDUtils.GetString(reader.ReadBytes(20));
            DWORD motionCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            Motions = new MotionData[motionCount];
            for (long i = 0; i < Motions.Length; i++)
            {
                Motions[i] = new MotionData(reader, CoordZ, scale);
            }
            DWORD faceCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            FaceMotions = new FaceMotionData[faceCount];
            for (long i = 0; i < FaceMotions.Length; i++)
            {
                FaceMotions[i] = new FaceMotionData(reader, CoordZ, scale);
            }
            DWORD cameraCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            CameraMotions = new CameraMotionData[cameraCount];
            for (long i = 0; i < CameraMotions.Length; i++)
            {
                CameraMotions[i] = new CameraMotionData(reader, CoordZ, scale);
            }
            DWORD lightCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            LightMotions = new LightMotionData[lightCount];
            for (long i = 0; i < LightMotions.Length; i++)
            {
                LightMotions[i] = new LightMotionData(reader, CoordZ, scale);
            }
        }
Example #2
0
 public void Read(BinaryReader reader, CoordinateType coordinate, float scale)
 {
     Coordinate = coordinate;
     ModelName = MMDUtils.GetString(reader.ReadBytes(20));
     DWORD motionCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     Motions = new MotionData[motionCount];
     for (long i = 0; i < Motions.Length; i++)
     {
         Motions[i] = new MotionData(reader, CoordZ, scale);
     }
     DWORD faceCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     FaceMotions = new FaceMotionData[faceCount];
     for (long i = 0; i < FaceMotions.Length; i++)
     {
         FaceMotions[i] = new FaceMotionData(reader, CoordZ, scale);
     }
     DWORD cameraCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     CameraMotions = new CameraMotionData[cameraCount];
     for (long i = 0; i < CameraMotions.Length; i++)
     {
         CameraMotions[i] = new CameraMotionData(reader, CoordZ, scale);
     }
     DWORD lightCount = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     LightMotions = new LightMotionData[lightCount];
     for (long i = 0; i < LightMotions.Length; i++)
     {
         LightMotions[i] = new LightMotionData(reader, CoordZ, scale);
     }
 }