Esempio n. 1
0
        public static void ConvertMapGeometryToGltf(ConvertMapGeometryToGltf opts)
        {
            MapGeometry mapGeometry = ReadMapGeometry(opts.MapGeometryPath); //Material Support missing
            ModelRoot   gltf        = mapGeometry.ToGLTF();

            gltf.Save(opts.OutputPath);
        }
Esempio n. 2
0
        public static void ConvertMapGeometryToGltf(ConvertMapGeometryToGltf opts)
        {
            MapGeometry mapGeometry = ReadMapGeometry(opts.MapGeometryPath);
            ModelRoot   gltf        = mapGeometry.ToGLTF();

            gltf.Save(opts.OutputPath);
        }
Esempio n. 3
0
        private void button9_Click(object sender, EventArgs e)
        {
            string MAPGEOText = Path.GetFullPath(openmapgeo.FileName);


            savegltf.Filter = "GLTF|*.gltf|GLB|*.glb";
            if (savegltf.ShowDialog() == DialogResult.OK)

            {
                string outputgltf = Path.GetFullPath(savegltf.FileName);
                try
                {
                    MapGeometry mapgeo     = new MapGeometry(MAPGEOText);
                    var         convertmap = mapgeo.ToGLTF();
                    convertmap.SaveGLB(outputgltf);
                    MessageBox.Show("Exported to GLTF/GLB.", $"Files Exported!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                catch (FileNotFoundException ex)
                {
                    MessageBox.Show("MapFile is missing. Make sure you load the correct MAPGEO file!", $"Error: Can't find .mapgeo file!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                catch (System.ArgumentException ag)
                {
                    MessageBox.Show("Make sure you load a file before exporting it!", $"Error: No file is loaded!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Esempio n. 4
0
        private static void ConvertMapGeometryToGltf(FileConversionParameter parameter)
        {
            WadEntry    mapGeometryWadEntry = parameter.Parameter;
            MapGeometry mapGeometry         = new MapGeometry(mapGeometryWadEntry.GetDataHandle().GetDecompressedStream());
            ModelRoot   gltf = mapGeometry.ToGLTF();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
Esempio n. 5
0
        private static void ConvertMapGeometryToGltf(FileConversionParameter parameter)
        {
            WADEntry mapGeometryWadEntry = parameter.Parameter;

            using MemoryStream stream = new MemoryStream(mapGeometryWadEntry.GetContent(true));
            MapGeometry mapGeometry = new MapGeometry(stream);
            ModelRoot   gltf        = mapGeometry.ToGLTF();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }