Post by mauvemorn on Jul 27, 2022 10:06:47 GMT -5
I tried to make this tutorial as universal as possible, with every situation in mind, so it turned out a bit long. In practice, it takes a few minutes to do this.
HOW TO RIG ( ASSIGN WEIGHTS TO ) HAIR FOR THE SIMS 4 ( UNIVERSAL METHOD )
2). Another thing you should always do is study how a similarly shaped Maxis item is adapted. Clone it, export the .blend file, open in a new window. Check how it is rigged by going through every vertex groups. There will be a lot of them, the ones from the facial area affect the hairline only and should be ignored. Pay attention only to the ones that affect large areas of the hair itself. In most cases there would be only two of them: b__Head__ and b__Spine2__. Long hair can also have b__Spine1__. Hair with strands close to shoulders can have b__L_Clavicle__ and b__R_Clavicle__. The b__Neck__ bone usually affects only the hairline, so you can ignore it.

3). If you are using a maxis hairline as a part of your mesh, do not overwrite its rigging. It needs to be affected by those facial and neck bones to morph/move with the face. For this, you need to select only the area you want to rig:
- back to your hair, select the main shape of it and its uv_0;
- in UV editor enable sync;
- if the hole in the hairline is closed, disable Limit selection to visible, select a vertex in the middle of it, Select - Select Linked;
- Select - Inverse;
- Remove doubles with Merge distance set to 0,0001. This will ensure there will be no difference in weights where the hairline and the hair are joined;
- if you have a hard time telling where all the hairline's uvs are, select everything with A and assign a texture to the background;
- holding Ctrl Shift, click-and-drag to deselect the uvs of the hairline. Now only the hair is selected and ready to be rigged.

4). If maxis hairline is a part of your mesh, the needed vertex groups are probably already in the list. If not:
- switch to the .blend with a similar Maxis hair, double-click on b__Head__, Ctrl C to copy;
- in the .blend with your hair create a new vertex group with + button, double-click on it to rename, Ctrl V to paste b__Head__. The name must be identical, do not type it!
- do the same with every other vertex group that you need. Alternatively, you can copy those vertex group from the top (found under rig).

5).
- assign the whole selected area to b__Head__;
- if dealing with ponytails or similar, best to deselect the hair around the scalp so that you won't accidentally paint it with a spine bone. Switch to the orthographic (NUM5) side (NUM3) view, make sure Limit selection to visible is disabled, hold Ctrl Shift, and deselect that area of the hair so that only the ponytail remains. Does not have to be precise.

6). Change the pose of the rig to see the change the Gradient is making as your you're using it:
- add Armature modifier if it is not already, choose "rig" in the drop down menu. Enable Display modifier in Edit mode and Adjust edit cage to modifier result. Do not apply it;
- make the rig visible and selectable, select it, switch to Pose mode (TAB);
- select the bone in the neck area, press R Z -30 to rotate the head.

7).
- select the hair, switch to Weight paint, enable Face selection masking for painting, make sure Limit selection to visible is disabled;
- make sure to enable Auto Normalize (if it is enabled, disable and enable it again). This way, when you paint the area with b__Spine2__, it automatically gets subtracted from b__Head__;
- select b__Spine2__, choose Weight gradient;
- like in the reference, you want the paint to start fading when it reaches shoulders and end when the neck ends. Click at the tip of the tail and drag it up until it looks like that;
- select b__Head__ to ensure the paint was subtracted. If the tail is still fully red, select b__Spine2__ again, press Normalize all with Locked Active enabled;
- if you need to add more bones, the process is the same. Alternatively, you can use the process described in the next step.

8). If you, for example, will decide that the paint spread too much or too little, you can adjust it with Smooth tool. You can also use it to create new vertex groups. I'll show how to do the latter, just in case:
- say, you want to create b__Spine1__ out of b__Spine2__. Copy that vertex group, rename it to b__Spine1__, move it with up and down arrows if you want;
- enable Vertex selection masking for painting;
- choose Smooth tool. There you can decide what vertex group should be affected and play with the settings to get the desired effect;
- make sure the paint was subtracted from b__Spine1__;
- be careful with this tool because it can spread the paint too far. If that will happen, you can use Clean tool with higher value than 0 or/and Limit total ( if more than 4 bones are affecting the same area ).

9). Once done with everything, reset the rig back to the original!
- select the rig again, switch to Pose mode;
- with that or all bones selected choose Pose - Clear transform - Rotation.