News:

Rings of Reznor!

Main Menu

Mesh imports with Blender - Examples

Started by Randomdays, June 28, 2024, 02:34:26 AM

Previous topic - Next topic

Randomdays

Since there's been some interest on using Blender lately, here's a couple of updated examples to go with the older tutorials. Upfront let me say I have some knowledge and experience with blender and importing in general, but I am in no way an expert and most everything I've learned is slef taught over the years. There's still a lot I don't know.

1) FF and FFvt3R, among other older games, use the nif format for its 3d models. This is a bit obsolete now so the newer games coming out don't use this format anymore. You can still bring newer models into the game with conversions though

2) Since the format isn't used anymore, the newer versions of Blender don't have updated import/ export scripts for it, so we use the older version of Blender that does

3) Most of the newer models can be converted to obj format, which can be imported into the Blender version we use, and worked with from there. There are online converters and some program converters that can convert your import to the obj format.

4) Some models say they are rigged. Rigging means that there's probably a skeletal armature included with the model set up to be animated by it. This doesn't really help us due to the way nifs are animated, and the fact that when you convert a model to the obj format, you lose the armature and rigging and just get the model.

5) Some of the early mesher's did some fancy work with hexing or with Max or nifskope, etc. Not every nif will be able to be imported into Blender. You'll have to either find a version that will work, convert the nif into an obj file with nifskope and lose your rigging, or find some other option.

Randomdays

#1
1) First we'll be importing a wolf from "Elena of Avalor" suggested by Cranlox.

2) The rar file he uploaded has an obj version of the model already, so we're good to go there.

3) It also has a tga file for the texture of the skin. Textures for the FF must be in tga or dds format, and must be a multiple of 2 in size. I though they had to be square, but I think a rectangle might work as well, like 128x64. Something like 100x100 wouldn't work.

4) We'll be setting up the obj wolf to work with Gren's "Wolf_dddrew_Gren" nif. In this case it doesn't matter which we import first. If we had two different nifs, like the Daglob's Krang that I moved over to Gren's Giant Man, it would. You would want the final output mesh loaded last to use its armature. So in that case, import the "Taker" (Krang) first, and the "Giver" (Giant Man) second. The output will use the armature of the "Giver" on export.

5) Now to start - Create a folder with the new, blue wolf obj and the tga texture for it. Copy the character.nif, keyframes.kf, and wolf.tga texture from Gren's wolf into the new directory.

6) open Blender. once Blender is running, delete, the cube and the Blender light and camera objects. We won't be needing these.

7) Import Gren's wolf nif into Blender.







8) Everything is highlighted purple on import. Purple in this case means everything is selected. Blender usually starts in top-down view so that's what we're looking at.

The outer diamond is the bounding box, the inner diamond is the selection. The wolf is the main mesh of course. Not really visible at the moment is the armature and some "helper" boxes. Everything is tied to the armature and is controlled by it.

9) Right click on the bounding box to select it. Everything else should turn grey. Use the "H" key on the keyboard to hide it from view for now. Do the same for the selection box and the main mesh to hide them as well.





10) I'm still not sure of the purpose of the "helper" boxes. Not every mesh has them. I'm not sure if they're created by the modder or by Max or whatever editor used automatically. I've always deleted them and have never seen a problem form doing so.

Select the armature ( the black line coming off the head is a good place) and hide it as well. Now hit the "A" key on the keyboard to select all visible items. Everything should show purple again. Hit the "X" key on the keyboard to delete all the helper boxes. You'll get a popup to confirm.




Randomdays

#2
1) Now we're ready to import the new, blue wolf obj file. Obj files usually come with a second "mtl", or material, file that tells it how the texture is applied to the mesh. Since this one doesn't have one, we'll have to set it up in Blender

2) Use the import dialog in Blender to bring in the obj file. You'll get an additional popup asking how you want to import - select the buttons as in the picture for smoothing and seperation





3) Once the blue wolf is in Blender we see that its facing the wrong way, but in the right spot. The red and green lines (and blue for the z axis) meet at the center origin point of the 3d world, and we want the mesh to usually be there.

