=Editing & Creating Yakuza Mods=

-NOTE-
This guide was written from personal experience using assets from the games. It may not be accurate to community-based Yakuza modding guides. Feel free to correct and improve it.

Required:
- QuickBMS
-- PARC.bms Plugin
- PARC Archive Importer
- Blender
-- YK GMD Blender Plugin
-- XNALaraMesh (Optional, for importing XPS files)

--------------------------------------

-01: Using QuickBMS-
1. Before you begin, remember to create an output folder.
2. Open QuickBMS, select the PARC.bms plugin, then a .PAR file to extract into your output folder. If you check inside your output folder now, you will find the .DDS textures and .GMD mesh file.

-IMPORTANT NOTE ON .PAR FILES-
You cannot add or remove files such as textures that make up a .PAR file. A modded .PAR file must have the same number of files and names as its original version. Otherwise, the mod will fail to finalise.
Suggestion: Find a .PAR with a high number of files. (<- Good suggestion??)

--------------------------------------

-02: Using Blender-
1. Open Blender and install YK GMD Blender Plugin.zip. No need to unpack it. To install, click "Edit" on the top left, "Preferences", "Install" and search for the plugin. Remember to enable it.
2. Click "File", "Import", "Yakuza GMD [Characters/Skinned], and select a .GMD file. Remember to disable "Strict File Import" before importing.
3. If you see two models overlapping, that is normal. ([I] and [SS]) Whatever you do, DO NOT merge these two models together as one.
4. Try your best to not delete anything labelled [SS] if the model has them. These are what gives a model their shadow. If you are confident enough and your mod lacks the proper shadows, you can try reshaping them to match your modded costume.
4. This next step is VERY IMPORTANT, so try to make it a habit. If you are removing/editing mesh pieces, be careful what you delete/edit. Always perform trial and error. And always keep several save files for different stages if you ever need to backtrack.

--------------------------------------

-03: Using Blender / Model Swapping-
1. If you want to perform model swapping, but want to mix and match, you will have to plan accordingly and prepare for plenty of trial and error. This example will use two models of similar qualities from the same game.
2. In this example, Model 1 is Haruka and Model 2 is Azusa. We want to port Model 2(A)'s outfit over to Model 1(H), but Model 1(H) doesn't have enough individual files to facilitate the swap. Therefore, we shall use Model 2(A) as the main as it has plenty of files.
3. Using Model 2(A) as our main, we only need the outfit and hat, so delete the head and parts. Do note that, if some meshes are connected as a whole, you will have to highlight the part, enter "Edit Mode" and delete the piece of mesh you do not need. This is best done in "Wireframe View", located in the upper right.
4. Once done, save the project.
5. Next up, make a new project for Model 1(H). We only need the head, arms and skeleton. The legs are connected to the body, so enter "Edit Mode" and delete them.
6. Once you are done, save and export the project to overwrite its .GMD file. You will need to import this for Model 2(A) later.

--------------------------------------

-04: Using Blender / Rigging-
1. Now for the part that will make you a proper modder! =D Load up Model 2(A) and import Model 1(H) into the project. As these two are of similar qualities, you don't have to do any manual scaling.
2. Press "A" to highlight everything (click the "eye" icon in the dictionary on the top right to hide an object, which will prevent it from being highlighted), hold "Shift" and click the bones. (Make sure the bones are unhighlighted first before clicking on them again) Now, there are two methods:
- Hotkeys: Use the hotkey "CTRL + P" and click "Armature Deform".
- Menu: Right click to open a menu, choose "Parent" and find "Armature Deform".
Congrats! Your model is now attached to the bones.

-IMPORTANT NOTE ON RIGGING-
Be careful when rigging faces. If the main model already has a head and skeleton, and it's from the same game you are modding, DO NOT re-rig the head. Only rig the ported body and other parts to the bones. (<-Theory unconfirmed???)

3. After attaching the model to the bones, you should check if the process worked without issue. Click on the "running stickman" on the right, and under the "Skeleton" tab, set it to "Pose Position".
4. Once that is done, highlight the bones and find "Object Mode" on the top left. Switch it to "Pose Mode". On the left, you will see a row of options. The ideal option would be to choose "Rotate". If everything works according to your preference, well done!

----------------------------
----------------------------
-04.5: Using Blender / Rigging (Cutscene Model)-
1. If you want to replace a cutscene model, the only thing to keep in mind is that the facial bones are different. Everything else is the same.
----------------------------
----------------------------

--------------------------------------

