Exemple #1
0
        public async void butExport_Click(object sender, EventArgs e)
        {
            treeView.Nodes.Clear();
            exportParameters = GetExportParameters();

            PreExportProcess preExportProcess = new PreExportProcess(exportParameters, logger);
            bool             abort            = false;

            try
            {
                abort = AutosaveWarning();
                if (abort)
                {
                    return;
                }

                if (exportParameters.usePreExportProcess)
                {
                    Loader.Core.FileHold();
                    preExportProcess.ApplyPreExport();
                }
                await DoExport(singleExportItem);
            }
            catch (Exception ex)
            {
                logger.RaiseError(ex.Message);
            }
            finally
            {
                if (exportParameters.usePreExportProcess && !exportParameters.applyPreprocessToScene)
                {
                    ScriptsUtilities.ExecuteMaxScriptCommand("fetchMaxFile quiet:true");
                }
            }
        }
Exemple #2
0
        private async void butMultiExport_Click(object sender, EventArgs e)
        {
            treeView.Nodes.Clear();
            string outputFileExt = comboOutputFormat.SelectedItem.ToString();

            if (outputFileExt.Contains("binary babylon"))
            {
                outputFileExt = "babylon";
            }

            ExportItemList exportItemList = new ExportItemList(outputFileExt);

            exportItemList.LoadFromData();

            int numLoadedItems = exportItemList.Count;

            if (ModifierKeys == Keys.Shift)
            {
                MultiExportForm form = new MultiExportForm(exportItemList);
                form.ShowDialog(this);
            }
            else if (numLoadedItems > 0)
            {
                exportParameters = GetExportParameters();
                PreExportProcess preExportProcess = new PreExportProcess(exportParameters, logger);
                if (logger != null)
                {
                    preExportProcess.logger = logger;
                }
                bool abort = false;
                try
                {
                    abort = AutosaveWarning();
                    if (abort)
                    {
                        return;
                    }

                    if (exportParameters.usePreExportProcess)
                    {
                        Loader.Core.FileHold();
                        preExportProcess.ApplyPreExport();
                    }
                    await DoExport(exportItemList);
                }
                catch (Exception ex)
                {
                    logger.RaiseError(ex.Message);
                }
                finally
                {
                    if (exportParameters.usePreExportProcess && !exportParameters.applyPreprocessToScene)
                    {
                        ScriptsUtilities.ExecuteMaxScriptCommand("fetchMaxFile quiet:true");
                    }
                }
            }
        }