Right click on the wolf to make sure its selected, the hit the keyboard "R" key for rotation. Move the mouse until the wolf is 180 degrees from before and facing the bottom of the screen. When he's there, hit the left mouse button to release him from rotation.





4) Now we'll assign the texture to the the model. Hit F6 on the keyboard to bring up the texture menu on the bottom of the screen. Click "Add New" and under the new menu that opens up, select "image" from the list of texture types. This will open up two more boxes on the bottom of the screen. On the last box, select "load" and find and select the tga skin for the blue wolf. The blue wolf now has his texture assigned to him.

Lastly, hit the "F5" button on the keyboard. On the bottom of the screen at the far right, select the "Map Input" tab to choose how the texture is applied. For FF we want "UV" so select that from the choices. If we were to export the blue wolf as a nif now, he wouldn't animate yet, but he would have his texture on him.

On all of the above, besides the keyboard short keys, there are also buttons on the bottom of the screen that will do the same thing.

That's it for now. Save your work as a "blend" file by using the "file" "save as" drop down on the upper left and naming it whatever you want and saving it wherever you want. This will save your work exactly as it is now.








Randomdays

#3
Now we're ready to clean up the blue wolf a bit.

1) Go to side view of the mesh, either with the "3" key on your numeral pad, or the "view" menu bar on the bottom right and selecting "side"



2) The wolf looks a little rough, so we're going to smooth him out. On the bottom right of the screen where it says" Object Mode" , click on it and change to "Edit Mode". You'll now see the vertices, lines and faces that make up the mesh, all selected. At the top of the screen you'll see how many vertices and faces make up the mesh.



3) Next to "Edit Mode" where it says "Mesh", click there to open a menu and go to the "vertices" and then to the right where it says "Remove Doubles". You'll get a message say about 900 vertices have been removed, simplifying the mesh.

Since for our format, only one side of a face can have a texture applied to it, you usually only need double vertices/ faces for something that needs to have a texture on both sides, like a cape.



4) Repeat the menu rollout, this time going to "Faces" and "Set Smooth", to get rid of any blockiness left, and "Normals" and "Recalculate Outside" incase any of the faces were flipped with the textured side to the inside. Going back from "Edit Mode" to "Object Mode" we can now see our improved looking wolf.






Randomdays

#4
We're ready to start matching the Blue Wolf to Gren's wolf for rigging.

1) Next to "Object Mode", Click on "Object" to bring up the menu and go to the top and select "Show/ Hide Objects" and "Show Hidden" to the right, to bring back Gren's Wolf.





2) Now that we have both wolfs on screen, we can see the the Blue Wolf is way to small compared to Gren's. As above, hide the bounding box and selection box again.

I will be helpful to see the full armature we're working with, so right click on the armature somewhere to select it, and hit "F9" on the keyboard. On the box at the bottom that appeared, click on "X-Ray" to select it and we can now see the complete armature.





3) Now select the small Blue Wolf mesh. We're going to match it size and position to Gren's wolf with the "S" key for "Scaling", and the "G" key for moving. Use these two keys to enlarge and move the Blue Wolf to as close as you can to the size and position of Gren's wolf. Moving the mouse will change the size and position of the Blue Wolf, depending on what editing is active. Hitting the left mouse button while working on the mesh will release it from editing.


Randomdays

#5
One last step before actually rigging.

1) We want the Blue Wolf to be aligned as close as possible to the armature of Gren's wolf. We do this by putting the armature in "Pose" mode and adjusting the bones individually. In this case, although its not a typical human type armature, we're lucky in that the mesh is close to Gren's armature for most of the bones.

Select the armature so its highlighted. Click on the "Object Mode" button on the bottom left to open up the menu and select "Pose Mode". We can now move the bones one at a time.



Click on the middle tail bone to start with and hit "R" to rotate and bring it horizontal to match the Blue Wolf's tail. Since Gren's wolf mesh is already tied to the armature, you'll see the tail move as well.





