Example #1
0
        /// <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);
                }
            }
        }
Example #2
0
        /// <summary>
        /// ノード範囲を読み込みます。
        /// </summary>
        /// <param name="source_file">ファイル名</param>
        /// <returns></returns>
        public static NodesRange Load(string source_file)
        {
            XmlReader     reader     = XmlReader.Create(source_file);
            XmlSerializer serializer = new XmlSerializer(typeof(NodesRange));
            NodesRange    range      = serializer.Deserialize(reader) as NodesRange;

            reader.Close();
            return(range);
        }
Example #3
0
 /// <summary>
 /// モーフグループを生成します。
 /// </summary>
 public MorphGroup(string name, NodesRange nodes_range)
 {
     this.name = name;
     this.nodes_range = nodes_range;
     items = new List<Morph>();
 }
Example #4
0
 /// <summary>
 /// モーフグループを生成します。
 /// </summary>
 public MorphGroup(string name, NodesRange nodes_range)
 {
     this.name        = name;
     this.nodes_range = nodes_range;
     items            = new List <Morph>();
 }