2 using System.Collections.Generic;
\r
8 public class MqoGenerator
\r
10 public void Generate(string tso_file, string out_path, MqoBoneMode bone_mode)
\r
12 string tso_filename = Path.GetFileName(tso_file);
\r
13 string mqo_file = Path.Combine(out_path, Path.ChangeExtension(tso_filename, ".mqo"));
\r
14 string xml_file = Path.Combine(out_path, Path.ChangeExtension(tso_filename, ".xml"));
\r
17 using (MqoWriter mqo = new MqoWriter(mqo_file))
\r
19 TSOFile tso = new TSOFile(tso_file);
\r
22 mqo.BoneMode = bone_mode;
\r
27 ImportInfo ii = new ImportInfo();
\r
30 foreach (TSOTex tex in tso.textures)
\r
31 ii.textures.Add(new ImportTextureInfo(tex));
\r
34 foreach (TSOEffect effect in tso.effects)
\r
36 ii.effects.Add(new ImportEffectInfo(effect));
\r
37 File.WriteAllText(Path.Combine(out_path, effect.Name), effect.code, Encoding.Default);
\r
41 foreach (TSOMaterial mat in tso.materials)
\r
43 ii.materials.Add(new ImportMaterialInfo(mat));
\r
44 File.WriteAllText(Path.Combine(out_path, mat.Name), mat.code, Encoding.Default);
\r
47 ImportInfo.Save(xml_file, ii);
\r