In past tutorials, we went through brief tool introductions and learned how to do basic editing on our model. Now let's make a more significant edit, replacing one(or more) mesh(es) with another(s). Remembering that our model is modular, this means that it is made up of smaller parts, and can be adapted with new parts, something similar to an action figure.
Getting Started
For this tutorial we will use two separate Blender files. One contains the avatar we want to modify, the other a template where we create the parts of our model. This template will support us in maintaining and improving our derived avatars. Furthermore, through the template we can create new parts and test them and then transfer them to certain avatars.
To start, let's open a new file to import one of my VRM samples, for example 'anthro_female_wolf.vrm', save the file with the name 'JoggingWolfGirl', or whatever name you prefer. Remember to update the model metadata, if in doubt read Model Information - VRM documentation.
Now in TopBar, go to ‘File > Append’, search for the file ‘anthro_female_canine.blend’, it is one of my available templates. When selecting the .blend file you will see several folders with components that make up that file, go to 'Mesh' and then select 'AthleticWear'.
A copy of the mesh from another model will be imported as a new object. In ‘Scene Collection’ you will notice that the new object is separated from the armature, where our main model is located.
Let's adjust the new outfit little by little. First let's hide Outfit to better view AthleticWear. With Outfit selected press 'H' or disable the preview (Hide in Viewport) in Outliner, you can disable the rendering of the object as well (Disable in Renders). You may have noticed that the character's body is cut to the appearance of the previous clothing, we will resolve this later, let's configure the new clothing first.
Then, with AthleticWear selected, in Object Properties go to Relations, set Parent = Armature, Parent Type = Object. You will notice that AthleticWear will be inside Armature. Then go to Modifiers Properties and add the Armature modifier. In the modifier set Parent = Armature. Select Armature and switch to Pose Mode. Rotate or move the bones near AthleticWear and see if the mesh deforms as desired. Next we will configure the AthleticWear material. In VRM material check ‘Enable VRM Material’. The material may have some settings already defined in the template model, feel free to change the values and modify the appearance.
Now let's import a new body into the model in the same way as AthleticWear. Through Append select the mesh ‘FemaleAnthroBody_mesh’, a new object will be created. Some important details to be noted, the names of the object, mesh and materials were added '.001' at the end, it is common for Blender to add numbering when a new object and/or its components have the same name as an existing one , which is our case.
We could simply delete the old object and replace it with the new one, but our object is already assigned to our VRM settings. In Sidebar in the VRM tab in 'VRM 0.x BlendShape Proxy', in the BlendShape Group 'Viseme A', when we alternate the values in the slider, notice that part of the neck moves along with the jaw, remembering that the head and body are separate objects (in this case, if only the jaw moved, the part of the neck mesh close to the jaw could go beyond it, becoming visible at the mouth opening). VRM's BlendShape Group allows us to synchronize the BlendeShapes/ShapeKeys of several objects as if they were one.
If we try to delete 'FemaleAnthroBody' permanently, using 'Shift + X' for example, the slot it was in will be empty. We could simply fill this slot with the new body, however we would have to do the same in other BlendShape Groups where the old body was connected, in our case there are not that many, but imagine if we were doing it for CanineHead? The head contains the majority of BlendShapes and if we simply deleted it to replace it with another one we would have to make many updates to several BlendShape Groups, and believe me, that would be a very arduous task!
What if we rename the new object with the name of the old one? Well, when we do something like this, Blender will automatically add a number to the end of the name of the old object and the new one will take its name, however, as shown in the image below, even with the name changed the object will continue to be linked to the BlendShape Group.
So what would be the solution? In our case it would be replacing only the mesh and not the entire object. First hide Armature and Colliders for better viewing. Next, change the parentage of the new body, Parent = Armature; Parent Type = Object, to facilitate selection in Outliner. Move the ‘FemaleAnthroBody_mesh.001’ object to 1m in Y.
Now with ‘FemaleAnthroBody’ selected, go to Object Data Properties, select the mesh ‘FemaleAnthroBody_mesh.001’.
You will notice that the old body will take on the appearance of the new body, however the orientation does not seem right. In the Sidebar, change the object's orientation in Item > Transform > Rotation > W: 1.0, X: 0.0, Y: 0.0 , Z: 0.0 . Don't worry too much about the rotation values being different from other objects, when the model is exported, all rotation values will be set to the same values. Out of curiosity, if you go to Edit Mode and try to edit the mesh, you will notice that the meshes of both objects will change, this is because both objects have the same mesh now.
You can now delete the imported object (FemaleAnthroBody_mesh.001). Then go to the VRM tab in Sidebar and change the Preview values of the BlendShape Groups that are linked to 'FemaleAnthroBody', you will notice that the BlendShapes will work in the same way as the previous mesh, this is because the VRM BlendShape Groups are linked directly with the object and indirectly with mesh. The mesh is a component within the object, so changing a component is like changing the object, which is why it remains the same in our VRM settings. Select Armature and in Pose Mode move some bones and see if the deformations occur as desired.
If you go to Materials Properties, you will notice that the materials are those that were imported together with the mesh, this is because the materials are components within the mesh, along with the shape keys. As the imported materials may have different settings from the previous ones, select each one and change it to the previous one. Feel free to modify the settings if you wish.
Now if you 3D Viewport in Display and with Viewport Shading: Material Preview, you can see that the body mesh exceeds that of the clothing. You can adjust the fabric of the garment a little more to cover the tip of the breasts, but there is one caveat, bare breasts have a different appearance than when they are wearing some type of bra (in our case, a sports bra), in general a little tighter.
To solve the problem, we will use the Mask modifier on the character's body. When adding the fill Vertex Group field modifier with AthleticWear, the imported mesh already had a vertex group ready for this garment, otherwise it would be necessary to create a new vertex group manually. Leave the Invert option selected. By default, Mask hides all vertices that are not part of the defined group, with Invert the effect is opposite. Tip: always keep the ‘MToon Outline’ modifier below the others, otherwise the outline effect may have unwanted results.
To avoid going on too long, I suggest reviewing the previous tutorial, make the necessary settings and changes to create a new thumbnail.
Before we export, select the entire model, in the VRM tab in sidebar click on ‘Operator > Validate VRM Model’, you may come across the following message 'The "FemaleAnthroBody" mesh has both a non-armature modifier and a shape key. However, they cannot coexist, so shape keys may not be exported correctly’, the modifier referred to in the message is Mask.
In this case we would have to apply the modifier before exporting the entire model, however if we go to Modifier Properties and try to apply the Mask modifier, the following message will be displayed 'Modifier cannot be applied to a mesh with shape keys'. If we read carefully, the problem is related to the BlendShape/ShapeKey present in the body. In ‘Blender Vanilla’ we would have to delete the existing shape keys, apply the modifier(s) and recreate the shape keys. Needless to say, manually it is difficult to do. Fortunately, there is an add-on that solves this specific problem, it would be SK Keeper. In particular, this would be one of the add-ons that I can't imagine myself without, basically it applies one or more modifiers and maintains the shape keys.
With the body selected, go to Header and select Object > ‘Apply Chosen Modifier (Keep Shapekeys)’.
Check Mask and click OK. At this point I recommend that you do not save the project yet.
Apparently everything went well, the hidden vertices were erased and the body cutout fits with the current outfit, but let's take a closer look. If we go to 'VRM 0.x BlendShape Proxy' again and look at some BlendShape Groups, more specifically at Visemes, you will notice that the reference to the 'FemaleAnthroBody' object has disappeared.
If you now look at the Object Data Properties of the body, you can notice that the mesh that was previously called 'FemaleAnthroBody_mesh.001' is now called 'FemaleAnthroBody_mesh.002'. But what happened?
So far I haven't viewed the add-on's source code, so I can't say for sure how it operates in the smallest details, but by deduction, I assume that it destroys the object and replaces it with another with the same name. The curious thing is that the name remained only in the object and was only changed in the mesh, if it weren't for this fact I might not be able to think of this hypothesis.
Load the file again (probably saved in a previous step). A simple solution to this problem, and most cases involving modifiers and shape keys, would be to make a copy of the object, apply one of the 'Keep Shapekeys' functions to the copied object and replace the original object's mesh in the same way we did in the steps previous ones, which involved the imported object.
Another even simpler solution, which we will use, would be with the body selected, in Edit Mode, go to Object Data Properties > Vertex Groups, Select ‘AthleticWear’ and then Select. All vertices in that group will be selected.
Until this step, do not save the file. Now press ‘X’ and delete the vertices. In practice, it will have the same effect as applying the Mask modifier. This solution is very specific for this case, in most other cases the ‘Copy > Apply > Transfer’ solution is the most appropriate.
Now let's try to export again, remember to remove the Mask modifier. Select the entire model, in the VRM tab in Sidebar, click on Operator > Validate VRM Model, the message regarding modifiers and shape keys will probably no longer appear. You may have also noticed two other messages, 'Non-tri faces detected in "FemaleAnthroBody". will be triangulated automatically.’ and ‘Non-tri faces detected in "AthleticWear". will be triangulated automatically.’ This is because the imported meshes are made up of quads and need to be triangulated, but don’t worry as this process will be automated during export.
If there is no other problem, go to Topbar, ‘File > Export > VRM’. You can save your VRM model as ‘JoggingWolfGirl’ or any other name. I suggest you don't save it, it's always a good idea to take a look at the export first, and I also suggest you keep the file saved the moment before deleting the selected vertices. This is because there is the possibility of making adjustments to the current clothing or group of vertices.
Open VseeFace or another similar program, load the new template and test as much as you want.
During this tutorial you may have asked yourself, “Why not export from the template?” Well, there are some reasons for this, one of them is that the armature of the template model is made up of several bones that were made for specific body parts, for example each type of ear has its own set of bones, the same goes for tails too. In Blender it is possible to separate bones into layers, in principle it would be enough to keep some of them enabled and select the desired bones.
However, when exporting the model, all bones are combined into the same layer, including unselected ones. To solve this problem, simply delete the unwanted bones before exporting.
Another reason is because the colliders were not configured in Blender but in Unity, the reason is because I find it easier to configure them in this game engine. Furthermore, the preview of materials is better in Unity than in Blender, that is, the rendering is closer to software that supports VRM, which leads to preference in choosing the game engine. You can try to configure them in Blender if you want, but it's up to you.
A tip if you want to decide between the template or the imported VRM model: if the edit is to change textures, replace meshes (for example, after changing vertex weights or the UV map), adding or removing materials, adding new meshes /objects (only if they are compatible with the current armature), in general small updates, prefer the imported model. Now if it is for more relevant changes, such as adding meshes that require new bones and perhaps new colliders and Spring Bones, in this case the best option is the template. I intend to make a tutorial dedicated to my templates, explaining their organization and usage tips in the future.
Conclusion
And that's it for today! In the next tutorial we will do the same process, but using Unity. Until next time!
Extras
Triangulate Modifier — Blender Manual
Cartoon Fundamentals: How to Draw the Female Form | Envato Tuts+ (tutsplus.com)
References
Introduction — Blender Manual - Objects
Interface — Blender Manual - Outliner