private void ExportExportableModelAsSmd(object sender, EventArgs args) { if (FileTools.TryOpenSaveFileDialog(out string fileName, "Supported Files(*.smd*.obj*.dae*.ply)|*.smd;*.obj;*.dae;*.ply")) { if (fileName.EndsWith(".smd")) { IO_SMD.ExportIOModelAsSMD(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } if (fileName.EndsWith(".obj")) { IO_OBJ.ExportIOModelAsOBJ(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } if (fileName.EndsWith(".dae")) { bool optimize = false; bool materials = false; DialogResult dialogResult = MessageBox.Show("Smaller filesize but takes longer to export", "Optimize Geometry?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { optimize = true; } dialogResult = MessageBox.Show("Export texture names inside of dae?", "Export Materials?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { materials = true; } IO_DAE.ExportIOModelAsDAE(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel(), optimize, materials); } if (fileName.EndsWith(".ply")) { IO_PLY.ExportIOModelAsPLY(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } } }
private void exportExportableModelAsSMD(object sender, EventArgs args) { if (FileTools.TrySaveFile(out string fileName, "Supported Files(*.smd*.obj*.dae)|*.smd;*.obj;*.dae")) { if (fileName.EndsWith(".smd")) { IO_SMD.ExportIOModelAsSMD(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } if (fileName.EndsWith(".obj")) { IO_OBJ.ExportIOModelAsOBJ(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } if (fileName.EndsWith(".dae")) { IO_DAE.ExportIOModelAsDAE(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel()); } } }