Пример #1
0
        public void populateAnimChunk(string modelName)
        {
            var file = File.ReadAllLines(@"rootFiles\ANIM_Root").Select(s => s.Split(',')).ToArray();

            for (int i = 0; i < file.Length; i++)
            {
                if ((file[i][0].ToLowerInvariant()).StartsWith(modelName) && (file[i][0].ToLowerInvariant()).EndsWith(".anim"))
                {
                    string name = (file[i][0].ToLowerInvariant());
                    name = name.Replace(".anim", "");
                    name = name.Replace("-", "");
                    name = Regex.Replace(name, @"[\d-]", string.Empty);
                    if (name == modelName)
                    {
                        AnimChunk.Add(new AnimChunk()
                        {
                            fileName = file[i][0],
                            rootId   = file[i][1],
                            //Particularité des AFID, parfois il y a un subanimID
                            AnimId    = file[i][0].Substring(modelName.Length, 4).TrimStart('0'),
                            subAnimId = file[i][0].Substring(modelName.Length + 6, 1)
                        });
                    }
                }
                else if (((file[i][0].ToLowerInvariant()).StartsWith(modelName) && (file[i][0].ToLowerInvariant()).EndsWith(".anim")) == false)
                {
                    continue;
                }
            }
        }
Пример #2
0
        public WodMd20ToMd21(string modelName, string path)
        {
            AnimChunk.Clear();
            BoneChunk.Clear();
            SkinChunk.Clear();
            PhysChunk.Clear();
            //Lecture des fichiers root du multitool pour peupler les listes.
            populateAnimChunk(modelName);
            populateBoneChunk(modelName);
            populateSkinChunk(modelName);
            populatePhysChunk(modelName);

            writeData(modelName, path);
        }