Moving a Dangle Chain

Summary

Created by @eagul Published March 20 2023

This guide will go deep into detail about moving dangle bones. Still unknown: changing bone parenting, rotating bones, editing the animgraph physics, adding new mirrored dangle chains for better coverage. If anyone has done tests on any of these topics, please contact me.

Assumed skill level: - You understand what you are doing, and know why you need to move dangle bones - You are able to read and comprehend instructions.

MATH WARNING

Okay.... Let's get started. If you are doing physics stuff, and need to move the dangle bones to fix the leverage effect, or for any other reason, you are in the right place. I will be using my long hair dangles project for examples here. Read 'Leverage effect' section in 'Dangle Bones' page for the reasoning behind why this process is necessary. (Using a normal hair dangle skeleton is not an option because it is parented to the 'head' bone, which causes horrible clipping and unnatural movements when the head turns. It might be possible to change the parenting to spine3 bone, but i have yet to test. Even if it is possible, the process described below would still be usefull to move the chains into the right positions) You will need to do a couple things: 1) Get everything into blender. 2) Isolate the bones you need to move. Hide other bones in armature edit mode. 3) Duplicate the bones and move them to the desired position. 4) Edit the bone positions in both the .mesh and .rig, sometimes editing the collision hitboxes in the .animgraph will also be required. I would also recommend having a rigged and weight painted mesh ready, for testing purposes. I will explain each step of the process more in-detail below.

MultiMesh Export

Usually, you can get the skeleton in it's real form into blender by using WithRig export on the mesh. However, if the .mesh contains bones that are not present in the .rig, you will need to use MultiMesh Export. You need to find a second (or even more) .rig file, so all the bones that are present in the mesh have a counterpart in the .rig. You then need to also add the meshes that correspond to the new .rigs and then export. Attached images show settings i used to export base\characters\garment\citizen_formal\torso\t1_072_shirt__netwatch\t1_072_ma_shirt__netwatch_dangle.mesh with rig, which i used for long hair dangles.

Editing the .rig

Open the .rig file in Wolvenkit. Under boneNames you can find which index corresponds to which bone. Expand boneTransforms. Locate the bones you want to move. Moving a bone in a chain will also move every bone that's parented to it (located lower than it in the chain). In the case of the image above, moving the bone selected in yellow, also moved the entire chain. In this case i moved bone 8 (selected in yellow) by 0.283076668 on the Y axis.

Animgraph edit

As you can see, the skeleton exploded. This is (to my understanding) caused by collision hitboxes on the spine bones. It will only happen if you have moved the dangle chain inside of those hitboxes. If this happens to your skeleton/mesh, follow these steps to fix it: 1) Open the .animgraph file in Wolvenkit. Expand the 'rootNode' array, and keep expanding untill you see collisionRoundedShape and then lower the roundedCornerRadius for each of the bones untill your skeleton no longer explodes. Here i set the value to 0, the animations work fine, but a correctly set value might reduce clipping in some poses.

Notice how editing the bone positions in the .rig also deformed/moved the mesh in-game. At least it's dangling nicely now, and it no longer explodes :copium:

Editing the .mesh

The .mesh also contains bone matrices. To my understanding, these are used to map the bones from the .rig to the vertices. You will need to move the bones in the .mesh to match the changes You did to the .rig skeleton, and this will fix the mesh deform. In this case, I'm editing bones 79-83. The goal is to move each of them by -0.283076668 on the Y axis. Open the .mesh in Wolvenkit and navigate to boneRigMatrices.

Next, open https://matrixcalc.org/ and copy paste each of the entries of the bone matrix into the calculator. Then press inverse.

Notice how the bottom row of the inverse matrix corresponds to the coordinates of the bone, which you can see in Blender.

Next, copy the new Y coordinate from the bone you duplicated and moved.

After that, return to the calculator, and press 'Insert in B', and then replace the matrix entry corresponding to the Y position of the bone with the new coordinate.

Then, press 'inverse'

Next, press the 3 small lines below the output, click on Show LaTeX, and copy the top row entries back into wolvenkit.

And now repeat all of those steps for each of your bones... enjoy... After that, you should be finished!

Last updated