artieficial / ApplyAccessories

Useful tool for merging armatures in Unity and adding accessories in VRChat.
MIT License
68 stars 3 forks source link

"Don't Reuse Bones" should not generate duplicates for bones which have no weights #10

Open Krunklehorn opened 2 years ago

Krunklehorn commented 2 years ago

I'll refer to "bones which have no weights" as simply "empty bones" from here out.

When exporting to FBX, Blender culls vertex groups if they don't have any vertices assigned to them or if no corresponding bone is found in the armature object linked by the Armature component. It doesn't do the opposite, it doesn't cull bones that don't have any vertex groups to link to them.

Most asset authors don't remove these extra bones before exporting, they just attach the entire avatar's armature and go. Apply Accessories will then duplicate every single bone when "Don't Reuse Bones" is checked, even those which are unnecessary.

A pair of arm warmers for example will not only double the avatar's bone count, but also break avatar dynamics until the user adds all of the extra bones to the list of ignored transforms on each physbone component.

The "Don't Reuse Bones" option should handle this somehow, either by detecting and ignoring these empty bones or by allowing the user to select required bones from a list before duplicating.

artieficial commented 2 years ago

Thats a good point, I'll look into it