/// <summary> /// モーフライブラリを読み込みます。 /// </summary> /// <param name="source_path">フォルダ名</param> public void Load(string source_path) { foreach (string group_path in Directory.GetDirectories(source_path)) { //Debug.WriteLine("group_path: " + group_path); string group_name = Path.GetFileName(group_path); Debug.WriteLine("group_name: " + group_name); NodesRange nodes_range = NodesRange.Load(Path.Combine(group_path, @"NodesRange.xml")); MorphGroup group = new MorphGroup(group_name, nodes_range); groups.Add(group); foreach (string tmo_file in Directory.GetFiles(Path.Combine(source_path, group_path), @"*.tmo")) { //Debug.WriteLine("tmo_file: " + tmo_file); string morph_name = Path.GetFileNameWithoutExtension(tmo_file); Debug.WriteLine("morph_name: " + morph_name); TMOFile tmo = new TMOFile(); tmo.Load(tmo_file); tmo.LoadTransformationMatrixFromFrame(0); Morph morph = new Morph(morph_name, tmo); group.Items.Add(morph); } } }
/// 指定した名前を持つモーフを検索します。 public Morph FindItemByName(string name) { Morph found = null; foreach (Morph morph in items) { if (morph.Name == name) { found = morph; break; } } return(found); }