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

Joint data is not sent if it doesn't fit in one packet. #1277

Open
ksuprynowicz opened this issue Dec 20, 2024 · 0 comments
Open

Joint data is not sent if it doesn't fit in one packet. #1277

ksuprynowicz opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ksuprynowicz
Copy link
Member

This happens completely without warning, causing joint data to not send at all and making animations stutter or not work at all.
It can also stops transmission of blendshapes sometimes.
A fix would be to instead send two or more separate packets (not NLPacketList) in such case, each containing partial set of updated bones.
I believe this would be pretty easy to do. A place to start is AvatarData.cpp:

    int maximumByteArraySize = NLPacket::maxPayloadSize(PacketType::AvatarData) - sizeof(AvatarDataSequenceNumber);

    if (avatarByteArray.size() > maximumByteArraySize) {
        avatarByteArray = toByteArrayStateful(dataDetail, true);

        if (avatarByteArray.size() > maximumByteArraySize) {
            avatarByteArray = toByteArrayStateful(MinimumData, true);

            if (avatarByteArray.size() > maximumByteArraySize) {
                qCWarning(avatars) << "toByteArrayStateful() MinimumData resulted in very large buffer:" << avatarByteArray.size() << "... FAIL!!";
                return 0;
            }
        }
    }

This part should generate more packets instead if I understand correctly.

@ksuprynowicz ksuprynowicz added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant