-
Notifications
You must be signed in to change notification settings - Fork 1
Basic Mesh Transfer Tutorial
To demonstrate transfer of a mesh from one model to another, let's transfer Laxia's fancy hair from her formal costume to her adventuring costume!
You want to know how to get a model into Blender and through the compilation process in the first place. Please try this tutorial at least once, then come back. Also install the following two plugins: blender_lock_groups_with_vgmap.py and blender_delete_empty_vertex_groups.py (Right Click, Save As)
Please understand that this is an advanced skill and you should already know how to use Blender and make basic modifications. Also, I highly recommend understanding the basics of skeletal animation and weight transfer, or parts of this tutorial will seem like black magic and troubleshooting will be difficult. If you've never watched "3DMigoto Costume Mod Tutorial for Fairy Tail (PC)" by Ikaros, watch it. (This knowledge is not strictly necessary since Blender will take care of a lot of the voodoo magic parts for us to make this easy, but I will try to point out the difficult concepts as we go along.)
First, let's get the models we need. I grabbed Laxia's fancy dress model (/chr/npc/c402c/c402c.it3), which I will refer to as the donor model, and her playable model (/chr/pc/c002_p.it3), which I will refer to as the recipient model.
Note that /chr/pc/c002.it3 may look like her playable model (and it is), but it is the master model with animations, and not the costume model. Modifying c002.it3 will not have the effect you want.
Extract both models to both meshes/textures and to .gltf files, by running both ys8_it3_export_assets.py and ys8_it3_to_basic_gltf.py on both models. You should have both folders and .gltf/.bin files now, for both models.
In Blender, start with a new, empty workspace (File -> New -> General). If you have the default objects, remove those. Import the recipient model c002_p.gltf (File -> Import -> glTF 2.0). Second, import the donor model c402c.gltf. Always import the recipient model first!
We will examine the recipient model first! Hide the donor model if you need to. (In the outliner, you can click on the eye icon of an object to hide it.)
Examining the donor model, we can see the hair mesh that we want is part of the polySurface377
object.
If you expand polySurface377
, you can see there are actually 6 submeshes inside, each assigned to a different material.
Select polySurface377
, go into Edit Mode, and separate the object into its submeshes. (Mesh menu -> Separate -> By Material)
Now there are 6 polySurface377
objects - the original, and five more with .001
through .005
appended to the name.
Go back into Object Mode. Clicking on each one, we can see in this case that polySurface377
is the one we want.
We can now break it away from the recipient model. In Object Mode, select the submesh we want (polySurface377
), and clear its parenting (Object menu -> Parent -> Clear Parent).
We can delete the remainder of the recipient model. Right-click on the root (Armature.001
), and select Delete Hierarchy.
We are transferring the
We need to be sure that every vertex weight group is actually assigned to an existing bone (node) on the recipient model's skeleton, because we cannot add new bones to the skeleton. The plug-ins we installed will help us with the process.
Before scanning for missing weight groups, go ahead and delete any unneeded groups. Select the donor mesh (polySurface377
) in Object mode. Go to Object Data Properties (the upside down green triangle icon) on the side bar, vertex groups, and select Delete empty (unlocked) vertex groups (this is one of the plugins above).
Next, we need to find any missing groups by going to the same menu and selecting Lock groups using VGMap. Select all the recipient vgmaps from the backup folder.
Use the .vgmap files from the recipient model (c002_p
).
Here we can see that every group is locked, which means that this mesh is ready for transfer!
Be sure to unlock all the groups before proceeding.
What would you do if you found that there are groups that are missing? (unlocked groups when using the Lock groups using VGMap pluging)
-
First, check to see if those nodes are truly non-existent on your donor skeleton by exploring the hierarchy in the Outliner. It's possible that the nodes exist, but are not used by the donor model.
-
If there are groups that are truly missing, you will need to remove them. See this tutorial section from my Ryza tutorial, or this very similar tutorial section from my Cold Steel tutorial.
We need to find a suitable mesh for the hair to be placed. The simple answer might seem to be to replacing Laxia's current hair mesh. This will not (easily) work, however, because for some reason we cannot change anything about the bone palette of hair meshes, or they become invisible. (One of a huge list of unsolved mysteries regarding IT3...)
We want to preserve the look of the hair, so we need to be able to preserve its material. This is a combination of RTY2 (an assigned preset look) and MAT6 (the individual submesh material settings, for example texture filenames). Looking in c402c's polySurface377.rty2, we see:
{
"material_variant": 15,
"unknown": 0,
"v0": [
0.0,
0.0,
0.0
]
}
Therefore we want to find a mesh with material_variant: 15
in c002_p to insert our new submesh. Luckily, c002_ps4mesh
, the main body mesh, uses material_variant: 15
. We will append our hair onto that mesh as a new submesh.
Occasionally (for reasons I do not understand) Blender will not properly attach a mesh to a node when importing glTF. Instead, it will create a node, and then another node. Here you can see that c002_ps4mesh
is an empty node, whereas c002_ps4mesh.001
is the true node with our mesh attached.
Rename c002_ps4mesh.001
to c002_ps4mesh
.
Blender will automatically rename the original c002_ps4mesh
to c002_ps4mesh.001
to avoid having two objects with the same name, as you can see. Now c002_ps4mesh
is the proper node with the mesh.
Laxia's adventuring model has a hair ribbon that we no longer need. We could remove that later, but it is easier to remove it now because the hair is not yet attached. Delete the unwanted parts of the mesh in Edit mode.
Now in object mode, select the donor mesh polySurface377
(click) then select the recipient mesh c002_ps4mesh
(shift-click, or ctrl-click if you use the outliner window in the upper right). The hair should be in red, and the body in orange. Press Ctrl-J.
There should only be one mesh now, and it should have the name of the recipient mesh (c002_ps4mesh
- very important this is not reversed!!!). You can see that c002_ps4mesh
is present, but polySurface377
is gone. Be absolutely sure you merged in the correct direction! A->B is NOT the same as B->A!
*Notice that not only is c002_ps4mesh
present, but it now has 7 submeshes instead of 6 as it originally had!
Export your model back to glTF. Do not overwrite your originals, give it a new name! (Here I am using the default, untitled.glb
.) Turn on Tangent export in the options (Mesh -> Tangents), especially if you are modding Ys 9!
Run python ys8_gltf_to_meshes.py untitled.glb
(or .gltf if you exported in .gltf instead of .glb)
In the new untitled
folder, grab our meshes. We are only going to take c002_ps4mesh
files, because we did not modify anything else! Be sure to grab the .bonemap files and all the submeshes.
Backup the original files in c002_p/meshes/
, and replace the c002_ps4mesh
with the new ones.
When you open the .material files from the .glb, you will notice that they are all empty, with nothing more than a name.
You will need to replace them with the corresponding ones from your backup of c002_p/meshes/
.
If you are following this tutorial exactly, you can probably just copy the .material files without renaming them, as Blender will have preserved the submesh order (c002_ps4mesh_00.material
through c002_ps4mesh_05.material
).
You will notice there is no c002_ps4mesh_06.material
in your backups though - that is our new hair mesh! Opening the skeleton c002_ps4mesh_06.material
, we see its name is n_c002_hair
. Looking through c402c/meshes/
, we will find that material in polySurface377_05.material
. Copy that file, rename it to c002_ps4mesh_06.material
, and place it in c002_p/meshes/
.
Opening that file, we can see we need 4 textures, n402c0.dds
, ch_t_02.dds
, ch_g_00.dds
, and n402c0s.dds
.
Looking in c002_p/textures/
, we find that we already have ch_t_02.dds
and ch_g_00.dds
. We need n402c0.dds
and n402c0s.dds
, which we can copy from c402c/meshes/
to c002_p/textures/
.
Finally, do not forget to delete the original hair c002_ps4meshc002n_hair_00.*
, or you will have two hair meshes!
Run python ys8_it3_export_assets.py c002_p.it3
to repack the model.
Backup your original file, place the repacked c002_p.it3 in /chr/pc/
, and boot up the game. If everything went well, you have your working mod!