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

feat: Fix combineSkeletons #1569

Merged
merged 2 commits into from
Jan 16, 2025
Merged

feat: Fix combineSkeletons #1569

merged 2 commits into from
Jan 16, 2025

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Jan 14, 2025

This PR fixes combineSkeletons.

There is a model that uses the same skinIndex accessor but not the same skinWeight accessors between meshes.
This PR updates the implementation of attributeUsedIndexSetMap to use both skinIndex and skinWeight accesstors.

The same skinIndex accessor could also be used between different bone sets.
Clone the bone set if the skinIndex accessor is the same but the bone set is different.

There is a model that uses the same skinIndex accessor but not the same skinWeight accessors between meshes
This commit updates the implementation of attributeUsedIndexSetMap to use both skinIndex and skinWeight accesstors

The same skinIndex accessor could also be used between different bone sets
Clone the bone set if the skinIndex accessor is the same but the bone set is different
@0b5vr 0b5vr added the bug Something isn't working label Jan 14, 2025
@0b5vr 0b5vr added this to the next milestone Jan 14, 2025
@0b5vr 0b5vr requested a review from ke456-png January 14, 2025 09:15
@0b5vr 0b5vr self-assigned this Jan 14, 2025
// Collect skin index attributes
// skinIndex attribute might be shared among different bone sets
// If there are multiple bone sets that share the same skinIndex attribute, clone the attribute
const skinIndexNewSkinIndexBonesMapMap = new Map<
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is a skin index accessor that is used with two or more different bone sets, you can check by seeing inside the skinIndexNewSkinIndexBonesMapMap

The continue statement was not working as intended

I also forgot to set the new attribute when we found an already registered skin index attribute

I had to change eslint `@typescript-eslint/naming-convention` rule in order to use `_` for parameter name
See: https://typescript-eslint.io/rules/naming-convention/
@0b5vr 0b5vr force-pushed the fix-combine-skeletons branch from 771f39b to 902e6d8 Compare January 15, 2025 08:36
Copy link
Contributor

@ke456-png ke456-png left a comment

Choose a reason for hiding this comment

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

Thanks!

@0b5vr 0b5vr merged commit a6ac76e into dev Jan 16, 2025
5 checks passed
@0b5vr 0b5vr deleted the fix-combine-skeletons branch January 16, 2025 07:29
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

Successfully merging this pull request may close these issues.

2 participants