Now do the same for the front and rear legs, moving the armature into closer position with the Blue Wolf mesh. Since the wolf armature is perfectly mirrored, after you move one bone, like the left calf, move the right calf to a matching position.

Once the front and back legs are positioned, bring the neck and head bones up. These are the bones that show the most difference between the two meshes.



Be aware that imports don't always have a perfect fit to the armature you're rigging it to, and you might have to do shortcuts. In this case, Gren's Wolf has an open mouth with a texture in it, and there are jaw bones that can open and close the mouth. His head and neck are also shorter and lower than the Blue Wolf's. If we tried rigging the Blue Wolf's head to match the armature, it would probably be very distorted on export, so we'll probably just rig everything to the neck bone and see how it looks in the character viewer.

On export, Every vertice MUST be tied to an armature bone or the export will abort. Its important that each vertice is tied to the correct bone as well. We don't want a vertice in the foot tied to the hand above, or it will distort with every move.

This is good time to save your blend before moving to the next and final steps.

I'm going to hide the Blue Wolf for a minute and look at Gren's Wolf.  I select the wolf mesh and got into editing mode. All the vertices are selected, so I'm going to hit the "A" key to deselect them all.



We should still be in "F9" editing mode, so on the bottom left side you'll see a bone listed with some buttons under it. In the picture below, its the right calf.

Click on that and you'll bring up a menu of every bone in the wolf's armature. Not every armature has the same bones in it. Some may have a tail, a cape, a hat or other extras. Tommyboy's versatile meshes are extremely complex.



I'm going to select the left calf so we can see it, easier than the right calf in the back.

The "weight" button below the list is used when assigning a vertice to a bone. Some vertices, like at an elbow or knee, may be assigned to more than one bone.

Hitting the "Select" button, every vertice assigned to the left calf will be selected and highlighted. This is called a "vertice group".

The other buttons allow us to deselect the group, assign or remove vertices to/ from that group, create a new group, or delete the group all together.




Randomdays

#6
Now we're ready for rigging. There's 3 main ways to rig that I use, though all need tweaking after they're done.

On all three, with the armature selected and still in pose mode, hit "ctrl +A" on the keyboard. This will lock in the new positions of the bones that you moved as the armature's base pose.

A) Bone Wight Copy. This copies all the vertice groups and tries to assign vertices in the new mesh to those groups, as close as possible to the old mesh. This is the rigging method I use the most.

1) Leave pose mode on the armature and go back to object mode. Select the mesh for Gren's wolf and go into edit mode. Make sure that all vertices are selected. Hitting the "A" key a couple of times should insure this. Exit edit mode and do the same with the Blue Wolf. Exit Edit mode.

2) Right click on the Blue Wolf to select it. Holding down the "Shift" key, do the same to Gren's wolf so that both meshes are selected.



3) on the far left bottom bar you'll see a little grid. This is showing us that we're in the 3D view on the main screen. click on the grid and go all the way to the top and select "scripts window"



4) We're now on the scripts main screen. Next to the scripts button is now a menu button just called "scripts". Click on that and from the menu rollout bar select "object" and then "bone weight copy" from the right



5) On the new popup that opens, change "quality" to 1 with the arrow, and hit the "go" button. Blender will now take a couple of minutes setting up the rigging on the Blue Wolf to match Gren's wolf. You should have a progress bar up top showing you how far along you are.



6) Go to the far left again and return to 3D view. We no longer really need Gren's wolf anymore so you can select it and hit the "X" key to delete.

7) Select the Blue Wolf and then hold down the "shift" key and right click on the armature so that both are selected. Hit "Ctrl +P" This ties the mesh to the armature so that the mesh will be moved by the armature and be animated by the keyframe file.

Choose "Armature" from the "Make parent" popup, and then "don't create groups" from the "Create vertex group" popup, since we already created our groups.



I'm going to do a quick export to FF to see how well he came out with his rigging. If there are any vertices not assigned to a group, you'll get a warning on export and the export will stop. Blender will put you in enter mode and highlight any vertices not assigned.

If you look at the picture below, you see that he's a bit broken up. This is usually due to bad or unbalanced rigging. This is usually more apparent in the FF viewer with the FFvt3R can handle it better.



8) Going back into blender, select the Blue Wolf mesh and enter Edit mode. Hit the "A" a few times if needed to make sure that none of the vertices are selected.

The next part is a bit tedious, but we're going to the vertex group box on the bottom left and go through each one to check its vertices. Start with the tail 2 group and select it. We see that the group is good, but not perfect.



 I'm going to select additional vertices to add to the group, holding down the shift key as I add each one for multiple selections to get the group closer to match the bone. You can use the preset views to make sure you got them all, or free rotate your view with the mouse.

Once I have all the vertices added that I want, I hit the "assign" button on the bottom left with the vertex groups to add them to that group. I'm also going to select the most forward bottom vertex by itself and remove it from the group, using the "remove" button.



I'm not going thru each bone in the tutorial, but I'll be going through them all one by one.  Some general pointers are;

a) usually any group that has a mirror, like left hand and right hand, should have the same number of vertice assigned to each. The number selected is a the top of the screen.

b) Make sure deselect the vertices in the group you're working on before moving to the next. Otherwise, you can wind up have you left hand assigned to your right hand as well!

c) Not every vertex group has to be used. In the Blue Wolf's case I'm tying everything past the neck to the neck to bring the head up. Some cartoonish characters have very short legs, so I tie the thigh, calf, foot and toes group to the thigh so that the leg doesn't get distorted and stretched out

d) Vertex groups can overlap, especially at joints. Try to have the vertex groups follow the mesh and the armature as closely as you can so that the limbs bend in the right place.

e) Save often, but before saving try to check your work in the character viewer to see if you've messed up your rigging. If things look good, then save.

f) saving only really works when you're NOT in edit mode. Go to object mode before saving. Same with exporting

g) The Bone weight copy does the best that it can, but you'll usually wind up doing a lot of tweaking.

h) You can adjust the mesh after joining it to the armature by going back into pose mode, making sure you hit "Ctrl +A" when you're done. Be aware you may get strange effects - shortening the arm bone may make the mesh arm longer, or bringing down the tail may actually raise it.



Time goes by..... so after about 2 hours, I completed adjusting all the vertex groups as best as I could. He's much improved, but still not perfect. Probably as good as I can get him though. I also went back into pose mode on the armature and lowered the angle on the tail and the neck bones, though this actually did the opposite and raided them when animated.

The first pic below is in the FF character viewer, and the second in the FFvt3R one. While he still appears a bit broken in the first, he's good in the second, and should be good in both games.

For those starting out on rigging from this, you'll need patience and practice, especially on non standard meshes.

I'll post him in a bit for those who want him, plus on how to export.









Randomdays

#7
We went thru one way of setting up rigging above. Here's the other two, briefly;

A) Bone Heat
1)  Delete Gren's Wolf. As above, select the Blue Wolf Mesh and then with "shift", right click the armature to select both

2) Hit "Ctrl+P" to tie the Blue Wolf mesh to the armature. This time, when it asks if you want to create vertex groups, select "create bone bone heat". Blender will try to ties the vertices to the bone that they're closest two, and create the Vertex groups.

3) With this method a) vertices too far away from a bone will not be assigned to a group, and b) It uses ALL the vertex groups, even those that wouldn't be normally available, like the bounding and selection box.  You'll have to eliminate them and do a lot of tweaking this way.

B) Joining

1) Select the Blue Wolf an go into edit mode. Use the "A" key to make sure all the vertices are unselected. Exit edit mode.

2) Select Gren's wolf and go into edit mode. Check to make sure all of the vertices are selected. Exit Edit mode

3) Select the Blue Wolf again, and holding down the "shift" key, right click on Gren's wolf so that both the wolves are selected.

4) Hit the "Ctrl +J" for joining the two together. Select join from the popup prompt.

5) The two meshes are now one large mesh. Enter edit mode, and you'll see the Gren wolf highlighted, and the Blue Wolf not. Hit "x" to delete all the highlighted vertices, leaving you with just the Blue Wolf. All the vertex groups are there, but have no vertices assigned to them. You'll have to start assigning them from scratch.

Last- Exporting

1) Click on the armature. Everything tied to it will be exported, visible or not - any mesh or add on, plus the bounding and selection box.

2) On the upper left corner, click on "File" and then "Export" and "Netimmerse" from the menu rollouts.



3) The next screen allows you to select the name of the export and where you want it to go. click on "export" in the upper right corner

4) On the next screen, on the bottom, select which nif format you want the export to be in. In our case, either FF or FFvt3R .



 Blender can export either a nif, an animation for a kf file, or both together. "Export Geometry Only" should already be highlighted near the top.

5) If "Force DDS Extension is turned on, the export will change the export to look for dds textures, no matter what they are really. Make sure this isn't highlighted.

6) Click "Ok" and if nothing goes wrong, Blender should export your nif for you to try in the character viewer to check it out.

Ghost version - adding alpha. One last thing I'll do is add an alternate mesh with alpha turned on for transparency.

1) Open the mesh in nifskope. Click on the wolf so he's highlighted and you can see his polys

2) Right click on him to activate his popup and select "Node" and then "attach property" from the rollout



3)  Select "NiAplhaProperty" from the new menu popout.

4) On the left side of the screen, select the wolf mesh, expand his properties, and right click on his materials to open that popup



5) On his materials popup, you can now move the slider tab under alpha to choose how transparent you want him.



6) Save the nife under a different name that the original to keep this version.



RommyNa

 :o I thought that somehow files were copied and converted and that's it. All of this work is impressive from what you know and is truly a craft. Zuzo is beautiful, is he the one from the On Line game?

Randomdays

#10
Thanks for the complement. Usually an import can take an hour or two with practice.

I'm not sure where Cranlox got it from, but its probable.

cranlox

What a fantastic job and how well explained, I could try to repeat the process along with some Disney wolves or hyenas that I have the models for. Thank you for your dedication. I would need to know what version of Blender you use to download it, I also don't know why with one that looks similar, when Detounme tried to explain to me, I spent all the time checking my computer.

The model of Zuzo, Elena's blue wolf, is downloaded from Devianart, I do not know the game version of origin

Randomdays

Thanks Cranlox.

The version of Blender you need and everything you need to go with it is here;

https://www.freedomreborn.net/forums/index.php?topic=61165.msg834527#msg834527

Zuzo is completed to the best of my skills and is posted on the megasite under requests. There's a normal model, a transparent version, Gren's original wolf, and a Blend file to look at.

I've also bumped the other two tutorials I did so that all three are together, to make it easier to check out what I've learned over the years.


cranlox

Wow! What a dedicated and surprising job, I'm going to start downloading all that and making some effects for Zuzo, I can't stop being amazed at how ingenious some people here in the forum are.

Thanks a lot! I separated some characters that could use the same skeleton, to see if I can finally achieve this.
thank you for explaining and dedicating yourself so much

cranlox

#14
I was trying to make Zuzo myself, I can import the Zuzo.obj file and any .obj file but when I import .nif files blender crashes. :banghead:

I eliminated my blender that I can never use and followed Ewzzy's steps but having an old PC with a 32-bit architecture I think it keeps hanging because it is 64.

Randomdays

I don't think that's the problem. I started using Blender back in 2012 and I'm pretty sure all I had was 32 bit.

What kind of crash do you have? Does it completely shut Blender down?

Did you completely uninstall and reinstall the "tools of the trade" pack in order of 1 to 5?

cranlox

Yes, exactly everything is stuck and I have to restart.
I am in the process of installing everything again, I am going to borrow a notebook to see if I can install everything there and make it work. If that is correct and it works properly, I will replicate everything on mine. Maybe you have pieces of files from those programs that are causing problems. I can't think of what to think. :banghead:

Randomdays

#17
On my old laptop, I did everything on my own back then. On the new laptop that I just got back in April/ May, I used "Tools of the Trade" and everything is working fine