Porting a Full Costume - enimaroah-cubic/Sb3UGS GitHub Wiki
HS2 and KK and several other games have clothes split into top and bottom parts. The second state for the clothes is split likewise. This is reflected in the hierarchy and meshes have to be parented to childs of specific transforms with names like n_top_a e.i. That part of the hierarchy is the same for both games and is copied later. But the difference between games is the skeleton the meshes are bound to. So we are required to skin the meshes for KK.
This page does not explain Replacing Meshes or how to build the list entry. Such things should have been learned long before using the information on this page.
This is situation after importing HS2 clothes and the KK body.
-
The clothes are skinned for HS2 and that can be used to make the first adaptions for the size. Scaling the root of the HS2 skeleton leads to the first rough match.
The additional difference in height of the breasts and even the shape can be adapted by translating, rotating and scaling HS2 breast joints.
Not all differences in proportions must be adapted at this point. But to reduce complexity of deformers we stop here, and now copy the full mesh hierarchy with Ctrl-D (Edit / Duplicate) !
The new part of the hierarchy is then moved into the KK hierarchy by drag 'n drop with the middle mouse button.
-
Further editing without the HS2 skin begins with welding the meshes - merge vertices of each mesh with a small distance.
After that the shape of the body can be nicely followed with the shrinkwrap deformer.
-
For the skinning we need good template meshes - meshes skinned to the KK skeleton with close vertices to all vertices of the new meshes.
Not all joints of the KK skeleton are used. We select one of the template meshes and then let the following script select all used joints:
{ string $sel[] = `ls -sl`; select -cl; int $i; for ($i = 0; $i < size($sel); $i++) { string $inf[] = `skinCluster -q -inf $sel[$i]`; select -add $inf; } }
This updated version of the script allows to select multiple meshes for the joint selection.
We add select the unskinned meshes and bind the skeleton to them using only the selected joints.
The default weights each vertex got from the previous step would lead to ugly deformations. Now we select those good template meshes, add select one newly bound mesh as destination, and then copy skin weights.
For the next newly bound mesh, we unselect the previous destination mesh, and select that new one instead, and repeat the copying. Special case for adjacent meshes! Sight-blocking meshes and corresponding top and bottom meshes with common border vertices require the exact same weights for the exact same joints for each border vertex. In the healer costume we can skin cf_top_healer_a_0 and cf_top_healer_huta_0 independently with the steps above. But when we begin the skinning for the bottom meshes, we also need to select one of the two as source meshes to get the exact same weights for cf_bot_healer_a_0. This is because for skinning of the bottom meshes we may use different meshes as sources than the one's we used when skinning the top meshes. -
For verification of the new weights we import an original animation. Especially for roll bones which correct parts which would look ugly from rotating natural joints - like the elbows e.i. - the original animations show us what we will see in the game (except for the customization of the character).
-
Painting the bodymask texture in 3d is nice, but you could also paint it in 2d with the help of the UV map.
-
When a bramask texture already works, there is no need for creating it again. Note the usage of the second UV map of the bra meshes.
-
When using Sb3UGS to edit the ChaClothesComponent MB, make sure to convert the reference for the optional clothes parts after dragging the Transform. Click "GameObject" to reference the hosting GameObject instead of the Transform asset. The game will crash when it references the wrong asset.
-
MainTex, Normalmap, liquidmask textures were reusable. Detailmask and Linemask don't match here.
Colormasks have the right UV layout, but the channels needed some inverting and swapping.