Unity-Runtime-Animation-Recorder icon indicating copy to clipboard operation
Unity-Runtime-Animation-Recorder copied to clipboard

When I used "FBX Exporter", I got error message

Open YouMinJung opened this issue 4 years ago • 5 comments

When I used "FBX Exporter", I got error message. The error message is like below.

ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <437ba245d8404784b9fbab9b439ac908>:0) FbxObjectsManager.EditTargetFile (System.String targetFilePath) (at Assets/Unity Runtime Recorder/Scripts/FbxExporter/FbxObjectsManager.cs:28) FbxExporter+<ExportToFile>d__22.MoveNext () (at Assets/Unity Runtime Recorder/Scripts/FbxExporter/FbxExporter.cs:347) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <480508088aee40cab70818ff164a29d5>:0)

What is the problem and how can I solve this problem??

YouMinJung avatar Sep 27 '21 06:09 YouMinJung

Don't use it, it's just a beta version. Use Unity's official FBX exporter package instead: https://docs.unity3d.com/Packages/[email protected]/manual/index.html

newyellow avatar Sep 27 '21 07:09 newyellow

Thank you for your reply! Is it possible to extract the humanoid animation using FBX exporter? What I know it was impossible...

YouMinJung avatar Sep 28 '21 01:09 YouMinJung

The format of an animation is simple, just a name (the target transform's name) and values (frame number, xyz values). In most of the cases, Unity record a transform's animation by its name. But if it's a humanoid animation, the animation is recorded with a mapped skeleton name (e.g. skeleton.leftHand). So if you want to export the animation with FBX exporter, you need to change those animation's key name to transform's names. This can be done easily if you can code (but may take sometime though)

newyellow avatar Sep 28 '21 04:09 newyellow

Or another way to do this, is to record the humanoid animation with my recorder. But instead of using my FBX exporter feature, you record into unity .anim file format instead (that part of my script is more stable). And then you export the animated skeleton with FBX exporter. And can import the FBX again, then this time you can set it as Humanoid. Then you have the humanoid animation!

newyellow avatar Sep 28 '21 04:09 newyellow

Thank you so much! It works well.

YouMinJung avatar Sep 29 '21 07:09 YouMinJung