-05: Using Blender / Textures-
1. This final step in modding Yakuza games is important. Any textures stored in the "Common.PAR" file can be called out for meshes assigned to them. However, textures unique to a mesh will be stored alongside its .PAR file. In this example, we will need to bring over textures from Model 1(H) over to Model 2(A).
2. The textures consist of clothes, face skin, hair, and eye lashes. We need to bring over the parts only pertaining to the head.
3. Now that you have what you need, you need to rename Model 1(H)'s textures to match Model 2(A)'s. You will notice very quickly, however, that Model 2(A) doesn't have eye lashes. That's because Model 2(A)'s eye lashes are stored in the "Common.PAR". This step requires you to pick out a texture and replace it. Preferably a tiny square texture for a small mesh that can go unnoticed.
4. At this point, you have replaced a texture. Now you need a replacement texture for the now mistextured mesh. Highlight the mesh and go to the lower right with the "globe" icon called "Material Properties". Find "Texture_Diffuse", drop it down and click the "folder" icon to search for its replacement, either in Model 2(A)'s folder or in the "Common.PAR". You can also use the same texture another mesh has used. Sometimes, it doesn't always work, so you would need to merge the two meshes. (Highlight both, right click, "Join".)

----------------------------
----------------------------
-05.5: Using Blender / Textures (Using the same texture)-
1. Because two texture files cannot share the same name, one of them will receive ".001", which will cause an error if you export. Go back to "Texture_Diffuse" and open the drop-down icon on the left. You will see your selected texture as well as the rest. Find the texture file with the same name as your chosen texture, which does not have ".001", and select it.
2. Try to make use of this texture selection as this will help avoid the need to replace other textures using the same redundant texture file.
----------------------------
----------------------------

--------------------------------------

-06: Using Blender / Exporting-
1. Before exporting, click on the file in the dictionary on the top right to highlight the bones, or simply click on the bones themselves. ONLY the bones must be highlighted, or you won't be able to export.
2. "File", "Export", "Yakuza GMD", find Model 2(A)'s .GMD, make sure to disable "Strict File Import" and enable "Copy Bones from Original File".
3. Export over it and you are done.

----------------------------
----------------------------
-06.5: Using Blender / Exporting (Cutscene Model)-
1. If you receive an error regarding a missing mesh, simply delete the data in the dictionary and try again. It's the one with the "box" icon.
----------------------------
----------------------------

--------------------------------------

-07: Using PARC Archive Importer-
1. When complete, use "PARC Archive Importer.exe", click "Open Archive", find Model 2(A)'s original "Mesh.PAR" file, and click "Widen".
2. Next, click "Open Files", highlight all the unpacked content (textures, modded .GMD file), and check that everything says "Yes". If you see a "No", then it won't transfer.
3. Finally, click "Inject" and save over the mod's original "Mesh.PAR" file.
4. Congrats, mod successfully made. =D

--------------------------------------

-08: Important Things to Keep in Mind-
-Unconnected Vertices-
1. If your model in-game has a blocky-looking texture, despite having done only a simple mod, then some vertices in those blocky areas are unconnected. Head back into Blender and load up your mod, enter "Edit Mode", press the "A" key to highlight everything, and right click for "Smooth Vertices". Once you have located the unconnected vertices, press "Ctrl + Z" to undo the smoothing. You now have to connect the vertices by highlighting the overlapping vertices, right click for "Merge Vertices" and select "At Center". This is best done in "Wireframe View". If performed via "Solid View", which is the default, you will have trouble highlighting the overlapping vertices.
2. Once done, save your work, export and test it in-game. =D

-Visible & Invisible Mesh-
3. If you have an object that is visible at the front, but invisible at the back, follow these steps. Copy and paste the mesh in the dictionary, enter "Edit Mode", highlight the entire new mesh, press "Ctrl + Shift + N", and check if the box for "Inside" is ticked. Now join the inverted mesh to the original mesh. Nice work, the mesh no longer has an invisible side. This may cause the two meshes to overlap, so delete the areas you do not need. Also remember to delete the things you do not need that were generated during the process, such as new bones or folders. =D

-Editing the Head Mesh-
4. For the sake on your sanity, DO NOT mess with a model's head. Do not add extra vertices, no clean ups, no smoothings, NOTHING WHATSOEVER. .____. (Unless you know how to Weight Paint)

-Finished Mods-
5. DO NOT unpack an existing mod for editing. This method will introduce new bugs and issues that cannot be easily fixed. It is not worth the hassle. Always use your original ".blend" project file or start anew in Blender. Never start with a finished mod file.

-Shadow & Misaligned Texture Bug-
6: If your mod is created by merging meshes together, such as Mayumi's legs (imported) with Haruka's body (main project), you may encounter some issues in-game. In one such case concerning a nude body mod, it is the leg parts (imported) having a concentrated amount of shadows while the body remains untouched. Furthermore, the textures around the bug may be misaligned. You likely will not encounter this type of bug during normal gameplay, but under special circumstances such as a reflective mirror, the bug will be very obvious. There is no fix so far, so be mindful about what you add and remove in your projects.