godotengine / godot-blender-exporter

Addon for Blender to directly export to a Godot Scene
GNU General Public License v2.0
1.12k stars 120 forks source link

add extra bones to rig will mess cloth skin weights #392

Open epth opened 3 years ago

epth commented 3 years ago

OS:

win10

Godot version:

Godot_v3.2.4-rc1_win64

Blender version:

Blender 2.93

Issue description:

1,export UpperCloth with the 1st rig( have 153 bones) to Godot, 2,add 4 extra bones(weapon.R weapon.L weapon.L.move weapon.R.move) to the 1st rig(153 bones) as 2nd rig(157 bones )in Blender and create action, 3,export the 2nd rig with action to Godot. 4.open the 2nd rig's escn in Godot and merge UpperCloth from 1st rig's escn to skeleton as child.then play action,the cloth will have strange shape because the weights are not match the 2nd rig's bone index's

I have compared the 1st and 2nd escn file in notepad, the extra bones's are start with bone index 105(weapon.L 105,weapon.L.move 106,weapon.R 132,weapon.R.move 133), and UpperCloth are bind with bones that after index 105,so this maybe the reason why weights will mess. the weights are not bind with bone name but the index.

Why have to merge cloth to the 2nd rig? In some case have to merge cloth to a rig that have extra bones, for example, if someone want to implement a dressing system and there is a fox tail that have tail bones, for game performance considerations, these tail bones are not needed when the player is not wearing a fox tail, it will mess as well when tail add to the rig that have tail bones if not bind with bone names,

Minimal reproduction project:

merge_cloth_error_weights.zip

blender_rigs.zip

epth commented 3 years ago

image

image