Пример #1
0
        public static PMXFormat Load(BinaryReader reader)
        {
            PMXFormat pmxFormat = new PMXFormat();

            pmxFormat.Reload(reader);
            return(pmxFormat);
        }
Пример #2
0
        public static MMDMorphStateComponent LoadMorphStateComponent(PMXFormat pmx)
        {
            MMDMorphStateComponent component = new MMDMorphStateComponent();

            component.Reload(pmx);
            return(component);
        }
Пример #3
0
        public static void Reload(this MMDMorphStateComponent component, PMXFormat pmx)
        {
            component.stringMorphIndexMap.Clear();
            component.morphs.Clear();
            int morphCount = pmx.Morphs.Count;

            for (int i = 0; i < pmx.Morphs.Count; i++)
            {
                component.morphs.Add(GetMorphDesc(pmx.Morphs[i]));
            }
            component.WeightOrigin        = new float[morphCount];
            component.WeightOriginA       = new float[morphCount];
            component.WeightOriginB       = new float[morphCount];
            component.WeightComputed      = new float[morphCount];
            component.WeightComputedPrev  = new float[morphCount];
            component.WeightComputedA     = new float[morphCount];
            component.WeightComputedB     = new float[morphCount];
            component.WeightComputedAPrev = new float[morphCount];
            component.WeightComputedBPrev = new float[morphCount];
            for (int i = 0; i < morphCount; i++)
            {
                component.stringMorphIndexMap.Add(pmx.Morphs[i].Name, i);
            }
        }