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

gltf: Allow more than 4 joints but warn and ignore them. #61912

Merged
merged 1 commit into from
Jun 11, 2022

Conversation

lyuma
Copy link
Contributor

@lyuma lyuma commented Jun 10, 2022

Fixes: #56705

Removes check for WEIGHTS_1 and JOINTS_1 and allows the normalization code to execute on the first 4 joints - this likely brings back the old Godot 3.2 behavior, and this is legal glTF 2.0 behavior

Client implementations MAY support only a single set of up to four weights and joints, however not supporting all weight and joint sets present in the file may have an impact on the asset’s animation.

Prints a warning once per file if any meshes had extra joints:
image

I'm assuming that the 4 most important influences will be saved into JOINTS_0 but I do not know if this is guaranteed.
image

@lyuma lyuma requested review from a team as code owners June 10, 2022 19:53
@Calinou Calinou added this to the 3.5 milestone Jun 10, 2022
@lyuma lyuma force-pushed the allow_more_than_four_weights branch from 33c60d2 to 7d970b9 Compare June 11, 2022 01:41
if (a.has("WEIGHTS_0") && !a.has("WEIGHTS_1")) {
if (a.has("WEIGHTS_1") && a.has("JOINTS_1")) {
if (!has_warned) {
WARN_PRINT("glTF: Meshes use more than 4 bone joints");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need testing, but WARN_PRINT_ONCE should do what you're reimplementing with the bool.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not work as "once per file" though, so this approach might be best.

@akien-mga akien-mga merged commit 5dd602d into godotengine:3.x Jun 11, 2022
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants