How to: Import civ5 meshes into blender to create civ5 units This tutorial assumes you know some basics about blender function but I will try to be somewhat specific and detailed for newbies as well. NOTE: everything in this tutorial was learned from other tutorials and from other threads in both civ4 and civ5, providing excellent information. Special thanks goes to Deliverator, lemmy101, CaptBlinky, Ekmek and danrell. I will cite various excellent tutorials at the end..... THE TOOLS: -3DVIA Printscreen 2.3 (http://www.3dvia.com/products/3dvia-printscreen/) Allows capture of a mesh in granny viewer and creates 3dxml file -3DXML Importer “import_3DXML.py” (file included in zip) Allows import of 3dxml file to blender -blender scripts (”copyPaste.py” and “export-fbx.py” files included in zip Allows copy/paste objects between blender files and export to fbx -Granny Viewer (http://www.radgametools.com/granny/download.html) Together with IndieNexusBuddy, allows creation of a usable .gr2 file - Indiestone NexusBuddy, older version (http://forums.civfanatics.com/attachment.php?attachmentid=271659&d=1289089329) Allows creation of usable .gr2 file and creation of gr2 file from exported fbx file from blender -Blender 2.49 and all the goodies Allows mesh/skeleton/skin integration and export to fbx file DOWNLOADS (from Ekmek’s guide) To get blender to work with Civ files you need to download these programs and install in THIS SEQUENCE. Downloads for 32-bit windows and tested on Vista. 1. PYTHON 2.6.2 (32 BIT WINDOWS) http://python.org/ftp/python/2.6.2/python-2.6.2.msi 2. BLENDER 2.49a ( FOR 32-BIT WIN) http://download.blender.org/release/...ix-windows.exe 3. PyFFI-py2.6-2.0.1-windows http://sourceforge.net/projects/pyff...s.exe/download 4. Blender 2.4.10 NIFSCRIPTS http://sourceforge.net/projects/nift...s.exe/download 5. NIFSKOPE http://sourceforge.net/projects/nift...s.exe/download -Old version of civilization 5 SDK (thanks to danrell) http://forums.civfanatics.com/downloads.php?do=file&id=17547&act=down http://forums.civfanatics.com/downloads.php?do=file&id=17548&act=down Allows working Asset Viewer to view 3d and animations of unit in progress THE METHOD: Ok, let’s get all our tools working first.....download and install the 3dvia Printscreen. I like to have my icon on my desktop and I usually do not activate it until I am going to capture a model.... If it installed ok, when you open printscreen, this is what you see....pick our output folder and “hotkey” for when you are ready to import a mesh.....if you leave printscreen active in your toolbar (background), it will do weird stuff whenever you hit the hotkey (in this case “A”, so right chick the tool bar and exit until you are ready to capture your mesh.... Now, you are going to need to make a couple of folders to put your stuff in.....if you like put all your stuff in one folder, but since I am a little OCD, I usually use two folders....I have one folder for “civskins”, there, I have other folders, riflemen, musketmen, swordsmen, etc, and in each german, American, Aztec, etc., etc.....then, I have a folder on my desktop, such as “swordEX” or “rifleEX”. In my civskin folders, I will do all of my blend and artwork, then copy/paste the dds (art) and exported fbx to the ***EX folder on my desktop which contains a pre-ready fxsxml and I perform the fbx to gr2 conversion here, using the old indie nexusbuddy...... Ok so I got a little ahead of myself. Right now, let’s work on getting another civ5 swordsman mesh onto a skeleton. Go to were your dds, usually “C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\resource\DX9” and copy your dds files. I will be using the swordsman2_diff.dds and swordsman2_sref.dds. Put those files in your corresponding civskin folder and in your SwordEX folder. Now go get your gr2 file, usually in “C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\resource\Common”, in this case, the swordsman_v2.gr2 and stick that one in your civskin folder. You should have something that looks like this: Now, install your Granny Viewer (exe) and double click on the gr2 file....SNAP!!! CRASH!!!!!! That’s...OK....download the zip and install your old Indiestone Nexus Buddy. The file, named “IndieStoneNexusBuddy_old.exe” should be placed in C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v sdk\Nexus\x86 (which is the same location as the “Nexus.exe” file for it to work. I like to create a shortcut to the desktop for easy access ......now, open up your old nexus buddy and follow the steps below....1) open your gr2 file, 2) click “add” and add “UnitShader_Skinned” 3) a pop up will display and you will add the ***.sref to the SREF MAP and the ***.diff file to the Base TextureMap corresponding slots to the right of the Skinned Unit Materials. 4) Next, you will click on “unassigned” underneath the Material heading and select “MaterialUnitSkinned1”......last step 5) Save As ***, I will usually put something like “civ5_” in front, as to differentiate it from the “game” gr2....so, in this case, I am saving as “civ5_swordsman.gr2....... Now, double click on that gr2 file and guess what???? BAZINGA!!! We are about 5% DONE!!!! Now we have a gr2 file that can be read by our 3dvia Printscreen program!! Ok, we had installed our printscreen program but we need to place the “import_3DXML.py” file which was included in the zip in the following folder (of course, as long as you placed everything in default when installing)....."C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\import\import_3DXML.py" Now, we will activate 3dvia printscreen, with our granny viewer open and press the magical hotkey “A” in this case (I think the NUM lock and F lock have to be on but not sure) and voila!! This is our 3dXML file and we should know where it is cuz we set the output folder above...... NOW we open BLENDER....... Maneuver to the 3dxml file location and import the file..... Now, using the keypad 1 (front view),3 (side view) and 7 (top view), center your mesh using G (go) and R (rotate) This is my preferred view in blender 1) is the Outliner; helps manage/pick the bones, the switch from object to edit mode, etc... 2) 3d window (duh!) 3) UV image editor: pick textures, change UV map etc. 4)Buttons: a lot of important stuff, more details later As you can see in the above image, the unit is not “centered”.....there may be a simple method to “snap the unit in place but I don’t know it, so I G (go) and R (rotate) both the “object” (the little dot) in object mode and the mesh in edit mode) until my init is centered. NOTE that when you click the little triangle “vertex thingy” in the outliner, you switch from edit to object mode and can move the entire “scene” vs the mesh only, thus achieving the centering The object can be centered by bring up your transform properties (3d window menu, mesh tab) and set the upper left coordinate numbers to “0” (zero) So, here are some picks of the action in general....... Another major step done!!! Now, we need to get this mesh some bones.... *********REMINDER***** SAVE OFTEN AND MAKE BACK UPS IN CASE THINGS GO TERRIBLY WRONG (I’ve had objects disappear for no apparent reason if I inadvertently hit some evil key) Keep that blender file open, choose object mode and make sure your object is “selected” (has the little pink outline around it) Open up the pre-made swordsman template blend (yes, download the one I already did) in another blender session, should look something like this.... Notice first the hierarchy of the outliner window....the scene root marked #1 contains the bone structure for the body, shield and sword, connected as parents and children.....the scene root also contains the swordsman “object”, marked as #2, and the swordsman material, #3 Now, let’s do a quick review of the buttons window..... The buttons you will probably be using the most is the “Link and Materials” #1. Here you will assign your body part vertices (vertex groups) to the bones. In #2, you will select the image and in #3, you will link the “object” to the “material”......more to come...... Go back to your new swordsman mesh. If you did not yet, place the “copyPaste.py” and “export_fbx.py” files which were included in the zip in the following folder C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\copyPaste.py and C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\export_fbx.py. OK....now, go to the new swordsman mesh and make sure it is selected (pink outline). In object mode, click 1-Object, 2-Scripts, 3-Copy and Paste Objects and finally, 4-Copy object(s) to buffer...... Now, go to your (my) swordsman template blend, in object mode, make sure everything is Unselected (A button to select and unselect) follow the same instructions, but select Paste object(s) to buffer...... the new mesh has been transferred over to the template..... Now the real work begins.....as you can see, the new mesh is not part of the scene root and has no vertex groups or associated bones....(****REMINDER****back up and save your work before something terrible happens!!!!!) Line up the new mesh with the old one as best possible, good tips include using your 1,3,7 NUM views and judging your placement in areas that are very “stable”, in this case, the feet and sword. I renamed the texture “swordsman2” in the buttons window, as indicated in the following pic. Now, we will make the mesh part of the scene root and give it a material. First, in object mode, select your skeleton/bones....now they will be in pink. If I my digress slightly, I think this would be a good place to relook at the buttons window, you can see in this view that you can change how the bones appear (stick/octahedron/etc.) as well as whether the axes (in edit mode) and bone names are shown or hidden. Now, right click on the Swordsman2 mesh in the outliner window and press Select (cant capture that shot sorry) but now both your bones and the swordsman2 mesh should be outlined in pink*****it is very important that the skeleton is selected first, then the mesh, so the mesh can be properly joined to the bones. Now, in object mode, click 1-Object, 2-Parent, 3-Make Parent, 4-Make Parent to ----> Armature, 5-Create Vertex Groups?---> Name Groups.... Viola!!!! Now you have your swrodsman2 mesh connected to your scene root and ready for material, skin and to get boned!!! First, let’s assign the material. Go to your buttons window and next panels click on the 3d ball looking thingy. Click on add new and just choose the VetMusket_Skinned (it’s the one there?!?) Now let’s give it an armature...I truly don’t even know if this is necessary, but since the other mesh has one, I just go ahead and add it.....in the buttons window, next to Panels, click the square looking thingy...add modifier, then click armature.... Let’s set the skin/texture. The texture can probably be set later when creating the gr2, but this is a good exercise to make sure the skin fits the mesh correctly. In object mode, in the buttons window, next to panels, 1-click the sphere thingy, 2-click the square animal print looking thingy, 3-click on the file selector on the right, and 4-you will get a menu. 5-Navigate to where your new dds/texture is and 6-SELECT IMAGE. The image selected will now be in the bottom left, in the buttons window (see in next image). This step is more important to make sure the skin is on right. Switch to EDIT MODE, make sure you have your swordsman2 mesh selected and hit A to select all. The mesh should be lit up in yellow and the texture in the UV image editor window on the right should also be lit up yellow. 1-in the UV/image editor window, click image, 2-click open. You get a menu, 3-navigate to where your file is, 4-select your file and 5-Open Image. Notice the image is literally upside down. Easily fixed....with the cursor in the UV window, click your M (mirror) key. Select Y Axis and the texture flips, now fitting perfectly.... Now comes the most tedious part....assigning vertices to bones....if you notice in the outliner window, you will see the mesh name and then arrows that open and close submenus.....if you click on the triangle thingy, you will enter edit mode of the mesh selected......this part is easier to work in “wireframe” draw type, so while in edit mode, click the button next to it, and you get a menu for draw type. Select wireframe. http://img809.imageshack.us/img809/1236/57479768.jpg " align="" border="0" /> Switch between your swordsman and swordswman2 meshes. Go to your swordsman mesh, since that is the one boned and you will be using as reference. Make sure all vertices are Unselected. Go to your buttons window, link and materials, vertex groups. 1-Click on the menu with the vertex group name and you will get a menu with all the group names. 2-click “Base HumanRCalf” and then 3-click Select. If you then switch to your swordsman2 mesh and do the same thing....nothing lights up.....your goal is to select the body parts/vertex groups in your new mesh and Assign then to the proper bone. Fairly straight forward but time consuming. Essentially, you will be going back and forth from your template mesh to your new mesh and assign vertices. Some tips. In this case, I find it easier to manipulate the 3d window so the vertices I will be selecting are out of the way of other vertices and more or less “square” with selection. You can move/rotate the 3d window by pressing Alt and moving the mouse (this is quite basic but if you need even more basic help on blender, I recommend the wiki book “blender: noob to pro”. Vertices the new mesh can be “grabbed” by “lasso method” (hold Ctrl and lasso with mouse) and by “area method” (press B and a 2D target appears, move mouse to desired area and left click). Another tip is when the R and L areas are exactly symmetrical. After assigning one side, select the corresponding side and DESELECT the original side, then, select the corresponding vertex group from the menu and ASSIGN. If you are really obsessive, you could “capture” and image of the area you need to select from your template mesh and then select/assign the vertices in the new mesh. There will be some groups that you do not have to assign vertices to. ******IT IS VERY IMPORTANT THAT ALL VERTICIES ARE ASSIGNED*******you can be sure by exporting as a NIF.....if any vertex is unassigned, the export will fail and the unassigned vertices will light up.... SPECIAL NOTE: in this particular case, in order for the sword sheath to animate properly, I had to move it slightly in the original template, so when assigning the Base HumanSpine2, just go ahead and move the vertices of your new mesh’s sword sheath to line up with the old mesh. OK!!! Now, time to say goodbye to our old mesh. 1-Click/R-click it in the old swordsman mesh and you get a menu, 2-click Delete and say bye-bye to our old friend. We are almost done....GOOD TIME TO SAVE your work!!