Ejemplo n.º 1
0
        private async void butMultiExport_Click(object sender, EventArgs e)
        {
            string outputFileExt;

            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)
            {
                if (chkWriteTextures.Checked || chkOverwriteTextures.Checked)
                {
                    MessageBox.Show("Cannot write textures with Multi-File Export");
                    return;
                }

                await DoExport(exportItemList);
            }
        }
Ejemplo n.º 2
0
        private async void butMultiExport_Click(object sender, EventArgs e)
        {
            string outputFileExt;

            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)
            {
                await DoExport(exportItemList);
            }
        }
Ejemplo n.º 3
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");
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void ExportItemGridView_Populate(ExportItemList exportItemList)
        {
            ExportItemGridView.Rows.Clear();
            this.exportItemList = exportItemList;

            foreach (var item in exportItemList)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.Cells.Add(new DataGridViewCheckBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                SetRowData(row, item);
                ExportItemGridView.Rows.Add(row);
            }
        }
        private async void butMultiExport_Click(object sender, EventArgs e)
        {
            string outputFileExt;

            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)
            {
                bool abort = false;
                try
                {
                    abort = AutosaveWarning();
                    if (abort)
                    {
                        return;
                    }
                    await DoExport(exportItemList);
                }
                catch {}
                finally
                {
                    if (!abort)
                    {
                        if (chkUsePreExportProces.Checked && !chkApplyPreprocessToScene.Checked)
                        {
                            Loader.Core.SetQuietMode(true);
                            Loader.Core.LoadFromFile(Loader.Core.CurFilePath, true);
                            Loader.Core.SetQuietMode(false);
                        }
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private async void butMultiExport_Click(object sender, EventArgs e)
        {
            string outputFileExt;

            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)
            {
                try
                {
                    if (chkUsePreExportProces.Checked)
                    {
                        Loader.Core.FileHold();
                    }
                    await DoExport(exportItemList);
                }
                catch {}
                finally
                {
                    if (chkUsePreExportProces.Checked)
                    {
                        Loader.Core.SetQuietMode(true);
                        Loader.Core.FileFetch();
                        Loader.Core.SetQuietMode(false);
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void ExportItemGridView_Populate(ExportItemList exportItemList)
        {
            ExportItemGridView.Rows.Clear();
            this.exportItemList = exportItemList;

            foreach (var item in exportItemList)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.Cells.Add(new DataGridViewCheckBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                row.Cells.Add(new DataGridViewTextBoxCell());
                SetRowData(row, item);
                ExportItemGridView.Rows.Add(row);
            }
            ExportItemGridView.AutoResizeColumns();
            ExportItemGridView.AllowUserToOrderColumns  = true;
            ExportItemGridView.AllowUserToResizeColumns = true;
        }
Ejemplo n.º 8
0
        private async Task <bool> DoExport(ExportItemList exportItemList)
        {
            bool allSucceeded = true;

            foreach (ExportItem item in exportItemList)
            {
                if (!item.Selected)
                {
                    continue;
                }

                allSucceeded = allSucceeded && await DoExport(item, true);

                if (exporter.IsCancelled)
                {
                    break;
                }
            }

            return(allSucceeded);
        }
Ejemplo n.º 9
0
 public MultiExportForm(ExportItemList exportItemList)
 {
     InitializeComponent();
     ExportItemGridView_Populate(exportItemList);
 }