Adding Clothes by Merging Armatures: Difference between revisions
(Just a walkthrough of how to use CATS to merge armatures and add clothes to avatar bases that they're not intended for. Hopefully it's styled well enough. Just hit that save button c'mon hit it.) |
mNo edit summary |
||
| Line 37: | Line 37: | ||
You may notice that your avatar looks a little monotone and grey (or magenta). This is fine, it’s just not referencing the materials as it would in unity. You don’t need to import said texture, but it’s probably for the best that you change the base color so that it’s not white, just so detecting clipping is a little more easy. | You may notice that your avatar looks a little monotone and grey (or magenta). This is fine, it’s just not referencing the materials as it would in unity. You don’t need to import said texture, but it’s probably for the best that you change the base color so that it’s not white, just so detecting clipping is a little more easy. | ||
[[image:MaterialEdit.png]] | |||
Since we’ve set up the material, we might want to consider adjusting blendshape values. That’s under the data tab (green, downward pointing triangle icon). Under shape keys, find the ones that you typically wear and adjust them to your liking (if you have a blendshape set to something like 58 in unity, it’ll look like 0.58 in blender. 100 in unity is 1.0 in blender). For the purposes of adjustment, I would make sure that any blendshape that’s used for clothes are set to 0. It just depends on how masochistic willing you are to adjust vertices. | Since we’ve set up the material, we might want to consider adjusting blendshape values. That’s under the data tab (green, downward pointing triangle icon). Under shape keys, find the ones that you typically wear and adjust them to your liking (if you have a blendshape set to something like 58 in unity, it’ll look like 0.58 in blender. 100 in unity is 1.0 in blender). For the purposes of adjustment, I would make sure that any blendshape that’s used for clothes are set to 0. It just depends on how masochistic willing you are to adjust vertices. | ||
[[image:ShapeEdit.png]] | |||
=Importing the Clothes/Adjusting Clothing Rest Pose= | =Importing the Clothes/Adjusting Clothing Rest Pose= | ||
You can import the clothes now. You’ll likely need to adjust a few things to match armatures prior to merging it. At the upper right, select the root object for the clothes (the thing that holds the armature and the meshes) and scale it (shortcut key is S) so that it roughly matches the bones of your avatar. It should scale the mesh with the armature. If the rest pose does not match your avatar, you will need to utilize CATS to adjust the clothes rest pose. Near the viewport, you can find a ‘<’ near the upper right of that area. If they already match, this is something that you don't need to worry about. | You can import the clothes now. You’ll likely need to adjust a few things to match armatures prior to merging it. At the upper right, select the root object for the clothes (the thing that holds the armature and the meshes) and scale it (shortcut key is S) so that it roughly matches the bones of your avatar. It should scale the mesh with the armature. If the rest pose does not match your avatar, you will need to utilize CATS to adjust the clothes rest pose. Near the viewport, you can find a ‘<’ near the upper right of that area. If they already match, this is something that you don't need to worry about. | ||
[[image:ScaleUp.png]] | |||
[[image:PoseMode.png]] | |||
You may need to rescale the clothing armature and mesh after adjusting the pose to get it to get the armatures to match more closely. | You may need to rescale the clothing armature and mesh after adjusting the pose to get it to get the armatures to match more closely. | ||
| Line 56: | Line 63: | ||
=Merging Armatures= | =Merging Armatures= | ||
Save. Save again as a new file. Save again as 450 different files. Double check the bones. Triple check them. Have a friend check them. Or don’t. I’m not your parental unit. But what I will insist upon is that we look at the CATS plugin, particularly the Custom Model Creation section. We will want to make sure that we have Merge Armatures selected. Since we’ve paired up and matched bone names, we can select “Merge All Bones.” Then we will want to untick “Join Meshes,” as we want to adjust the clothing mesh after we’re done merging it. I’ve kept “Remove Zero Weight Bones” and “Cleanup Shape Keys” checked. In the base section, make sure the avatar’s armature is there. To Merge should have the clothing’s armature. Once that’s all done, we can hit the Merge Armatures button and watch the magic happen. | Save. Save again as a new file. Save again as 450 different files. Double check the bones. Triple check them. Have a friend check them. Or don’t. I’m not your parental unit. But what I will insist upon is that we look at the CATS plugin, particularly the Custom Model Creation section. We will want to make sure that we have Merge Armatures selected. Since we’ve paired up and matched bone names, we can select “Merge All Bones.” Then we will want to untick “Join Meshes,” as we want to adjust the clothing mesh after we’re done merging it. I’ve kept “Remove Zero Weight Bones” and “Cleanup Shape Keys” checked. In the base section, make sure the avatar’s armature is there. To Merge should have the clothing’s armature. Once that’s all done, we can hit the Merge Armatures button and watch the magic happen. | ||
[[image:Merged.png]] | |||
=Adjust the clothing mesh= | =Adjust the clothing mesh= | ||
Revision as of 00:20, 21 November 2023
Merging Clothes to an Avatar Base Or as I like to call it...
How do I put on clothes??/ Virtual entity edition
Welcome to Hell My our tutorial on how to utilize the wizardry of blender and CATs to merge armatures n’ alter vertices to fit clothing onto your would-be naked avatar. This is useful, especially if you're trying to keep your bone count low or you're trying to add clothing to an unsupported avatar. Things may break. You may cry. It’s part of the process. Keep in mind, you are more resilient and persistent than any complications software may bring. You will be armed with backups (my project folders are messy with file revisions and file names littered with keysmashes and swears) and this document (for what it’s worth). And given enough time, you’ll be bestowed with 「 aesthetic 」and 「 suffering 」. Just keep in mind, I don’t know what I’m doing. There might be better ways of doing all of this. Please let me know or just revise this page.
Outline
If you know what you’re doing, here’s a quick outline of how I’ve approached this.
1. Import Avatar Base
- Adjust the avatar’s material/base color so that it’s not the same as the clothes.
- Remove clothes/objects that you don’t want
- Adjust the blendshapes to your liking, but ensure that any blendshapes that manage clothes are set to 0.
2. Import Clothes
- Check to see if there’s blendshapes that might help the clothes conform to your avatar
- If the rest pose of the clothes do not match with the avatar, use CATS to adjust the clothing’s rest pose
- Scale everything so that the armature of the clothes roughly overlaps the Armature of the Clothes
- Examine the clothes armature and make sure the bone name matches
3. Merge Armatures using CATS
- Double check bone names
- Under the Custom Model Creation, check everything except for Join Meshes, ensure the base Armature is your avatar, ensure to Merge is the clothing Armature
4. Adjust Clothing Mesh
- Cry CRY CRY CRY
- Proportional Editing is your friend in this cruel dark world
5. Adjust Avatar Base
- Make new blendshapes, weight paint (you wizard), and/or delete vertices that are covered by your clothes (You’re making like 5000 backups right?)
Importing The Avatar Base
Depending on what you have, you may be able to open a blend file. If your avatar base only has FBX or OBJ files, it's possible to import those into blender. First it's a good idea to delete the collection, light, and camera. By accessing the File Menu at the top, hover over the Import section, and then selecting the appropriate file (typically an FBX). Your imported avatar should show up in the scene collection located at the upper right area of the blender window (where we deleted those objects).
You may notice that your avatar looks a little monotone and grey (or magenta). This is fine, it’s just not referencing the materials as it would in unity. You don’t need to import said texture, but it’s probably for the best that you change the base color so that it’s not white, just so detecting clipping is a little more easy.
Since we’ve set up the material, we might want to consider adjusting blendshape values. That’s under the data tab (green, downward pointing triangle icon). Under shape keys, find the ones that you typically wear and adjust them to your liking (if you have a blendshape set to something like 58 in unity, it’ll look like 0.58 in blender. 100 in unity is 1.0 in blender). For the purposes of adjustment, I would make sure that any blendshape that’s used for clothes are set to 0. It just depends on how masochistic willing you are to adjust vertices.
Importing the Clothes/Adjusting Clothing Rest Pose
You can import the clothes now. You’ll likely need to adjust a few things to match armatures prior to merging it. At the upper right, select the root object for the clothes (the thing that holds the armature and the meshes) and scale it (shortcut key is S) so that it roughly matches the bones of your avatar. It should scale the mesh with the armature. If the rest pose does not match your avatar, you will need to utilize CATS to adjust the clothes rest pose. Near the viewport, you can find a ‘<’ near the upper right of that area. If they already match, this is something that you don't need to worry about.
You may need to rescale the clothing armature and mesh after adjusting the pose to get it to get the armatures to match more closely.
Now we just want to make sure that the bones on the clothes match the names of the bones on the avatar. Let's turn our attention to the upper right of blender. We’ll need to expand both the avatar’s armature and the clothing’s armature. It might be ideal to note down the avatar’s bone structure so it’s easier to compare it with the clothing.
For example, my avatar left arm structure looks something like Hips > Spine > Chest > Shoulder_L > UpperArm_L > Elbow_L > Wrist_L > (Insert all hand bones here)
The clothes looks like Hips > Spine > Chest > Shoulder_L > UpperArm_L > LowerArm_L. So the only arm bones for the clothes I’d need to rename is the LowerArm_L, and I would rename it to Elbow_L.
Of course, I would repeat this process with the right arm, and both legs, since the dress covers those bones as well. However, your mileage is likely to vary. The clothes may have a lot of other bones (like for the skirt, bones, or frills). We don’t need to worry about those, as those bones will simply merge to your avatar’s armature automatically. What we’re trying to do is just ensure that the bones relating to limbs are named properly so that we don’t have two different arm bones, spines, etc.
Merging Armatures
Save. Save again as a new file. Save again as 450 different files. Double check the bones. Triple check them. Have a friend check them. Or don’t. I’m not your parental unit. But what I will insist upon is that we look at the CATS plugin, particularly the Custom Model Creation section. We will want to make sure that we have Merge Armatures selected. Since we’ve paired up and matched bone names, we can select “Merge All Bones.” Then we will want to untick “Join Meshes,” as we want to adjust the clothing mesh after we’re done merging it. I’ve kept “Remove Zero Weight Bones” and “Cleanup Shape Keys” checked. In the base section, make sure the avatar’s armature is there. To Merge should have the clothing’s armature. Once that’s all done, we can hit the Merge Armatures button and watch the magic happen.
Adjust the clothing mesh
This is the part where this tutorial falls apart. While I’ve tried my best to make this as beginner friendly as I can, since there’s an impossible amount of combinations of clothes and avatar bases, things are kind of complicated. All I can offer is some advice.
0. Utilize youtube tutorials for basic blender modeling
- Go forth and create doughnuts! Or… Other things. Learn until you’re comfortable with manipulating vertices, edges, and faces. Keyboard shortcuts are my friend. They might not be yours. But being able to just click on, say, and edge, hit g to ‘grab,’ and then hit ‘z’ to bind that grab to the ‘z’ axis is useful for me. There’s tools that you can use in edit mode that’ll do the same thing. If they ever disappear, just hit ‘t’ to get the tools back.
1. Proportional editing is your friend.
- You can grab arbitrary features and have adjacent features move with your editing. You can adjust the range of it by rolling the mouse wheel while you’re moving/scaling/rotating whatever you have selected. Not before or after.
2. Mirrored editing is sometimes your friend.
- It’s not so much if the mesh you’re working with is not mirrored along the x axis. So if your clothing looks asymmetrical, then it’s unlikely to be of use.
3. Art takes time
- It sucks that art takes time and energy. But it just do be like that. Give yourself patience and grace for trying to work all of this out. It’s a lot.
Ultimately what we’re trying to do is to casually form the clothes over the body. Easier said than done, I know. I wish I could provide more than “Draw the rest of the owl” but I cannot.
Inhibit Clipping
By scaling armatures and trying to match everything up, the intention is to inhibit the body mesh from clipping through the clothing mesh. However, we might try selecting our avatar’s armature and go into pose mode to test how bone rotations might look, and we still might see some clipping. I’m going to propose 3 solutions.
1. Weight Paint the Mesh
- Please see Weight_Paint_Guide to get a general idea of weight paint transfers/auto weight painting. This is also another art. One that’s way above my paygrade. I guess ideally, you’d want the clothes to roughly match the body’s weights.
This Video is also a mondocat wiki sanctioned weight paint guide.
2. Utilize Blendshapes
In the event that per-existing blendshapes for your clothes do not prevent clipping, you may consider generating new blendshapes. To add one, make sure you’re in object mode. Select your avatar’s body mesh in blender, find that funny little green triangle (the data tab), and under the shape key section, click the + button. A Key will be added to the list. You may double click it to rename it. Ensure that it’s selected and go into edit mode. Confirm that we’re working on the blendshape by checking the upper left area of the viewport. If you see something like, “(numbers) MeshName : BlendKeyNameHere,” you’re good to manipulate the mesh. If Basis is up there, then we will want to go back into object mode and ensure that we have that blendshape selected. We will want to shrink edge loops that are covered by the clothes, especially near the joints. You can choose to be subtle or you could make that body a noodly monster.
3. Tactically delete edges/faces covered by clothes.
This is my favored one. Do not do this if you’re going to be taking off or changing into different clothes. If you know that your avatar is going to remain clothed and you’re not going to toggle the clothes off, then there’s no real need to have a surface underneath the clothes. Just make sure you have your backups before taking a chainsaw to your avatar’s edges n’ faces. I tend to leave a little overlap between the edges of the clothes and the body, just to be safe. It may be better to select edges or faces than vertices to better grasp what you’re deleting.





