Hi
It is unfortunately not easy, here is the docu I wrote:
http://www.makehumancommunity.org/wiki/Documentation:ClothesV2if that is tl;dr then you should check this (document in same chapter):
http://www.makehumancommunity.org/wiki/Documentation:MakeClothes_Vertex-Groupsand look at the crown .. then you see we all have the same problem.
Technically it is like that: each vertex of your assets looks for 3 vertices nearby, It uses those of nearest distance and of course in the group you want to use.
A hat like this will partly find the ears (I guess) and then will distort, because you modelled it in Blender on a standard mesh and now use a different character
So a group without the ears might already help.
When you always use the same 3 vertices the hat will change linear to the character, it might be round or oval, might change height but will not be distorted.
Pure math, like in real life, okay my hat does not deform with my ears
If you want to read code to understand this
the mathematical concept are so-called barycentric coordinates. Here you have the three vertices at the outside and the S inside is your vertex on the clothes.
https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Baryzentr-ko-def-2d.svg/420px-Baryzentr-ko-def-2d.svg.pngOkay just bragging,
but in a way the image represents what happens inside in MakeHuman. MPFB works the same unless Joel invented a different algorithm.
Greetings
Punkduckj