HOW TO: Import/modify/export LH

C.Roland

FFH Art team member
Joined
Nov 26, 2005
Messages
2,112
Location
Quebec
English is my second language so I’m sorry for all the syntax mistakes.

Here a little tutorial on How to Import a LH into Blender, modify it and export it without crashing the game.

Note: This tutorial is for blender but I think you can follow it with the import/export tools of max and it may work, I think.

1. The tools

You will need all this programs:

-Blender
Niftools import/export scripts for blender
NifSkope
-The Scene Viewer (Nif Viewer)
-A texturing program like PS, PSP or Gimp

2. What you should know before to begin

If you have some basic experience with all those program (except nifskope), it should be enough. If you do not have experience with those program maybe you should read other tutorial on those subject:

-Blender Guide
-Exporting tutorial for Blender (From me)
-Scene Viewer Tutorial 1 (From Rabbit White)
-Scene Viewer Tutorial 2 (From Rabbit White)
-Scene Viewer Tutorial 3 (From Rabbit White)

3. Ok, I’m ready, what should I do?

It’s simple, just follow those step. :

First of all you need to configure your export script. (See this tutorial). Civ 4 units are nif version 4.2.2.0 but leaderhead are nif version 20.0.0.4 so you have to configure your export script.

When your script is configured, import the leader of your choice. For the example we will take Cyrus.

Note: You can skin your model in the step you want, but I think you should skin it in two steps. First, skin it before to import it in Blender, so you will be able to see your modified model with texture in blender(you just need to have the dds and tga in the same folder of your nif when you impor it) while you will be doing the modifications. The second time it’s at the end of the whole process, to finalize your skin with the latest details.



When it’s done, you should see Cyrus with his armature. I presume you know how Blender works (if not take a look at the Blender Guide). Now it’s the funniest part, play with your leader! Change his nose/hair/chin/shouler/beard/mustache/mouth/eyes/… shape. (You should not play with the armature; all the armature and bones modification won’t do anything. We won’t use the exported armature). Don’t forget do remove all the part that you do not want, this technique is great because we can remove part that we do not want like Cyrus’s crown. Here my modified Cyrus:



When all the modification is done, you have to export it. Select all (a-key) and then deselect the lamp and the camera. Export it.



Your are done with Blender, Now it’s NifSkope time ! Open NifSkope and load your freshly exported model, and than the first thing you’ll have to do is to enable the block details.

Note : If the textures files (dds) are in the same folder of your nif when you open it in NifSkope you will be able to see it textured.



Simply click! : File/New Window



In the new window, open the original file (like the original Cyrus without modifications)

Here a little comparison between the original Cyrus (reskinned) and my new one.



In the window of your new leader, click on his body. He should become “green” and there should have a blue NiTrishape.



Right click on this NiTrishape and than : Block/Copy Branch



In the window of the original leader, in the white section, right click and than : Block/Paste Branch




No you are not done :D Let’s continue on the next page.
 
Than you should see Cyrus (or your leader) with his twin, one under the other.

Note : You should also see in the white section a new NiTrishape. This is your modified mesh. (In the screenshot it have the number 310)



Click on the older one(the original leader), make it green and note the blue NiTrishape number, in the screenshot the number is 286.

Note : In the future screenshot the “original” leader will be the black one and the new “modified” leader will be the white one.



Than you have to click (make it Blue) on the upper NiNode (284 in the screeshot) and click on the + of the children in the Block Details (take a look at the screenshot)



You will see in his children the number of the “original” leader’s NiTrishape (286 in my screenshot). You simply have to change it for the “modified” leader NiTrishape (310 in my screenshot) Paf ! The leaders will change their position, they may lost their teeth in the process. (See screenshot).



You can also see that the NiTrishape will change their position too. (In the white section the two object are now 0NiNode and 286NiTrishape, before it was 0NiNode and 310NiTrishape)

So click (make it Blue) on this NiTrishape (the 286 in my screenshot) andthen click : Block/Remove Branch



Save you new nif and Congratulation you are now done with NifSkope.
Now, Nif Viewer Time! Sorry I do not have screenshot for this step but Rabbit White excellent tutorial should help you with this tool if you are not a master of the viewer.

