private void btnGenerate_Click(object sender, EventArgs e) { using (var session = LicenseConfig.Create()) { if (session.IsValid == false) { LicenseConfig.ShowDialog(session, this); return; } using (new ProgressHelper(this, @"Convert Svf Model To glTF/glb ...")) { try { var sw = Stopwatch.StartNew(); var svfFilePath = txtInputFilePath.Text; var gltfFilePath = txtOutputFilePath.Text; var options = new GltfOption { AllowDracoMeshCompression = true, AllowNodeExtraData = true, AllowTextureTransform = false, GenerateHtml = true }; //是否需要做抽壳处理 var allowExtractShell = cbExtractShell.Checked; ConvertSvfToGltf(svfFilePath, gltfFilePath, allowExtractShell, options, CancellationToken.None); ProgressHelper.Close(); var message = $@"Convert Model Success! (duration: {sw.Elapsed})"; MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { ProgressHelper.Close(); MessageBox.Show(this, ex.ToString(), Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }
private void licenseStatusToolStripMenuItem_Click(object sender, EventArgs e) { LicenseConfig.ShowDialog(this); }