Transferring and Expanding Skeletons in Meshes

This guide will teach you how you can utilize Wkit's Json export feature to switch skeletons on meshes and also how to add new ones.

 

Please note that Wolvenkit and other modding tools are in constant development. Changes may affect the methods used in this tutorial in the future.

 

What you need:

- Wolvenkit (Stable version 8.6 is used in this guide)

- Notepad

- (Optional but used in this guide) My femV body base with complete skeleton

 

Usage examples of this guide:

- Refits for a different body type while keeping all materials and appearance information of the original mesh (described in this guide)
-  Adding dangle physic bones to a mesh that didn't have them

-  Adding more bones to a mesh to improve rigging

-  Expanding the skeleton to flip models from left to right arm, etc

- ...

 

Thank You to

- Wolvenkit Team, can never thank them enough for this awesome tool!

- Zwei cause she's awesome and was kinda the motivation to finally write this up

- Cool ppl of the CP77 Modding Community for being cool


In this tutorial I will cover how to put a female skeleton onto Johnny's alternate look while also keeping the physic bones. 

1. Copy my femV body base into your Wkit project and also add the mesh you want to expand the skeleton of. Make a copy of that mesh so you end up with a folder like this:

2. Right click the base body and also the copied version of Johnny's pants and Export to JSON.

3. You end up with two .json files of these meshes which you can open in Notepad. Open both, go to the window of the base body json and search for "bound". This will lead you down to a line called "boundingBox" which is where the initial skeleton data ends. Start making a selection directly above this line like this:

Hold shift and pull this selection up to the line that says "Bone Names".

4. Do ctrl+c to copy this selection. Now switch to the json of Johnny's pants and do the exact same selection there. But instead of copying, paste. Now you have put the skeleton of femV into the mesh file. 

5. However, there is some extra data in the renderchunk section that is safer to copy as well. Go back to the femV base json and search for "customData": [],

Start your selection in the line above that like this:

And pull it all up to "bonePositions":

Now copy this, repeat the selection in Johnny's pants json and paste this over it. Save the pants json file and inside Wkit, right click it and do 'Import from JSON'.

Your mesh can now be used for conversion, however beware that Wkit will likely throw you errors if you try to convert this to glb. The weights are very likely fucked too.

 

This mesh is ONLY for conversion! Wether you do that thru Wkit Import or Noesis doesn't matter. If your glb or fbx has correct weights, they will convert correctly. But the mesh data inside this edited json model is broken and cannot be used as is. Keep that in mind. !!Do skeleton edits to your conversion mesh, not your final one!!

If your mesh didn't have any physic stuff, this is all you have to do to transfer a skel from one body type to another.


But in Johnny's alt pants case it does have dangle physics that would be cool to keep. Getting these bones onto our new model will be a bit tedious, but it is also very easy.

 

This step can be done in Notepad, but I really prefer this in Wkit cause you cannot allow yourself any mistakes with this (like copying a number too few or too much).

7. Open your newly Imported-from-json Johnny pants mesh, that has the female skeleton now, inside Wkit. Also open the original unedited Johnny pants mesh, right click it and add it as a new vertical Document Group.

You will now see both next to each other neatly.

8. Expand the boneNames sections in both files and scroll down to the bottom of both bone name lists. On the original mesh, you will see the dangle bones near the bottom (bones 31-42). These are the ones we want to have in our new mesh.

9. Drag the first one of these (dyng_trousers_chain_01) over to the bottom of the edited pants mesh bone list. Make sure it is added as the new last bone.

10. Repeat this with all the dyng bones. ORDER IS IMPORTANT! So don't mess it up and be careful!

Finally, your edited pants file should have 214 bone entries in this order.

11. This is not all though! Bones are not only made of a name, they also have Matrices and VertexEpsilons, along with the BonePositions in the renderChunk section. 

 

Basically what you have to do now is drag and drop these values from the other sections of Johnny's og mesh to your edited one. Remember, we transferred bone names 31-42, so we also have to transfer RigMatrix 31-42, VertexEpsilons 31-42 and Bone Positons 31-42.

 

Order is again VERY important here! Wkit doesn't copy the values, it moves them. So essentially you always move value 31 until there is none anymore.

 

The section names are:

boneRigMatrices

boneVertexEpsilons

renderResourceBlob>header>bonePositions

Example on boneRigMatrices:


You move 31 to the bottom of the list in the edited file...

... until there is no Matrix 31 anymore and you get 214 (like bone name count) in your edited file. 

Do the same principle in the sections i listed above. Then save and you have a mesh with dangle bones added and full femV skel.


You're tired of hearing this but ORDER IS IMPORTANT! If you fuck it up your bones will get misplaced n ugly and good luck finding the exact culprit afterwards. 


Anyway, I hope you found this guide useful ♥ Happy Modding! 

 

- xBaebsae