#How to insert another Mesh into an Avatar rig
1 messages · Page 1 of 1 (latest)
if the had doesn't have to be skinned (deformed through the rig), you can simple set the head bone as the parent of the external head.
if it needs to be rigged too, that's more complex, there are some guides about character customization out there
https://medium.com/@larissaredeker/3d-character-customization-fd95a1d57ae
there was an article that I think showed what you need but I am not sure if I can find it anymore
I know I can just attach it to the object, but this only works in Unity.
I have a later step that converts the model into another format, and when I use the converted model, the head is reset back to the ground (0, 0)
ah for other applications too,
not sure how well it works to re-export a model from unity if you try to join it, otherwise it might be better to do it in blender if you need it outside unity, but I have no idea about how to approach that then
usually you could have the same rig, including head bones, and skin the head to that bone, so that all elements share the same rig
the tricky part will be that for regular models, the head would be skinned to the head bones, and that information needs to be present in the skinned mesh renderer.
if you have worked with equipping of clothes in vr chat before, you might have seen scripts that remap the bone map from a skinned mesh renderer from the clothes to the target character.
to make this work, the target character would have to have all the required bones, and the rig should be the same too,
the script then would replace the bone map of the skinned mesh renderer containing only the head, with the same named bones from the target model skinned mesh.
so, if that is the approach,
assuming I have a head model and a body model, both have the exact same rig from the source application.
I can import both into unity, and run a script that does the bone remapping like I described.
and then both skinned mesh renderers will deform with the target model mesh.
before doing that, I would copy the skinnedMeshRenderer component from the head object, onto the target model object.
then the head copy on the target will still deform with the original head object, so you apply the mapping script, like this one
https://forum.unity.com/threads/tutorial-how-to-make-clothes-animate-along-with-character.475253/
found this too now, haven't tried it: https://github.com/CascadianWorks/Unity-Mesh-Transfer-Tool
perhaps also useful
https://forum.unity.com/threads/assetpostprocessor-skinned-mesh-renderer-bone-index-reorder-solved.401872/
in a final step you might even be able to combined skinnned meshes into a single one, not sure how complex this is but there seem to be some assets on the asset store for that
for export, it might also be possible to combine the non skinned mesh head with the skinned mesh body, in case you don't have the head rigged,
the requirement is that the original data of the skinned mesh has to be maintained. vertex indices, positions, etc. so for example I think the head could be an addtional submesh in the mesh asset that was originally for the skinnedMeshRenderer body.
I think it's possible to make an editor script for this and then store the result as mesh asset, but that might be quite complex with skinned meshes (not sure if you can write all the data that skinned meshes usually need)