Open your model. You will se that his eyes and teeth are not in right place. You will have to select your mesh (click on the leader’s body with the arrow tool) and then to edit his propriety (rigt click). You will have to make some translations to put his eyes and teeth in the right hole. (You can also play a bit with the rotation matrix to make your leader “longer” or “larger” or “wider”). When you exported your model from Blender some minutes before you loss the entire model’s maps (Gloss map, Normal map) and now your model have only one texture like the noshader version. The goodnews is you do not have to redo your model for those who do not have shader compatible video card, the bad news is it looks cooler when it have a normal and a gloss map. Life isn’t paradise so we will have to do ours model with only one texture map so you will have to go in the texture propriety and change the texture for the noshader texture. You may realize that your model is “Shiny” or “Dark”, it’s time to edit your material propriety. In the material propriety option you can play with the specularity, the diffuse, emissive colors and the other things that will affect your model “shinnies”. When your material is fine you can now add other objects (like crown, hat, glasses …) via the viewer (see Rabbit’s tutorials)



Here my Cyrus=Charlemagne transformation In Game:
Note: This model is not done, I’ll have some other things to add (like a crown) and change (like his eyes) before to release it.



Voilà! It should be done.

Now that you have a working noshader version, you may want to have a shaded version of it : see the part 2 of the tut !
 
C.Roland said:
When all the modification is done, you have to export it. Select all (a-key) and then deselect the lamp and the camera.
Don't forget to also deselect the cube that loads on Blender startup, if you didn't delete it already.
 
Saketh said:
Don't forget to also deselect the cube that loads on Blender startup, if you didn't delete it already.

Ah, well me i do not have cube at the startup in blender we can choose what you want to show at the start up, and i chose to start with nothing.
 
Prestidigitator said:
Any idea when you'll tell us how to preserve the gloss and normal maps Roland? It'd be nice if you'd tell us so we can start creating full blown LeaderHeads. :)
Theoretically, you can preserve the gloss and the normal maps if you use the shader model as the target for copying. There are NiObjects for Alpha and Normal mapping, which do not exist in the non-shader models. I think C.Roland used non-shader models for the tutorial, although I'm not sure, so that would explain why the gloss was not preserved.
 
Saketh said:
Theoretically, you can preserve the gloss and the normal maps if you use the shader model as the target for copying. There are NiObjects for Alpha and Normal mapping, which do not exist in the non-shader models. I think C.Roland used non-shader models for the tutorial, although I'm not sure, so that would explain why the gloss was not preserved.

No I use the shader version. The gloss and the normal map are loss during the blender exportation. In nifskope we copy the entire modified Nitrishape into the original leader nif and we delete the original Nitrishape. The gloss and the normal map are included in the Nitrishape. I think they are a way to copy some of the Niproriety of the original Nitrishape into the modified Nitrishape, if this work we will be able to keep the gloss.

My fisrt attempt didn't work :( :

But i'm still working on it.
 
In the important NiTriShapes, you need to put an NiTexturingProperty with links to the normal map, spec map, and diff map using NiSourceTexture instances.
 
Saketh, are you saying you might know how to solve it?

Roland, keep trying man.

It just occurred to me, can it be possible to solve it if we just change the shader in the NifViewer?
 
Saketh said:
In the important NiTriShapes, you need to put an NiTexturingProperty with links to the normal map, spec map, and diff map using NiSourceTexture instances.

I think we also need some NiIntegerExtradata with them.
 
Prestidigitator said:
Saketh, are you saying you might know how to solve it?

Roland, keep trying man.

It just occurred to me, can it be possible to solve it if we just change the shader in the NifViewer?
No, it's not that simple. You have to first add the nodes which contain the shaders that deal with specularity, etc.

And, for some reason, NifSkope is not letting me copy branches between windows, so it won't work on my computer.
 
Saketh, why so? can't you use NifViewer on your computer?

It'd be SO great if you guys can make it clear how to create Lhs just like the ones in the game, keep experimenting :thumbsup:!
 
Saketh said:
No, it's not that simple. You have to first add the nodes which contain the shaders that deal with specularity, etc.

And, for some reason, NifSkope is not letting me copy branches between windows, so it won't work on my computer.

If you want to copy branch between 2 window you have to "open your 2nd window" like I did in the tutorial. (File/New Window). You cant copy and paste branch if you open your 2 nif seperatly.
 
Here is some headsup, while trying, I noticed that the original LH shader file has 4 shaders (NiTextureProperty), while the exported LH only has one. It seems that there is no way to apply more than one shader to the exported, perhaps Roland if you investigate how to copy the original shader textures into the new file it would work!

I can't seem to be able to copy nodes INTO nodes... I'll try tomorrow.
 
GREAT NEWS!! I seem to have found a way to add multiple shaders to the nif! I can't explain now, but I will be later :D, :woohoo:



EDIT EDIT EDIT!!! -
Yup, my good friends, I have cracked it!!! I added the four correct shaders to my crownless Cyrus, and it worked! Here are some screenshots!
crownless.gif

And no, I'm NOT JOKING! I'm using the cyrus_diff.dds file, so from now on, you'll expect to see an evolution in LH creation.
 
Top Bottom