- Home /
Skinned Mesh swapping tips to avoid deformation
Hiya all!
We are trying to create skinned mesh models that have swappable clothing in our game, so far I've been able to figure out bones issues, single mesh skins from asset bundles on the fly, partial animations, and how to automate character structure through our game server database.
Here is the problem I'm running into. Currently it seems that when swapping out mesh that has a different poly count than the original that there is model deformation that is occurring. I'm not sure whats exactly causing the problem but it almost seems like the vertices want to be bound to specific other vertices on the model. I've been working with our artist and we are drawing blanks on this. We are using a non-biped rigs out of 3DSMax. Meshes attached to single bones don't seem to have any issues (but this might not be related) it also might be that these meshes are the least altered (ea have the same poly count)
So my question is, what tips does the community have on model building when you are planning on swapping meshes on a skinned mesh character, especially when trying to avoid model deformation?
I might have answered my own question, It looks as if the deformations are indeed caused by binding meshes with different poly counts. It looks like the verts are unbound, weighted wrong, or assigned to the wrong pieces. Doing some more poking around it seems like 3ds max has a solution for this called the "Skin Wrap $$anonymous$$odifier" it recalculates vert binds and weights on the skinned model. I'm going to have my modeler is doing this and if not give this a try and see if it works.
Answer by Trent · Feb 07, 2011 at 07:26 PM
So working with our 3D Modeler we found that what you need to do is first create a base model, then you can add in your new mesh component (baggy pants, jacket) then use the "Skin Wrap Modifier" in 3DS Max. You need to make sure that when its imported into unity that the component is a skinned mesh renderer. You can do this by exporting out at least two sections and making sure the bones are exported as well.
I wanted to add another discovery that fixes the "Number of bind poses doesn't match number of bones in skinned mesh" which is also related to the question above. We found out today that you cannot use multiple materials in a single mesh. When unity imports the FBX file it turns the separate materials into sub-meshes that cause the above error when swapping out skinned meshes.
But how to deal with multiple materials within a single mesh? I need multiple materials. Do I need to create additional mesh to all my submeshes?
Answer by parkertroiani · May 29, 2019 at 08:21 PM
https://gyazo.com/c831d26f495d8dbbae8eafcf6c54f485.gif
Make sure that the objects you're trying to swap are using the same influences NO MORE, NO LESS.
If you're in a situation where you're trying to swap objects that use different influences, you will need to ensure that they have at least 0.001 influence on the bones it doesn't have.
For instance, if you're swapping a tank top with a long sleeve shirt, you will need to pick some verticies on the tank top to have 0.001 influence of the upper arms and forearms so that your mesh doesn't try to fill the influences with other things. Reason being, some softwares (Maya in my case) by default delete un-used influences on FBX export.
Your answer
Follow this Question
Related Questions
Access skinned mesh vertices 2 Answers
Smoothing Errors with Skinned Mesh Renderer 1 Answer
Manipulate skinned mesh? 1 Answer
Combining Skinned Meshes 3 Answers