Exemplo n.º 1
0
        public static VMDFormat Load(BinaryReader reader)
        {
            VMDFormat vmd = new VMDFormat();

            vmd.Reload(reader);
            return(vmd);
        }
Exemplo n.º 2
0
        public static void Load(this MMDMotion motion, VMDFormat vmd)
        {
            motion.BoneKeyFrameSet.Clear();
            motion.MorphKeyFrameSet.Clear();

            foreach (var pair in vmd.BoneKeyFrameSet)
            {
                var keyFrames = new List <BoneKeyFrame>(pair.Value);
                motion.BoneKeyFrameSet.Add(pair.Key, keyFrames);
                for (int i = 0; i < keyFrames.Count; i++)
                {
                    BoneKeyFrame keyFrame = keyFrames[i];
                    keyFrame.Translation *= 0.1f;
                    keyFrames[i]          = keyFrame;
                }
            }
            foreach (var pair in vmd.MorphKeyFrameSet)
            {
                motion.MorphKeyFrameSet.Add(pair.Key, new List <MorphKeyFrame>(pair.Value));
            }
        }