Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Import a specific FBX model with assimp 5.1.6/5.2.1 will freeze the app #4395

Closed
jianliang79 opened this issue Feb 18, 2022 · 6 comments
Labels
Bug Global flag to mark a deviation from expected behaviour FBX Bugs related to the FBX format

Comments

@jianliang79
Copy link

When importing a specific FBX model with assimp 5.1.6/5.2.1, assimp will never return from Importer::ReadFile(). After some investigation I found that it seems that there is a deadloop in FBXConverter::GetRotationKeyframeList().
The FBX model which can reproduce this issue can be downloaded from the following link:
https://drive.google.com/file/d/10FKfIoY22yRsZI2wTzKyzNMT7HATY6f4/view?usp=sharing

BTW: Importing this FBX model with assimp 5.0.0 works well. This seems to be a regression of assimp 5.1.x +
@jianliang79 jianliang79 added the Bug Global flag to mark a deviation from expected behaviour label Feb 18, 2022
@kimkulling kimkulling added the FBX Bugs related to the FBX format label Feb 21, 2022
@kimkulling
Copy link
Member

Thanks for the report! I will check it!

@tippesi
Copy link

tippesi commented Mar 21, 2022

I can report the same issue with assimp 5.2.3

@kimkulling
Copy link
Member

Hm, bad! Anyway, thanks for your testing ...

@jianliang79
Copy link
Author

The following patch can fix this issue:

@@ -3326,9 +3326,9 @@ FBXConverter::KeyFrameListList FBXConverter::GetRotationKeyframeList(const std::
float vc = curve->GetValues().at(1);
for (size_t n = 1; n < count; n++) {
while (std::abs(vc - vp) >= 180.0f) {
- float step = std::floor(float(tc - tp) / (vc - vp) * 179.0f);
+ double step = std::floor(double(tc - tp) / std::abs(vc - vp) * 179.0f);
int64_t tnew = tp + int64_t(step);
- float vnew = vp + (vc - vp) * step / float(tc - tp);
+ float vnew = vp + (vc - vp) * float(step / (tc - tp));
if (tnew >= adj_start && tnew <= adj_stop) {
Keys->push_back(tnew);
Values->push_back(vnew);

@ghost
Copy link

ghost commented May 18, 2022

I would love to see this fix get incorporated into codebase. 2 of MIXAMO animations are causing assimp to freeze.

kimkulling added a commit that referenced this issue Jun 3, 2022
Fix Import a specific FBX model will freeze the app #4395
@kimkulling
Copy link
Member

Closed by #4554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Global flag to mark a deviation from expected behaviour FBX Bugs related to the FBX format
Projects
No open projects
Development

No branches or pull requests

3 participants