// Get the total number of in-game frames this move goes for, including // modified frame speed public int calculateTotalFrames(int totalAnimFrames) { ForgeACMDScript tempScript = new ForgeACMDScript(this.script); // Calculate frames int gameFrame = -1; while (tempScript.animationFrame < totalAnimFrames) { gameFrame++; tempScript.processToFrame(gameFrame); } return(gameFrame); }
public int calculateFAF(int FAF) { ForgeACMDScript tempScript = new ForgeACMDScript(this.script); int gameFrame = -1; while (tempScript.currentFrame < FAF) { gameFrame++; tempScript.processToFrame(gameFrame); } return(tempScript.currentGameFrame); }
private void animationTrackBar_ValueChanged(object sender, EventArgs e) { if (animationTrackBar.Value > totalFrame.Value) { animationTrackBar.Value = 0; } if (animationTrackBar.Value < 0) { animationTrackBar.Value = (int)totalFrame.Value; } currentFrame.Value = animationTrackBar.Value; int frameNum = animationTrackBar.Value; if (MaterialAnimation != null) { foreach (TreeNode node in MeshList.treeView1.Nodes) { if (!(node is ModelContainer)) { continue; } ModelContainer m = (ModelContainer)node; m.NUD.applyMTA(MaterialAnimation, frameNum); } } if (Animation == null) { return; } // Process script first in case we have to speed up the animation if (ACMDScript != null) { ACMDScript.processToFrame(frameNum); } float animFrameNum = frameNum; if (ACMDScript != null && Runtime.useFrameDuration) { animFrameNum = ACMDScript.animationFrame;// - 1; } foreach (TreeNode node in MeshList.treeView1.Nodes) { if (!(node is ModelContainer)) { continue; } ModelContainer m = (ModelContainer)node; Animation.SetFrame(animFrameNum); if (m.VBN != null) { Animation.NextFrame(m.VBN); } // Deliberately do not ever use ACMD/animFrame to modify these other types of model if (m.dat_melee != null) { Animation.SetFrame(frameNum); Animation.NextFrame(m.dat_melee.bones); } if (m.BCH != null) { foreach (BCH_Model mod in m.BCH.Models.Nodes) { if (mod.skeleton != null) { Animation.SetFrame(animFrameNum); Animation.NextFrame(mod.skeleton); } } } } //Frame = (int)animFrameNum; }