M3-org / CharacterStudio

Open source web based custom VRM avatar creation platform
https://studio.m3org.com/
MIT License
108 stars 26 forks source link

fix VRM0 spring bones #171

Closed Benjythebee closed 1 week ago

Benjythebee commented 1 month ago

PR fixes three things: 1. It adds support for a VRM to have no spring bones while having spring bone colliders. @pixiv/three-vrm won't load colliders in springBoneManager if there are no spring bones. However, as we noted in load-utils.js the json of the VRM does have information on colliders and we save them to userData for future use (exporting). The PR makes use of this information to assign the colliders from the VRM with no spring bones to other VRMs. image Conclusion: This means that colliders from a trait can affect the spring bones of other traits

2. Currently we only export the root bone of spring bones. We also completely ignore groups and assume a single bone forms the entire group of bones. This isn't true and this PR addresses this issue. It will now export groups of bones rather than a single bone. Below is an example of an output VRM: https://github.com/user-attachments/assets/2e671314-ba8f-45d4-95a5-73d976d53616

3. Add springBoneManager.update()