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")) { } } }
private void exportExportableAnimation(object sender, EventArgs args) { if (FileTools.TrySaveFile(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.TryOpenFile(out string SkeletonFileName, "SKEL (*.nusktb)|*.nusktb")) { if (SkeletonFileName != null) { SKEL_Node node = new SKEL_Node(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()); } } }