Ejemplo n.º 1
0
        private void PopulateFromProcessorInfo(ProcessorInfo info)
        {
            ModelFiles.files.Clear();
            foreach (string m in info.models)
            {
                ModelFiles.Add(m, false);
            }
            ModelFiles.RefreshList();

            TextureFiles.files.Clear();
            foreach (string t in info.textures)
            {
                TextureFiles.Add(t, false);
            }
            TextureFiles.RefreshList();

            DoMergeModels.IsChecked      = info.mergeModels;
            Padding.Value                = info.padding;
            DoKeepTransparency.IsChecked = info.keepTransparency;

            string[] exportIds = (string[])ExportModelFormats.Tag;
            ExportModelFormats.SelectedIndex   = Array.IndexOf(exportIds, info.modelExportFormatId);
            ExportTextureFormats.SelectedIndex = (int)info.textureOutputType;

            FilesPrefix.Text         = info.outputFilesPrefix;
            ExportDirectory.FullPath = info.outputDir;
        }
Ejemplo n.º 2
0
        private IntPtr HandleDropFiles(IntPtr hDrop)
        {
            const int MAX_PATH = 260;

            uint count = DragQueryFile(hDrop, 0xFFFFFFFF, null, 0);

            for (uint i = 0; i < count; i++)
            {
                int size = (int)DragQueryFile(hDrop, i, null, 0);

                StringBuilder filename = new StringBuilder(size + 1);
                DragQueryFile(hDrop, i, filename, MAX_PATH);

                string droppedFile = filename.ToString();

                if (Path.GetExtension(droppedFile) == ".xml")
                {
                    LoadSettingsFile(droppedFile);
                    break;
                }

                if (Utils.IsModelExtensionSupported(Path.GetExtension(droppedFile)))
                {
                    ModelFiles.Add(droppedFile, false);
                }
                else
                {
                    if (Utils.IsImageSupported(droppedFile))
                    {
                        TextureFiles.Add(droppedFile, false);
                    }
                    else
                    {
                        Log.Line(LogType.Warning, "Dropped file '{0}' is not supported", droppedFile);
                    }
                }
            }

            DragFinish(hDrop);

            ModelFiles.RefreshList();
            TextureFiles.RefreshList();

            return(IntPtr.Zero);
        }