private static void ConvertAnimation(Stream animStream, string path, bool convertAnims, FindLogic.Combo.AnimationInfoNew animationInfo, bool scaleAnims) { var parsedAnimation = default(teAnimation); var priority = 100; try { parsedAnimation = new teAnimation(animStream, true); priority = parsedAnimation.Header.Priority; } catch { } string animationDirectory = Path.Combine(path, "Animations", priority.ToString()); if (convertAnims && parsedAnimation != null) { SEAnim seAnim = new SEAnim(parsedAnimation, scaleAnims); string animOutput = Path.Combine(animationDirectory, animationInfo.GetNameIndex() + "." + seAnim.Extension); CreateDirectoryFromFile(animOutput); using (Stream fileStream = new FileStream(animOutput, FileMode.Create)) { seAnim.Write(fileStream); } } else { animStream.Position = 0; string rawAnimOutput = Path.Combine(animationDirectory, $"{animationInfo.GetNameIndex()}.{teResourceGUID.Type(animationInfo.GUID):X3}"); CreateDirectoryFromFile(rawAnimOutput); using (Stream fileStream = new FileStream(rawAnimOutput, FileMode.Create)) { animStream.CopyTo(fileStream); } } }
public SEAnim(teAnimation animation) { Animation = animation; }
public SEAnim(teAnimation animation, bool scaleAnims) { Animation = animation; ScaleAnims = scaleAnims; }