Esempio n. 1
0
        private void exportExportableAnimation(object sender, EventArgs args)
        {
            if (FileTools.TrySaveFile(out string fileName, "Supported Files(*.smd)|*.smd;"))
            {
                // need to get RSkeleton First for some types
                if (fileName.EndsWith(".smd"))
                {
                    Rendering.RSkeleton SkeletonNode = null;
                    if (FileTools.TryOpenFile(out string SkeletonFileName, "SKEL (*.nusktb)|*.nusktb"))
                    {
                        if (SkeletonFileName != null)
                        {
                            SKEL_Node node = new SKEL_Node();
                            node.Open(SkeletonFileName);
                            SkeletonNode = (Rendering.RSkeleton)node.GetRenderableNode();
                        }
                    }
                    if (SkeletonNode == null)
                    {
                        MessageBox.Show("No Skeleton File Selected");
                        return;
                    }

                    if (fileName.EndsWith(".smd"))
                    {
                        IO_SMD.ExportIOAnimationAsSMD(fileName, ((IExportableAnimationNode)((MenuItem)sender).Tag).GetIOAnimation(), SkeletonNode);
                    }
                }

                // other types like SEAnim go here
                if (fileName.EndsWith(".seanim"))
                {
                }
            }
        }
Esempio n. 2
0
        private void ExportExportableAnimation(object sender, EventArgs args)
        {
            if (FileTools.TryOpenSaveFileDialog(out string fileName, "Supported Files(*.smd, *.seanim, *.anim)|*.smd;*.seanim;*.anim"))
            {
                // need to get RSkeleton First for some types
                if (fileName.EndsWith(".smd") || fileName.EndsWith(".anim"))
                {
                    Rendering.RSkeleton skeletonNode = null;
                    if (FileTools.TryOpenFileDialog(out string skeletonFileName, "SKEL (*.nusktb)|*.nusktb"))
                    {
                        if (skeletonFileName != null)
                        {
                            SkelNode node = new SkelNode(skeletonFileName);
                            node.Open();
                            skeletonNode = (Rendering.RSkeleton)node.GetRenderableNode();
                        }
                    }
                    if (skeletonNode == null)
                    {
                        MessageBox.Show("No Skeleton File Selected");
                        return;
                    }

                    if (fileName.EndsWith(".anim"))
                    {
                        bool         ordinal      = false;
                        DialogResult dialogResult = MessageBox.Show("In most cases choose \"No\"", "Use ordinal bone order?", MessageBoxButtons.YesNo);
                        if (dialogResult == DialogResult.Yes)
                        {
                            ordinal = true;
                        }
                        IO_MayaANIM.ExportIOAnimationAsANIM(fileName, ((IExportableAnimationNode)((MenuItem)sender).Tag).GetIOAnimation(), skeletonNode, ordinal);
                    }

                    if (fileName.EndsWith(".smd"))
                    {
                        IO_SMD.ExportIOAnimationAsSMD(fileName, ((IExportableAnimationNode)((MenuItem)sender).Tag).GetIOAnimation(), skeletonNode);
                    }
                }

                // other types like SEAnim go here
                if (fileName.EndsWith(".seanim"))
                {
                    IO_SEANIM.ExportIOAnimation(fileName, ((IExportableAnimationNode)((MenuItem)sender).Tag).GetIOAnimation());
                }
            }
        }