Converting GTA V SKIN RIG to San Andreas - jessicanataliagta/mutare GitHub Wiki
NOTE 1: This documentation is made to convert pedestrians from GTA V to GTA SA pedestrian. GTA V player and cutscene models might have different bones, so they will need specific scripts, I will make the scripts later. I belive that the entire process will remain the same.
NOTE 2: Allways save copies of your progress on blender and 3ds max, so you don't need to restart the process if you make a mistake.
NOTE 3: Scripts avalible on the folder "Game to Game" "GTA V to SA" "Convert gta v pedestrian to gta sa pedestrian"
Install openiv
Download blender and install the scripts: blender_io_GTA5Ped (Sollumz does not work for this) and DragonFF
Export your ped model using open IV
Note: it seems that not all skins are located in "x64e.rpf", some of them seems to be located in update/dlc .rpf files, so you will need to look by your own. Maybe RPF Explorer from CodeWalker might help you find it, since it has a global search by name. You can see the peds names on sites like this one.
Open the ped model on openiv (codewalker seems to give the wrong model name sometimes). In GTA V and IV the peds models have more than one body parts, so one pedestrian file is actually 3 or 5 peds merged into one. The body parts are not random, instead, it uses a logic by name like 001, 002, 003 so each part with 001 should fit the parts with the name 001. What you need to do is enable each body part until you get an entire ped, then copy the bodypart name and paste on a notepad.
Put a "_high" at end of each name.
Open "gtav_ped_build.py" on notepad (I recomend notpad++) and put the names in there.
Still with the skin on OpenIV, see the corner, it shows the name of the texture file. Click on it.
Open the texture file and export all, in this case I use .dds format.
Import the skin file on blender.
Go for the "Scripting" tab, drag and drop the "gtav_ped_build.py" there and hit the "play" button" on top.
In "Layout" tab, select the body parts, then textures to the body parts. Unfortunately the import script does not import textured models so we need to add textures manually. A weird thing is that in this importer, the materials don't even have materials ID, so if a body part has more than one texture I don't know how to assign textures to it, maybe you could try a script to separate the mesh by materials.
Press "Z" to enable the materials.
After your model is fully textured, export the skin as a .fbx but at export uncheck the "add leaf bones" option.
Now hold "ctrl" and select the skeleton on the hierachy, click right mouse click and hit delete.
On the layout tab, click "A" on your keyboard, this will select all model bodyparts. Click "ctrl + J" this will merge the model into a single object.
Export the model as a .dff file.
Now we are done with blender. Let's move to 3DS Max.
On 3ds max is necessary that you enable the "Scene Explorer" window on the tools tab.
And to see textured models on 3D max you need to add a texture path on cutstomize > Configure Projects Paths and click on "Add" to select the folder with textures. What I do in my case is make a folder and allways add my textures there.
Now open the .fbx on 3DS Max, the texture will be broken like this:
The problem is, no matter wich export format or setting we use from blender to 3ds max, it allways breaks the textures. I don't know how to fix it properly. The only way I managed to fix it was by exporting as a .dff, but the .dff export tool do not support rigged characters, that's why I deleted the skeleton before.
So, the .dff on 3ds max using RWIO.
With the dff model selected, add the "skin wrap" modifier.
On the modifier click on "add", this will change the mouse cursor to some kind of cross, click on top of the fbx model parts to select it.
At bottom of the modifier click on "convert to skin".
After that, you can delete skin wrap modifier and the fbx models parts with right mouse button > delete.
Now we have the rigged model with textures on 3ds max.
Now we need to pose the character. For that, just import a similar pedestrian model from gta sa. In my exemple I'm converting a female model and a similar pedestrian model is named "vbfycrp", so I will import that dff there. To see a full list of gta sa pedestrians, you can see here.
See, the arms positions are different between the skins.
Hide both models clicking on the "eye" icon on the scene explorer, then select the GTA V arm bone.
Now unhide the models, click right mouse button and click on the rotate box and slide the number to rotate. In my case "20,0" on Y was ok. Make sure to remember the number you used, so you can use again on the other arm (otherwise it will lose the symmetry).
Again, hide the models, select the other arm bone, unhide the models, rotate the bone with the same setting.
I'm not sure, but maybe a 20,0 and -20,0 arm bone rotation will be enough on all cases. If it is, then I can probably make a script to auto rotate. I need to test it better first, for the moment, rotate manually.
Now that our GTA V skin is posed, delete the original gta sa skin selecting the model and root on the scene explorer.
Attention: Make sure to save the scene as a .max file.
Drag and drop the script "merge_gtav_ped_bone_1.ms" to the 3ds max.
Now we will do the same task several times, so pay attention.
Go the utilities tab, click on "more" and select "SkinUtilities", this will open a new window to import and extract. In this case click on "Extract Skin Data To Mesh".
This will create a solid color model that start with "SkinData".
Now select the skin model and the skeleton, then delete them.
Now only the SkinData is left on the scene.
Click on file > import > merge and select the .max file that you saved before.
Clcik on "all" then on "ok".
Click on the skin, then clik right mouse button and select "collapse all" on the skin modifier. Then add the skin modifier again and on "bones" re-add the bones back. TIP: On the select bones window you can select all with "ctrl + a" then while holding "ctrl" you can uncheck the skindata and the container.
On the scene explorer, while holding "CTRL", select the skin model and the SkinData.
On the utilities tab, click on "Import Skin Data From Mesh", click on "Match by Name" and hit "ok".
Now delete the SkinData object from the scene.
Now drag and drop the script "merge_gtav_ped_bone_2.ms" to the 3ds max window.
Now open the script listener window. If there's any text inside, delete it. Drag and drop the script "copy_bones_position.ms" on the 3ds max, this will generate a list on the script listener window.
Copy the list and paste on the "move_bones.ms" script. Keep in mind to not copy the line with the name of the object model and that the last line should never end with the "," symbol.
Now go to utilities tab, click on "Extract Skin Data to Mesh" again. Then hide it from the scene.
Now import your original gta skin and drag and drop your edited "move_bones.ms" script to the scene. This should distort the original gta skin.
Select the original gta model, select "Editable Mesh" and select "Yes".
Click on "Attach", move your mouse to the scene explorer, there, the mouse cursor will turn into some kind of cross. Select your new model from gta v. Then select "ok" on the window.
Select the triangle icon, then click on a part of the original gta model.
This will make a red selection on the area.
On the bottom of the right menu, on "Material:" click on "Select ID", this will turn the original gta model totally red. Hit "delete" key on your keyboard. But keep in mind that some characters have more than one material, so if you can still see parts of the original gta model on the scene, click on it and do the process again to delete it.
Click on right mouse button on top of the skin modifier, then select "delete".
Select the GTA V skeleton and delete.
Now on modifiers list, add the skin modifier again.
On the skin modifier, click on "Bones: Add", select all bones except for the Root bone.
To select you can hold shift on the first bone then left mouse click on the last bone. Or click ctrl + A to select everything and hold ctrl + left mouse click to unselect the Root bone. Click on "Select".
On scene explorer, hold "ctrl" keyboard key, click on the back to utilities tab, click on your skin model and the skindata to keep both of them selected at same time. Go back to utilities tab, then click on "Import Skin Data From Mesh".
This will open a new window. Click on "Match by Name" and select "Ok".
Now you can delete the SkinData from the scene explorer.
On the scene explorer, select the root bone.
Select "File" "Export" "Export". Give a file name, and in "Save as type" select "RenderWare model (*.dff). With the same export settings as bellow.
Now import the textures to the .txd file and that's it, your character is ready.