Beispiel #1
0
 private void ExportExportableModelAsSmd(object sender, EventArgs args)
 {
     if (FileTools.TryOpenSaveFileDialog(out string fileName, "Supported Files(*.smd*.obj*.dae*.ply)|*.smd;*.obj;*.dae;*.ply"))
     {
         if (fileName.EndsWith(".smd"))
         {
             IO_SMD.ExportIOModelAsSMD(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
         if (fileName.EndsWith(".obj"))
         {
             IO_OBJ.ExportIOModelAsOBJ(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
         if (fileName.EndsWith(".dae"))
         {
             bool         optimize     = false;
             bool         materials    = false;
             DialogResult dialogResult = MessageBox.Show("Smaller filesize but takes longer to export", "Optimize Geometry?", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 optimize = true;
             }
             dialogResult = MessageBox.Show("Export texture names inside of dae?", "Export Materials?", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 materials = true;
             }
             IO_DAE.ExportIOModelAsDAE(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel(), optimize, materials);
         }
         if (fileName.EndsWith(".ply"))
         {
             IO_PLY.ExportIOModelAsPLY(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
     }
 }
Beispiel #2
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"))
                {
                }
            }
        }
Beispiel #3
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());
                }
            }
        }
Beispiel #4
0
 private void exportExportableModelAsSMD(object sender, EventArgs args)
 {
     if (FileTools.TrySaveFile(out string fileName, "Supported Files(*.smd*.obj*.dae)|*.smd;*.obj;*.dae"))
     {
         if (fileName.EndsWith(".smd"))
         {
             IO_SMD.ExportIOModelAsSMD(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
         if (fileName.EndsWith(".obj"))
         {
             IO_OBJ.ExportIOModelAsOBJ(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
         if (fileName.EndsWith(".dae"))
         {
             IO_DAE.ExportIOModelAsDAE(fileName, ((IExportableModelNode)((MenuItem)sender).Tag).GetIOModel());
         }
     }
 }