/// <summary> /// /// </summary> /// <param name="toReplace"></param> public static void ReplaceModelFromFile(HSD_JOBJ toReplace) { var f = Tools.FileIO.OpenFile(IOManager.GetModelImportFileFilter()); if (f != null) { var settings = new ModelImportSettings(); using (PropertyDialog d = new PropertyDialog("Model Import Options", settings)) { if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ImportSettings ioSettings = new ImportSettings() { FlipUVs = settings.FlipUVs, FlipWindingOrder = !settings.FlipFaces, SmoothNormals = settings.SmoothNormals, Triangulate = true, //WeightLimit = true, }; ModelImporter imp = new ModelImporter(f, settings, ioSettings); using (ProgressBarDisplay pb = new ProgressBarDisplay(imp)) { pb.DoWork(); pb.ShowDialog(); } var newroot = imp.NewModel; toReplace._s.SetFromStruct(newroot._s); } } } }