Skip to content

Getting a ped model into GTA5

Lucas Vinícius edited this page Feb 27, 2024 · 5 revisions

This is a sample workflow that can be used to add a ped to GTA5 using this plugin, OpenIV and CodeWalker.

  • Using OpenIV, export a base ped's .ydd into openFormats; you should get .odd, .odr, .skel and .mesh files
  • Make a copy of the whole exported directory and .odd file
  • Using this plugin, import the .odd into Blender; you get rigged meshes of all levels of detail used by the base ped
    • Is the rig messed up? Like, leg bones moving the head and other bones not moving anything at all? Try exporting the model's .yft file. You should get a .skel file. Replace the .skel obtained from the .ydd with this one, and try importing the .odd again
  • Add the model you want to import into GTA5 to the scene and rig it to the skeleton used by the base ped
    • Transferring weights from the base ped to your model works fine; you'll just have to make small fixes afterwards
    • Some bones have a Rot bone "inside" them, like the thigh, that may have to be rotated as well for proper deforming
  • Following the nomenclature used by GTA5 meshes, export your ped's mesh(es) with this plugin's export .mesh option
    • In the export menu, pick the appropriate VertexDeclaration for your mesh (read their tooltips for more info!)
  • The .mesh must be tweaked according to your .odr (which you can edit manually):
    • This plugin separates the .mesh Geometries by material, assigning a ShaderIndex counting from "Starting Shader Index" (default 0) onwards; however, the ShaderIndex should be checked against the .odr's Shaders list and the Geometry's VertexDeclaration, and modified accordingly
      • Example: .odr declares two shaders, first ped.sps and then ped_default.sps, and we have two meshes: a _high.mesh with a single Geometry, using VertexDeclaration S12D0183F, and a _low.mesh also with a single Geometry, but using VertexDeclaration SBED48839. Both .mesh Geometries have ShaderIndex 0 (that will be the result from this plugin's export actually, if "Starting Shader Index" wasn't modified).
      • The _low.mesh will give an error if you try to import the .odd into OpenIV now, because of its ShaderIndex being 0: that means the _low.mesh is trying to use the ped.sps shader (which is index 0 in the .odr), but it has a VertexDeclaration that doesn't provide the right information for that shader.
      • The solution in this case is to set the _low.mesh Geometry's ShaderIndex to 1, making it point to the ped_default.sps shader, which works with the SBED48839 VertexDeclaration
  • With the .ydd successfully created inside the .rpf, this plugin's part is done! For the other required files:
    • OpenIV can generate .ytd files from Textures
    • The .yft can be copied from the base ped you've exported in the beginning, just rename it
    • The .ymt is the trickiest part; there is some info around if you search, and CodeWalker seems to read it better than OpenIV, and also imports and exports it from .rpf files
Clone this wiki locally