private void Compress(List <PmxMorphData> morphList, MultiDictionary <PmxMorphData, VmdMorphFrameData> frameDict) { var dict = new MultiDictionary <List <int>, PmxMorphData>(new IntegerArrayComparer()); foreach (var morph in morphList) { dict.Add(frameDict[morph].ConvertAll(m => m.FrameTime), morph); } foreach (var key in dict.Keys) { var removeList = dict[key]; if (removeList.Count > 1) { removeList[0].MorphArray = Compress(removeList); for (int i = 1; i < removeList.Count; i++) { var morph = removeList[i]; MorphList.Remove(morph); morphList.Remove(morph); } } } }
private void Compress(List <PmxMorphData> morphList, MultiDictionary <PmxMorphData, VmdMorphFrameData> frameDataDict) { var dict = new MultiDictionary <int[], PmxMorphData>(new IntegerArrayComparer()); foreach (var morph in morphList) { dict.Add(Array.ConvertAll(frameDataDict[morph].ToArray(), m => m.KeyFrameNo), morph); } foreach (var key in dict.Keys) { var removeList = dict[key]; if (removeList.Count > 1) { removeList[0].MorphArray = Compress(removeList); for (int i = 1; i < removeList.Count; i++) { var morph = removeList[i]; MorphList.Remove(morph); World.VmdMotion.MorphDict.Remove(morph); } } } IPmxMorphTypeData[] Compress(List <PmxMorphData> list) { var morphTypeDataList = new List <IPmxMorphTypeData>(); foreach (var morph in list) { morphTypeDataList.AddRange(morph.MorphArray); } return(morphTypeDataList.ToArray()); } }