Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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
            });
        }
Ejemplo n.º 3
0
 public void FinalizeWorld()
 {
     EntityList.ForEach(e => e.Remove(true));
     VmdSequence.AddPropertyKeyFrame(new VmdPropertyFrameData(FrameCount + 1, false));
 }