internal void DropFileToHandle(IntPtr handle, dynamic script, string directory) { if (PmxModel.ShouldDrop(script)) { Drop(handle, new StringCollection() { Path.Combine(directory, ExportFileName + ".pmx") }); if (VmdSequence.ShouldDrop(script)) { Drop(handle, new StringCollection() { Path.Combine(directory, ExportFileName + ".vmd") }); } } void Drop(IntPtr hWnd, StringCollection filePaths) { Clipboard.Clear(); Clipboard.SetFileDropList(filePaths); var data = Clipboard.GetDataObject(); IDropTarget target = Control.FromHandle(hWnd); DragDropEffects dwEffect = DragDropEffects.Copy | DragDropEffects.Link; target.OnDragDrop(new DragEventArgs(data, 0, 0, 0, dwEffect, dwEffect)); Clipboard.Clear(); } }
internal void Export(dynamic script, string directory) { PmxModel.FinalizeModel(VmdSequence.MorphFrameDict.Values.Select(t => t.frame)); VmdSequence.FinalizeKeyFrame(PmxModel.ModelData.MorphArray); ExportEvent?.Invoke(this, new ExportEventArgs(Path.Combine(directory, ExportFileName + ".pmx"), Path.Combine(directory, ExportFileName + ".vmd")) { Script = script }); }
public void FinalizeWorld() { EntityList.ForEach(e => e.Remove(true)); VmdSequence.AddPropertyKeyFrame(new VmdPropertyFrameData(FrameCount + 1, false)); }