Ejemplo n.º 1
0
        public static void ConvertLXFML(string filename)
        {
            Console.WriteLine("Converting '" + filename + "'...");

            DAESession session = new DAESession();

            session.PlaceFile(XDocument.Load(filename), Matrix.Identity, session.VisualScene, Path.GetDirectoryName(filename));

            session.Document.Save(Path.ChangeExtension(filename, ".dae"));
        }
Ejemplo n.º 2
0
        public static void ConvertLXF(string filename)
        {
            Console.WriteLine("Converting compressed archive '" + filename + "'...");

            DAESession session = new DAESession();

            using (ZipArchive archive = ZipFile.Open(filename, ZipArchiveMode.Read))
            {
                foreach (var entry in archive.Entries)
                {
                    if (entry.Name.EndsWith(".lxfml", StringComparison.InvariantCultureIgnoreCase))
                    {
                        Console.WriteLine("  Using compressed file '" + entry.Name + "'...");
                        using (Stream xmlStream = entry.Open())
                        {
                            session.PlaceFile(XDocument.Load(xmlStream), Matrix.Identity, session.VisualScene, Path.GetDirectoryName(filename));
                        }
                        break;
                    }
                }
            }

            session.Document.Save(Path.ChangeExtension(filename, ".dae"));
        }