Closed NicusorN5 closed 1 year ago
Update 1: Updated post with a log generated from importing a example provided above.
As of today, I tried to research this issue, here's what I found today:
I can't even properly debug this because the unmanaged variables are optimized away. The boolean expression
time < endTime || !lastFrame;
in L338 in the function ProcessAnimationCurveFloatsHelper
is never true when the importer gets stuck. This is because oneFrame
is 0 and that (speculation) endTime
is approaching infinity.
I'm still investigating this issue...
Update from the previous post: FbxTime::GetOneFrameValue
returns 0, so as consequence, the loop at L338 in AnimationConverter.h
is infinite. The return type of FbxTime::GetOneFrameValue
is FbxLongLong
and it is a typedef of FbxInt64
(FbxInt64
is signed __int64
).
A workaround by checking if oneFrame
is 0 makes the importer return a empty animation. This is not acceptable behavior.
I just wrote a fix for this issue. This is why the issue existed.
FbxTime::eFrames30Drop
is passed to FbxTime::GetOneFrameValue
0 is returned. The fix is re-using a valid value. The documentation says FbxTime::eFrames30Drop
is supposed to return the same value as eNTSCDropFrame
.oneFrame
being 0, the loop is infinite therefore resulting in the issue initially described.keyFrames
list will get filled with repeated value until the importer crashes. (the error being an out-of-memory exception).The fix is checking if oneFrame
is 0, then setting it again to a valid number.
The valid number is set to FbxTime::GetOneFrameValue(FbxTime::eFrames1000)
(the smallest value)
I will create a PR after this post.
Release Type: Latest official release
Version: 4.1.0.1734
Platform(s): Windows
Describe the bug Loading animations from a FBX 3D animation literally takes hours before being shown a
OutOfMemoryException
.To Reproduce Steps to reproduce the behavior:
Use a animated 3D model and export it as a FBX. I've used for example (models are removed, sorry):
https://sketchfab.com/3d-models/ak-47-47e1f4abe10e4ea9909708529b67a488https://sketchfab.com/3d-models/m4-animations-95b877e551254a2e8cc42add94e11f131.1) I've also used https://github.com/JackPilley/BlenderToStrideAnimationSeparator but I still get the out of memory exception. I don't get the
multiple FBX stacks
warning though.2.) Import the model and skeleton into Stride. Works successfully.
3.) Import the animations. This will not work, atleast with the given examples.
Expected behavior Animations being properly imported.
Screenshots Error report (generated using a propietary model)
Logs and callstacks Log reported with a example model from above: