void update3DView() { exporter.Export("tmp.obj"); if (textureFile != null) { engine.Load(System.IO.Path.GetFullPath("tmp.obj"), textureFile); } else { engine.Load(System.IO.Path.GetFullPath("tmp.obj"), System.IO.Path.GetFullPath(@"Resources\emptyTexture.png")); } }
private void ExportToObj() { // Convert geometry selection to sectors General.Map.Map.ConvertSelection(SelectionType.Sectors); //get sectors ICollection <Sector> sectors = General.Map.Map.SelectedSectorsCount == 0 ? General.Map.Map.Sectors : General.Map.Map.GetSelectedSectors(true); if (sectors.Count == 0) { General.Interface.DisplayStatus(StatusType.Warning, "OBJ export failed. Map has no sectors!"); return; } //show settings form WavefrontSettingsForm form = new WavefrontSettingsForm(General.Map.Map.SelectedSectorsCount == 0 ? -1 : sectors.Count); if (form.ShowDialog() == DialogResult.OK) { WavefrontExportSettings data = new WavefrontExportSettings(form); WavefrontExporter e = new WavefrontExporter(); e.Export(sectors, data); } }