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: fbx animation export: to_ktime #4954

Closed
luuyiran opened this issue Feb 13, 2023 · 0 comments · Fixed by #5355
Closed

Bug: fbx animation export: to_ktime #4954

luuyiran opened this issue Feb 13, 2023 · 0 comments · Fixed by #5355
Labels
Bug Global flag to mark a deviation from expected behaviour FBX Bugs related to the FBX format

Comments

@luuyiran
Copy link

hello,when I use assimp to export fbx animation, I found it can not dispaly correctly.
I find its k time array maybe wrong, I modified the code like this, my fbx animation finaly can dislay correctly.

this is my modification:

// FBXExporter.cpp line 1066
int64_t to_ktime(double ticks, const aiAnimation* anim) {
    if (anim->mTicksPerSecond <= 0) {
        return static_cast<int64_t>(ticks) * FBX::SECOND;
    }
    int64_t ret = static_cast<int64_t>((ticks / anim->mTicksPerSecond) * FBX::SECOND);
    return ret;
}

// line 2418/2432/2450
times.push_back(to_ktime(k.mTime, anim));

// line 2767, 1028 may means linear interpolate
n.AddChild("KeyAttrFlags", std::vector<int32_t>{1028});

now, my skeleton animation works fine, but morph animation still not work, I have writen the bs wights channel data into fbx, may be the connections not correct yet...

@luuyiran luuyiran added the Bug Global flag to mark a deviation from expected behaviour label Feb 13, 2023
@kimkulling kimkulling added the FBX Bugs related to the FBX format label Nov 28, 2023
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
Development

Successfully merging a pull request may close this issue.

2 participants