OpenKh icon indicating copy to clipboard operation
OpenKh copied to clipboard

[BUG] - AnbMaker export-raw fails to extract ANB file correctly

Open McArdellje opened this issue 2 years ago • 1 comments

OpenKH Build 471

OpenKH Program OpenKh.Command.AnbMaker

Describe the Bug running AnbMaker export-raw throws an error at (what I think is) this line: https://github.com/OpenKH/OpenKh/blob/1bcede06f0a7cff1828195e1dbbb099da86ab2fc/OpenKh.Kh2/Motion.cs#L105

To Reproduce Steps to reproduce the behavior: Run .\OpenKh.Command.AnbMaker.exe export-raw with any anb file

Expected behavior An FBX containing the animation to be created

Additional context I was trying to extract the anb files from anm/ex/p_ex100 from Kingdom Hearts 2

program output:

Writing to: C:\Users\mcard\Downloads\openkh\EEX00001C.motion.fbx
FATAL ERROR: Specified argument was out of the range of valid values. (Parameter 'count')
   at System.Linq.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument)
   at System.Linq.Enumerable.Repeat[TResult](TResult element, Int32 count)
   at OpenKh.Kh2.Motion.RawMotion..ctor(Stream stream)
   at OpenKh.Command.AnbMaker.Commands.ExportRawCommand.<>c.<OnExecute>b__9_6(Entry barEntry, Int32 barEntryIndex)
   at System.Linq.Enumerable.SelectIterator[TSource,TResult](IEnumerable`1 source, Func`3 selector)+MoveNext()
   at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
   at OpenKh.Command.AnbMaker.Commands.ExportRawCommand.OnExecute(CommandLineApplication app)
--- End of stack trace from previous location ---
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](CommandLineContext context)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](IConsole console, String[] args)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute[TApp](String[] args)
   at OpenKh.Command.AnbMaker.Program.Main(String[] args)

McArdellje avatar Apr 18 '23 18:04 McArdellje

Verified bug. Happened to all anb files I have tried. Same error.

Vladabdf avatar Jun 19 '24 15:06 Vladabdf