[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "Blender/Creature Meshes 101"
Jump to navigation
Jump to search
m
no edit summary
imported>Fragment m |
imported>Fragment m |
||
Line 1: | Line 1: | ||
'''DO NOT EDIT OR DELETE THIS PAGE, I'M KEEPING THE SOURCE AT HOME IN MY EDITOR FOR NOW!''' | '''DO NOT EDIT OR DELETE THIS PAGE, I'M KEEPING THE SOURCE AT HOME IN MY EDITOR FOR NOW!''' | ||
Line 88: | Line 89: | ||
* If you select Render>Draw Havok, you'll also see the collision boxes (or ellipsoids), rendered in a darker shade of green. | * If you select Render>Draw Havok, you'll also see the collision boxes (or ellipsoids), rendered in a darker shade of green. | ||
* Close NIFskope. Double-click sheep.nif, rotate this a bit. That's the model of the creature. | * Close NIFskope. Double-click sheep.nif, rotate this a bit. That's the model of the creature. | ||
[[image:tutcre101-scrn-folderstructure.gif|right|thumb]] | |||
What we're going to achieve is to replace the model of this with our own. ''We make ourselves at home in the Oblivion\Data folder by copying the sheep folder there under a different name''. | What we're going to achieve is to replace the model of this with our own. ''We make ourselves at home in the Oblivion\Data folder by copying the sheep folder there under a different name''. | ||
Line 93: | Line 96: | ||
* Now copy the whole sheep folder to Oblivion\Data\meshes\creatures. You may need to create the meshes\creatures folders in your Data folder first. | * Now copy the whole sheep folder to Oblivion\Data\meshes\creatures. You may need to create the meshes\creatures folders in your Data folder first. | ||
* Since we do not wish to replace the sheep coming with Oblivion, we rename the sheep folder to "oursheep". | * Since we do not wish to replace the sheep coming with Oblivion, we rename the sheep folder to "oursheep". | ||
* Make a backup copy of the .nif files right now. That's not strictly neccessary, but convenient. Just select them, hit Ctrl-C, Ctrl-V. Should you want to start anew with a | * Make a backup copy of the .nif files right now. That's not strictly neccessary, but convenient. Just select them, hit Ctrl-C, Ctrl-V. Should you want to start anew with a fresh skeleton.nif or so, it will be right there. | ||
fresh skeleton.nif or so, it will be right there. | |||
That's the folder we're going to work with. In there are the files we're going to mod! | That's the folder we're going to work with. In there are the files we're going to mod! | ||
Line 102: | Line 104: | ||
We later need to "rig" the new mesh to the skeleton, but Blender cannot yet import it in the form as it is here. So while we're there, we right now ''create a skeleton.nif suitable for importing into Blender''. | We later need to "rig" the new mesh to the skeleton, but Blender cannot yet import it in the form as it is here. So while we're there, we right now ''create a skeleton.nif suitable for importing into Blender''. | ||
[[image:tutcre101-scrn-cleanskelly.gif|right|thumb]] | |||
* Double-click skeleton.nif. NIFskope opens with the skeleton file. | * Double-click skeleton.nif. NIFskope opens with the skeleton file. | ||
Line 110: | Line 114: | ||
* leave NIFskope open | * leave NIFskope open | ||
We actually just deleted all havok data. Oops! But as we're not going to use any of it directly in the game later, it will be OK. The problem is, Blender will not be happy with just the naked bones - there must be a skin they're attached to | We actually just deleted all havok data. Oops! But as we're not going to use any of it directly in the game later, it will be OK. The problem is, Blender will not be happy with just the naked bones - there must be a skin they're attached to. | ||
[[image:tutcre101-scrn-copybranch.gif|right|thumb] | |||
So, what we need to do now is to ''copy the relevant skin mesh into the .nif''. .nif files store the bare meshes as NiTriShape or NiStripShape. We find that mesh, and then copy the required mesh into the cleaned skeleton. | So, what we need to do now is to ''copy the relevant skin mesh into the .nif''. .nif files store the bare meshes as NiTriShape or NiStripShape. We find that mesh, and then copy the required mesh into the cleaned skeleton. | ||
Line 120: | Line 126: | ||
* right click them, click Block>Copy Branch | * right click them, click Block>Copy Branch | ||
* in the window with the skeleton.nif, right click "0 NiNode Scene Root", select Block>Paste Branch | * in the window with the skeleton.nif, right click "0 NiNode Scene Root", select Block>Paste Branch | ||
* in front of the node is a number, remember that | * in front of the new node is a number, remember that, for me, today, it's 90 | ||
{| width="30%" align="right" style="background:#aaffaa;" | {| width="30%" align="right" style="background:#aaffaa;" | ||
Line 132: | Line 138: | ||
* select the scene root node | * select the scene root node | ||
* make sure you see the "Block Details" window. Hit F2 if you do not. | * make sure you see the "Block Details" window. Hit F2 if you do not. | ||
* scroll down, you should see | * scroll down, you should see "NumChildren" and "Children" directly below | ||
* double-click the value in NumChildren, increase by 1 (=by the number of meshes we added) | |||
* right click on the "Children", chose Array>Update | |||
* open it (+) | * open it (+) | ||
* double-click | * double-click "None" and replace with the number you remembered above, it was 90 for me. | ||
[[image:tutcre101-scrn-entering90.gif]] | |||
When you hit Enter, the copied mesh wandered into the scene root node! And the sheep mesh is now correctly positioned on the skeleton. | |||
Finally:<br> | |||
* save the file as cleanskel.nif | |||
{| width="30%" align="right" style="background:#aaffaa;" | |||
|'''DEBUGGING''' | |||
When Blender loops endlessly upon importing, the mesh in the .nif is broken. It can be fixed by exporting as .obj and reimporting it. I sincerely hope that doesn't happen to anyone else. | |||
|} | |||
Phew! That was quite some work, to make a cleaned skeleton like this. But the good news | Phew! That was quite some work, to make a cleaned skeleton like this. But the good news is, you only need to do that once for each creature. You can reuse the cleaned skeleton for other creatures which are based on the same skeleton. | ||
is, you only need to do that once for each creature. You can reuse the cleaned skeleton | |||
for other creatures which are based on the same skeleton. | |||
Did I mention we're going to just delete the mesh as soon as we're importing it? Damn, so much work. | Did I mention we're going to just delete the mesh as soon as we're importing it? Damn, so much work. | ||
Line 171: | Line 180: | ||
For the model we want to import into Oblivion there are some requirements. | For the model we want to import into Oblivion there are some requirements. | ||
The model needs to roughly fit the existing ones. Look at the dog model, the original has a raised head and the tail in a straight line. You can just about forget to start with a dog sitting, its tail wound around the paws. If you have a model with a wrong tail, well a tail is quickly deleted and redone, but much more problems than that and I would rather start anew. You can play around with the overall size in the construction set later, or leave parts of the rigging out. If you want to have a small dog, just set size to 0.5 later. If you want to have a dog with a capped tail, just don't rig the last tail bones. | The model needs to roughly fit the existing ones. Look for example at the dog model, the original has a raised head and the tail in a straight line. You can just about forget to start with a dog sitting, its tail wound around the paws. If you have a model with a wrong tail, well a tail is quickly deleted and redone, but much more problems than that and I would rather start anew. You can play around with the overall size in the construction set later, or leave parts of the rigging out. If you want to have a small dog, just set size to 0.5 later. If you want to have a dog with a capped tail, just don't rig the last tail bones. | ||
To keep everything as simple as possible, use one material only. When you use more than one material (or material index), you will get multiple meshes in the NIF you export. That's good later if you plan to have multiple textures on one mesh, but we're not trying fancy stuff like that right now. | To keep everything as simple as possible, use one material only. When you use more than one material (or material index), you will get multiple meshes in the NIF you export. That's good later if you plan to have multiple textures on one mesh, but we're not trying fancy stuff like that right now. | ||
Line 182: | Line 191: | ||
* open Blender | * open Blender | ||
* load the | * load the goat model | ||
* switch to wireframe view (ZKEY) | * switch to wireframe view (ZKEY) | ||
* in the menu, File>Import>NetImmerse/Gamebryo | * in the menu, File>Import>NetImmerse/Gamebryo | ||
* chose cleanskel.nif | * chose cleanskel.nif | ||
You now see the same structures you earlier saw in NIFskope, in Blender. In the front is the sheep mesh, inside - look closely - you can see the skeleton. ''We want to rig that skeleton to our mesh.'' | [[tutcre101-scrn-skellyimported.gif|left|thumb]] | ||
You now see the same structures you earlier saw in NIFskope, in Blender. In the front is the sheep mesh, inside - look closely - you can see the skeleton. ''We want to rig that skeleton to our mesh.'' Study the Bethesda model for a moment, how they did things. Then, in Object Mode, right click the sheep mesh and delete it (XKEY). That hurt, right? What you have left is the basic skeleton. | |||
[[tutcre101-scrn-goatposition.gif|left|thumb]] | |||
* scale and rotate the sheep model into a good position. Rotate by exact amounts (hold | * scale and move and rotate the sheep model into a good position. Rotate by exact amounts (hold CTRL). '''Do not change the skeleton in any way!''' That will not do what you think it does. | ||
* hit Ctrl-A to apply the scale and position changes | * hit Ctrl-A to apply the scale and position changes | ||
* | * save your work using F2, NUMPAD+, ENTER (that adds a version number) | ||
* right click the | * right click the goat mesh, shift-right click the skeleton, hit ctrl-P, select armature, select don't create vertex groups | ||
We just parented the mesh to the skeleton. That means if you move the skeleton, the mesh moves along with it - a good start! But what we actually need is not only a movement of the mesh along with the skeleton, but a deformation of the mesh itself. To that end, we must ''tell which vertices belong to which bone(s)''. That process is called weight painting. The deformation does not use absolute yes-or-no values, but a value between 0 and 1 (or 0% and 100%), it's weighted. The value determines how much a vertex is influenced, not only if it's influenced at all. Of course a value of 0 means it's not influenced at all. | We just parented the mesh to the skeleton. That means if you move the skeleton, the mesh moves along with it - a good start! But what we actually need is not only a movement of the mesh along with the skeleton, but a deformation of the mesh itself. To that end, we must ''tell which vertices belong to which bone(s)''. That process is called weight painting. The deformation does not use absolute yes-or-no values, but a value between 0 and 1 (or 0% and 100%), it's "weighted". The value determines how much a vertex is influenced, not only if it's influenced at all. Of course a value of 0 means it's not influenced at all. | ||
Why it's called painting, you shall soon see with your own eyes: | Why it's called painting, you shall soon see with your own eyes: | ||
[[image:tutcre101-scrn-selectposemode.gif|left|thumb]] | |||
* right click the skeleton, select pose mode | * right click the skeleton, select pose mode | ||
Line 212: | Line 227: | ||
(4) wire turns on the wireframe model. Turn on or off as you like. | (4) wire turns on the wireframe model. Turn on or off as you like. | ||
[[image:tutcre101-scrn-spinepaint.gif|left|thumb]] | |||
Let's start painting. Don't become too obsessed with assigning weights right now, you can do that later with your own models. | Let's start painting. Don't become too obsessed with assigning weights right now, you can do that later with your own models. | ||
Line 246: | Line 263: | ||
You can export your work now and look at it in NIFskope. The vertices you missed are drawn to the base of the world, which is luckily not that far away - in NIFskope. | You can export your work now and look at it in NIFskope. The vertices you missed are drawn to the base of the world, which is luckily not that far away - in NIFskope. | ||
* from the menu, choose File>Export>NetImmerse/Gamebryo, export as | * from the menu, choose File>Export>NetImmerse/Gamebryo, export as sheepbones.nif | ||
* open | * open sheepbones.nif in NIFskope and check for errors | ||
* correct errors in Blender, go back to step one until happy | * correct errors in Blender, go back to step one until happy | ||
* don't forget to save the corrected work in Blender | * don't forget to save the corrected work in Blender |