Deliverator
Graphical Hackificator
This is a tutorial on how to:
A) Extract 3D models, including their meshes AND skeletons, from the GR2 format used in Civ 5 into Blender.
B) Get 3D models from Blender back into the GR2 format so that they can be used in Civ 5.
Background
These methods have great potential for Civ 5 unit graphics and potentially other graphics such as leaders, buildings and improvements. The vast majority of community made unit art for Civ 4 was done by rigging custom meshes to vanilla animations. Until recently this has been a really difficult pattern to follow in Civ 5 because it hasn't been possible to extract the skeletons and the meshes of vanilla units. Some people such as danrell have had some success copying skeletons by hand but this is very slow and un-fun work. Now it is simple and quick to create precise Blender templates direct from vanilla GR2 files via the NB2 format, or the more recent CN6 format for improved accuracy.
Required Software Setup
For these processes you will need to unpack the Civ 5 art resources (I recommend using Dragon Unpacker) and have the following software installed:
Nexus Buddy 2
Blender 2.49b OR Blender 2.79
Deliverator Blender Scripts
(Optional) Civ 5 SDK Old Version with working Nexus 3D Viewer *
* This folder can be unzipped anywhere and sid meier's civilization v sdk/Nexus/x86/Nexus.exe will still work.
These processes have been tested on Windows 7, 8 and 10.
__________________________________________
For my example case I am going to export and re-import archer.gr2, one of the Archer models. My complete working directory at the end of the process is uploaded here so you can play along at home.
Extracting Civ 5 GR2 into Blender
A1. Copy all files relating to the unit to a working folder. The simplest way is to do a file search within your unpaked resource directory (in my case C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v\resource) for the name of the unit and just copy everything. In my case I searched resource for "archer" and copied everything to a folder called UnitWork_archer - it picks up Horse Archer and Camel Archer files too but that's not important. It helps to have everything in one place before you start. For the next step to work properly your working directory should include no spaces in the path.
A2. Nexus Buddy 2: Open the .gr2 file, switch to the Advanced Tab and click Export to NB2. If you have a file that contains multiple Models such as a Wonder graphic you can switch which one you want to export or just export all.
Note: You may have to load the relevant string database (a .gsd file) first using Load String Database under Advanced Actions before loading .gr2 file.
A3.
Blender 2.49b: Import the NB2 file using my the import script: Scripts -> Import -> Nexus Buddy 2 (.nb2).
OR
Blender 2.7+: Import the NB2 file using my the import addon script: Import -> Nexus Buddy 2 (.nb2).
Alternatively, use the .cn6 format using the "Export to CN6" Button and the relevant import script. The .cn6 format preserves the vertex normals, binormals and tangents used for shading unlike the .nb2 format.
From Blender to Civ 5 GR2
For getting graphics from Blender back into Civ 5 gr2 there are two formats available, BR2 and FBX.
The BR2 is reliable for mesh data and supports multi mesh, multi material models so is the preferred option.
The FBX import is reliable for skeleton and animation data but often corrupts mesh data particularly for models with multiple meshes involved.
So the best techniques for getting graphics from Blender in .gr2 format are:
If you are rigging custom or converted meshes to a Civ 5 skeleton and animations use the following process:
B1. Export the unit to BR2 format.
B2. Make a copy of the original .gr2 file you are using the skeleton from - giving it a new name e.g. warrior_target.gr2.
B3. Open the copied file in Nexus Buddy 2 and select Overwrite Meshes from BR2 in the Advanced tab. Select the .br2 files you exported from Blender. This will keep the skeleton in the .gr2 completely unchanged but will completely replace the meshes with the data from the .br2 file. It doesn't matter if the .br2 file has more meshes than the original .gr2 had - it will still add them into the file. Following this, you will have a .gr2 with the original units skeleton but with your meshes from Blender.
B4. Use Nexus Buddy 2 to fix up your materials and textures - you'll probably need to remove the existing materials first before creating new ones.
This process allows custom multi-mesh units to made in a reliable way with none of corruption issues of using FBX. Exactly the same method also works for 3D Leaders. For Wonders, Improvements, etc you can select the model whose meshes you want to overwrite - more info here.
Alternatively to steps B2-4, now that the BR2 import process has improved in reliability you can just open the BR2 (using the Open BR2 button) to directly convert to GR2 and not use FBX at all.
If you have custom or converted skeleton and animations then do the following:
C1. Export from Blender to both FBX and BR2 using the scripts in Deliverator Blender Scripts.
C2. Open FBX in Nexus Buddy 2.
C3. Use Overwrite Meshes from BR2 to make sure your meshes are uncorrupted.
C4. Use Nexus Buddy 2 to fix up your materials and textures.
Alternatively to steps C1-4, now that the BR2 import process has improved in reliability you can just export to BR2, open the BR2 to directly convert to GR2 and not use FBX at all.
A) Extract 3D models, including their meshes AND skeletons, from the GR2 format used in Civ 5 into Blender.
B) Get 3D models from Blender back into the GR2 format so that they can be used in Civ 5.
Background
These methods have great potential for Civ 5 unit graphics and potentially other graphics such as leaders, buildings and improvements. The vast majority of community made unit art for Civ 4 was done by rigging custom meshes to vanilla animations. Until recently this has been a really difficult pattern to follow in Civ 5 because it hasn't been possible to extract the skeletons and the meshes of vanilla units. Some people such as danrell have had some success copying skeletons by hand but this is very slow and un-fun work. Now it is simple and quick to create precise Blender templates direct from vanilla GR2 files via the NB2 format, or the more recent CN6 format for improved accuracy.
Required Software Setup
For these processes you will need to unpack the Civ 5 art resources (I recommend using Dragon Unpacker) and have the following software installed:
Nexus Buddy 2
Blender 2.49b OR Blender 2.79
Deliverator Blender Scripts
(Optional) Civ 5 SDK Old Version with working Nexus 3D Viewer *
* This folder can be unzipped anywhere and sid meier's civilization v sdk/Nexus/x86/Nexus.exe will still work.
These processes have been tested on Windows 7, 8 and 10.
__________________________________________
For my example case I am going to export and re-import archer.gr2, one of the Archer models. My complete working directory at the end of the process is uploaded here so you can play along at home.
Extracting Civ 5 GR2 into Blender
A1. Copy all files relating to the unit to a working folder. The simplest way is to do a file search within your unpaked resource directory (in my case C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v\resource) for the name of the unit and just copy everything. In my case I searched resource for "archer" and copied everything to a folder called UnitWork_archer - it picks up Horse Archer and Camel Archer files too but that's not important. It helps to have everything in one place before you start. For the next step to work properly your working directory should include no spaces in the path.
A2. Nexus Buddy 2: Open the .gr2 file, switch to the Advanced Tab and click Export to NB2. If you have a file that contains multiple Models such as a Wonder graphic you can switch which one you want to export or just export all.
Note: You may have to load the relevant string database (a .gsd file) first using Load String Database under Advanced Actions before loading .gr2 file.
A3.
Blender 2.49b: Import the NB2 file using my the import script: Scripts -> Import -> Nexus Buddy 2 (.nb2).
OR
Blender 2.7+: Import the NB2 file using my the import addon script: Import -> Nexus Buddy 2 (.nb2).
Alternatively, use the .cn6 format using the "Export to CN6" Button and the relevant import script. The .cn6 format preserves the vertex normals, binormals and tangents used for shading unlike the .nb2 format.
From Blender to Civ 5 GR2
For getting graphics from Blender back into Civ 5 gr2 there are two formats available, BR2 and FBX.
The BR2 is reliable for mesh data and supports multi mesh, multi material models so is the preferred option.
The FBX import is reliable for skeleton and animation data but often corrupts mesh data particularly for models with multiple meshes involved.
So the best techniques for getting graphics from Blender in .gr2 format are:
If you are rigging custom or converted meshes to a Civ 5 skeleton and animations use the following process:
B1. Export the unit to BR2 format.
B2. Make a copy of the original .gr2 file you are using the skeleton from - giving it a new name e.g. warrior_target.gr2.
B3. Open the copied file in Nexus Buddy 2 and select Overwrite Meshes from BR2 in the Advanced tab. Select the .br2 files you exported from Blender. This will keep the skeleton in the .gr2 completely unchanged but will completely replace the meshes with the data from the .br2 file. It doesn't matter if the .br2 file has more meshes than the original .gr2 had - it will still add them into the file. Following this, you will have a .gr2 with the original units skeleton but with your meshes from Blender.
B4. Use Nexus Buddy 2 to fix up your materials and textures - you'll probably need to remove the existing materials first before creating new ones.
This process allows custom multi-mesh units to made in a reliable way with none of corruption issues of using FBX. Exactly the same method also works for 3D Leaders. For Wonders, Improvements, etc you can select the model whose meshes you want to overwrite - more info here.
Alternatively to steps B2-4, now that the BR2 import process has improved in reliability you can just open the BR2 (using the Open BR2 button) to directly convert to GR2 and not use FBX at all.
If you have custom or converted skeleton and animations then do the following:
C1. Export from Blender to both FBX and BR2 using the scripts in Deliverator Blender Scripts.
C2. Open FBX in Nexus Buddy 2.
C3. Use Overwrite Meshes from BR2 to make sure your meshes are uncorrupted.
C4. Use Nexus Buddy 2 to fix up your materials and textures.
Alternatively to steps C1-4, now that the BR2 import process has improved in reliability you can just export to BR2, open the BR2 to directly convert to GR2 and not use FBX at all.
Last edited: