Meshing and skinning for those who can't mesh or sKin - part 2

Started by Randomdays, April 04, 2021, 09:29:29 PM

Previous topic - Next topic

Randomdays

Tips, tricks, ideas and updates.


Hey everyone.

Since I've been back, I've relearned a lot that I'd forgotten, plus picked up a few new things as well.

I'm not yet where I was in skill level compared to then, but rapidly gaining ground.

Since some of the items discussed below are new to me, please feel free to correct me in any mistaken statements and they'll be corrected.



To start with, Cyber has a "tools of the trade" pak out with just about everything you need to get started.  To add to that, I put a few files up on the Mega site I'm using in a folder called "Editors"


https://mega.nz/folder/bxoATQBA#zhsyE8hp1uwMeDk7r17BcQ

1) Blender has moved on a bit from the version we use. Doing Yahoo/ Google searches for help usually gives you info for the newer versions that isn't much help. I've put up a searchable pdf I found for 2.49b that's about a 1000 pages long that should answer any questions. It even includes the walkthru to create a character from scratch and have it animated in 30 minutes.

2) While you may not need max to create, if you want to try out something similar, Turbosquid has a free version called "Gmax", designed mainly for gaming. You have to make an account for an activation code, but other than that, they haven't bothered me. I've put it and a zip with lots of import scripts for it, including nifscripts,  in the folder as well.

3) In the 1st thread, I used "The Sims 2" as an example. This version had a limited "Create a Sim" demo for making characters. Uploaded to the folder for anyone to try out.

4) 2 versions of 3d ripper - the one I used before and an updated version. Also, the newest version of Ninja ripper that no longer requires Max to use. When you use it on a game, it created a directory for the rips. Unlike 3d ripper which create a huge wavefront file with tons of textures, Ninja creates a separate numbered file for each object in ".rip" format with a texture to go with it. I haven't had much luck with it, but its there for you to try out.

5) to open the .rip files, you need a program called "Noesis" that will let you view each file in 3D and convert it to a Wavefront file for export. Included in the folder.

6) There's a program called "UEViewer" that lets you view and export from games based on the Unreal Engine. It supports over 300 games, including DC Online. You need a computer that supports opengl for it to work. It's found at https://www.gildor.org/en/projects/umodel


Randomdays

Lesson 1 - Materials.

Each mesh, or piece of a multi part mesh, has its own properties, including its "material". In the pic below, you can see a multi part mesh of the classic Batboat.



The different colors on the mesh are not due to skinning, but due to the material of the piece. In the second picture, in an exploded view, you can see some of the pieces that make up the boat.



While a standard mesh uses a neutral grey color, you can make  it any color you want from a color picker in the "links and materials" box below the 3d area.



This is uncommon with the FF games, but you will see it occasionally, and with imports as well. The main advantage I see to this is that it could save you some texturing.



Lesson 2 - Pivot Points


In the next example, I wanted to add Wonder Woman to her Invisible Jet. I tried various options to get get her in a seated position, but wound up just stripping the imported mesh of everything but the mesh itself. Without the armature, any position I moved the mesh into in edit mode took effect.

I used one of Kenn X's classic Wonder Woman meshes, which comes in multiple parts - the main body, the head, and the lasso on her hip. Two things to note on this;
1) If you delete the armature/ skeleton of a mesh, sometimes it "locks" the mesh in place and it can't be moved. If you move the mesh away from the armature before you delete it, it will solve that problem, and sometimes "snap" it to a new position.



2) If the mesh is multipart, sometimes the pieces will fly apart without the armature to hold them together. Before deleting the armature, join the pieces together with the main piece as the last choice. This will preserve any rigging already done.



With Wonder Woman ready to go, I imported the base mesh for Invisible jet.



Next, you need to adjust the size of the jet to match Wonder Woman using the Transform menu.

I also added the seats from the Batboat and the control stick from a batcopter import.

To see her inside the jet, select the jet and turn the view for it to wireframe as seen in the pic.



In the pic below, I've moved her into a close position of the seat in the plane, ready to adjust her to a seated position. In Edit mode, I've selected all the vertex groups of both legs, ready to swing them up.






Now in side view, I want to rotate the legs. The pic shows this from the transform menu, but you can just use the "R" key as a shortcut. Besides simple rotating, this menu gives you the option to rotate on any of the 3 axis, as well as changing the size or moving the mesh, in all axis, or just one.



By moving the mouse, the legs rotate, but as you can see, not from the hip. The default mode for pivoting is from the middle, "median" point of a selected group of vertexes, where the red dot is.



To correct this, I undid the change and went to the "pivot point" menu that controls this. The menu looks like a pair of headphones with a dot in the middle on the bar below the 3d window. Change the default mode to the top choice, "active vertex".



Now, go back to mesh and click on a vertex where you want the pivot point to be. Holding down "Shift" to keep all the vertexes selected. Click on it twice - the first time deselects it and the second time activates it again. The red dot of the pivot point should now be at the hip.



Now, you can move the mouse to rotate the legs. As you can see, you'll have to grab a few vertexes manually to adjust the curve at the pivot area where it got stretched.



After repeating the process at the knees to bend them, and bringing up the arm to the control stick, Wonder Woman is ready to fly her plane.



Lesson 3 Alpha material

I'm not 100% knowledgeable on the Alpha channel, but here's what I think I know on it.

When a mesh is alpha enabled, it allows two things ;

1) You can take a skin on a mesh and make part of it 100% invisible. If you check out some of the skins on the male alpha mesh, you can see that it allows you to get many different looks on a single mesh - adjusting the size and shape of the cape for instance.

2) For the mesh itself, you can make the mesh, and the skin on it, semi transparent so you can see through it, as with the Invisible jet.


I'm not sure how to set up the Alpha Channel in Blender, but the following shows it in nifskope.

In nifskope, open the complete Invisible jet mesh. The picture below shows it with the default skin it came with, selected on the left.



I did a simple recolor of the skin and saved it as a tga. I then changed the skin to the recolored texture.



To add the alpha channel to the mesh, I selected the mesh and then right clicked on its top branch on the menu to the left. From the menu that opened up, select "node" and "attach property"



From the new menu, select "NiAlphaProperty" about halfway down the list.



Now you can see the alpha property on the list of the left side. Next, right click on the material property line on the menu and select "material"



From the popup window, there are two bars on the bottom. The Alpha bar can set the transparency for the mesh from solid to completely invisible. The 4 color circles above can set the tint on the mesh. The emissive color can brighten the mesh in game in case its appears to dark.















Randomdays

Lesson 4 and 5 - Map objects and vehicles, and textures.

Importing map objects and vehicles are a bit simpler than characters since they aren't animated and don't need kf files. Map objects generally don't need bounding boxes or skins directories. the nifs go in a master directory for a level, as do their skins. Vehicles do you a skins directory and have a bounding and selection box.

To start with, select a basic mesh to bring into Blender. In this case, we'll use male_basic_boots. Once imported, strip him of everything but the mesh as in Wonder Woman above. He'll mainly be used for sizing



Rename him and save him off somewhere where you can grab him easily. I've named mine "doorman"

Now, grab a map item to import. In this case, we're using a big gun from Empire Earth 2.



Now, bring back our doorman and move him to a good spot near the gun. He's seen here in sideview next to it.



Use the transform menu or the "S" shortcut to resize the gun as compared to the doorman.



Delete doorman, and the mesh should be read for export.

Dealing a bit with textures. For a long time I was using other programs like milkshape to assign textures to an import if they weren't already set. I think that its no longer with new information in Blender.

With the base of the gun selected, hit "F6" to bring up the texture menus.



On the texture panel, you can see that one texture has been assigned and that its type is "image". The "image" panel gives the name and location of the image used for the texture.

If you click on the second box in the texture panel, you'll be able to assign a new texture to the mesh. Your standard texture type will be a image file, but you can also assign a pre-setup texture to the mesh, like "stucco"



After an image has been assigned, you'll need to set it to "UV" type. hit "F5" to bring up the shading panels. Click on the materials "button (looks like a red globe) on the bar. On the last panel, select the "map input" tab and set it to "uv"



One last thing on files concerning the Empire earth games. Nif files for the games are called ".nifcache" These are just renamed nif files. Changing the name to ".nif will work fine.

Textures are named ".texcache". These are compressed textures. To use them, open them with nifskope, rightclick on the file and export it as either a tga or dds.



















Randomdays

Lesson 6 - animation imports

This is brand new. Although of limited use, it does allow the direct import of new animations into the game. This method only works for FFvt3R at the moment.

So far the only games its been successful with are Civilization 4 and Empire Earth 3, which use nifs and individual action kfs, and Wildlife Park 2, which uses nifs and a multi-action kf like FF. Oblivion might work as well, but is untested so far. Luckily, these games have many units to look at, and Civ 4 has thousands of mods for it.

We'll start with a modded unit from Civ 4, a Giant Spider. Import the spider into Blender. This is what he looks like normally.



Lets start over and start as new. This time when we import the spider , we'll also import his idle animation file.



Now he looks like this;



The number (1) in the left bottom corner of the 3D view is the animation frame. You can move forward and back through the animation with th left and right arrow keys. You can watch the animation by hitting "alt - a". The Timeline dropdown at the top of the screen gives you some more animation options.

Next, lets bring doorman in to resize the spider down to something manageable with the "S" shortcut.





Delete doorman and export just the spider, changing it from a civ4 mesh to a FFvt3R mesh, including its armature and rigging.



With the spider itself converted, now we'll do the same with the animation.

Randomdays

Select the mesh and hide it so you can see the armature. Select it. This ties the kf and the armature together.



Go back to export and export the kf only.





For now, we're done with Blender so you can close it or minimize it.

Find your new kf and open it with nifskope.



This is your idle keyframe. Blender always names your animation to "walk", so click on it and rename it to idle.



Expand the idle animation out by clicking on the arrow on the left. You'll see a bunch of "NiKeyframeController" entries.

Each is frame in the animation. The important items of note for us are at the bottom of the screen. As it is, even converted, the animation won't work. You'll se the "flag" value is set to 12, and normally you'll see either this or a value of 8. These might be FF settings.

To get the animation to work with FFvt3R, you need to change the value for every frame of the animation. For a looping animation(cycle) like idle, it needs to be 40. For a single run(clamp) like an attack, it needs to be 44.

Change all the entries to 40 and save the kf.

Now open the nif with nifskope. For Civ 4, the main skin has been set to "teamcolor.bmp", used to set a color of a unit to your side, since civ 4 is a multifaction game and you need to be able to tell your spider from that of another team.



Change the skin to the normal spider skin.



Save the spider. Now set it up in the custom character directory in FFvt3R. Put the nif and kf files in the main spider directory, and put the skin in the "skin/standard" directory.

When you open the character viewer for FFvt3R, you should see your spider in idle mode.


Randomdays

Next, repeat the above steps for importing a nif and kif and choose a different animation.

The spider mesh is done, except for setting up its selection and collision boxes which we'll handle later.

Hide the mesh in Blender, select the armature, and export the kf again.

Once you've gone into nifskope and set it up for FFvt3R by changing its flags, save it again.

Next, from the menu drop down in nifkope, select "open a new window" so you have two windows open. In the new window, open the idle kf made before.




In either window, select the animation at its base, right click on it, select "block" and "copy branch"



Go to the other window, and in a clear spot, right click and select "block" and"paste branch at end".



You now have a kf file with 2 animations in it. Save it and replace the kf file in the custom folder file.



You now have a spider with two animation choices.



Repeat the above till you have the best set of animations you can make from the provided files.

It doesn't matter in what order the animations are in the file, the character player will put them in alphabetical order.


Notes; The animations provided with these imports are much more limited than those that come with the FF games. For some missing actions, this isn't important - the spider has no fly animation, but probably doesn't need it. For the others, you can copy a branch and rename it - IE, copy "Idle" and rename it as "Stunned"
With testing so far, I haven't seen any problems or lockups due to these imports.








Randomdays

Odds and Ends

Just a few items for now not I don't think were mentioned.

1)In Blender,  if you need to adjust the armature or the mesh after they've been linked together, select the mesh and hit "ALT -P" and Select "Clear Parent" .This will separate them so you can do any work needed before rejoining.

2) In Blender, if you're not sure sometime if a vertex is in the right group, select it and hit "N" . This will tell you group it belongs to.

3) In Blender, replacing a secondary mesh with another, especially a hidden item, IE a gun with another gun. The item is usually visible during editing even if its not normally on the mesh in game.
   a) Import the new item into Blender.
   b) enter edit mode, make sure all the vertexes in the mesh are unselected with the "A" key, and then exit Edit mode.
   c) Line up the new item to overlap as closely as possible the old item.
   d) Select them both and join them together with 'ALT-J" The order matters - you'll usually know if your right if the trailing 'connecting line' to the armature is still 
       there.   If not, undo and reverse the order of joining.
   e) Enter edit mode. The old item should have all its vertexes selected. Delete them and exit Edit mode. The new item should be there replacing the original one.


4) In nifskope, in the 3d viewer right click on the mesh to bring up a menu. Under "Texture" you should see two choices.

    a) Edit UV - this will bring up a look of how the texture is mapped onto the mesh. This is a 'Live" view, and if you can grab vertexes on it and move them around,
        changing the mapping of the UV.

    b) Export Template - This will create a wireframe tga showing how the texture is mapped out. This can be used to help you texture as an overlay.

Update - A few things to update with a knowledge upgrade on my end.

1) Nifs with their animation kfs can also be successfully be imported for the following games, with limits;

  a) Elder Scrolls Oblivion; The games uses separate action kfs like Civ4. The problem with these kfs lies mainly in the walk/run animations. Unlike for FF/FFvt3R, these animations actually move the mesh forward in game, instead of remaining in one spot and letting the game move the character forward. This makes for a jerky, forward and back motion. This makes these kfs of very limited use overall.

  b) Elder Scrolls Morrowind; This game is very close to the same version as FF and uses one multi kf. I was able to get a walk animation exported to Blender and found it has the same problem as Oblivion with forward motion.

  c) Atlantica Online; this MMO has thousands of character, but each has to be looked at separately. Some have just a basic idle animation as the character is just an adviser, some have a large mult-action kf, and some have separate action kfs. With that, not all nifs can be imported to Blender, and some of the kfs make part of the mesh vanish when animated.

2) For the Selection and collision boxes, these must be attached to the main armature directly. If they are not setup correctly, you won't be able to select your team member, or target ithe mesh if its an enemy. The best way to do this will be to start in nifskope and go to Blender if needed.

  a) Open an existing nif with nifskope. Find the Bounding box and selection box. Usually tied to the main bone of the mesh, probably "Bip1"

  b) Right click on one of the boxes, pick "block" from the rollout menu and then "copy branch".

  c) As with the kf copying above, open a second nifskope with you new nif in it.

  d) Find the equivalent of "Bip1" in the new mesh and past the bounding box there.

  e) Do the same for the selection box and save.

  f) If your new mesh is different in shape and size from the old one, you may need to open it in Blender and resize them to the mesh,

  g) Now, in game, you should be able to target the new character to attack it.


3) A little extra work, and some new info on kfs. It was found that each of the new character would only attack once or twice and then go idle. This turned out to be a problem with the melee animations missing a setting to work right.

  While I'm still a bit fuzzy on it, the melee needs a setting called "contact" to let it know you are actually hitting the target. It doesn't seem to be needed for ranged contact, probably because the fx has it already built in, I think.

  a) While you're converting your melee kf, or opening it in a finished animation, open the melee kf as above.

  b) You should see the list of "NiKeyframeController"s as mentioned above. This time we're working with the "NiTextKeyExtraData" at the top instead.

     An update on the "NiKeyframe"Controller": - I though that each of these was a frame of animation, but each is actually a bone in the armature and what kind of animation its setup to do.

  c) When you click on it, you should see its info on the bottom in the "Block Details" area

  d) The two main entries are "Num Test Keys" with a number after it, and "Text Keys" below it. The number for "Num Test Keys" is the number of Text Keys for the animation and should always be at least two. For melee animations, we need a minimum of 3.

  e) Go down to the "Text Keys" line and expand it. You should see the text keys available. If you expand them also, you should see that the first one should be called" start" or something similar, with a time of 0, and the last one called "end", with a time. These represent the start and end of the animation in seconds. I don't think changing the time here will speed up or slow down the animation.

  f) Depending on where you imported the kf from, there may be other keys in the middle. Civ4 likes to put calls to outside mp3s to have sounds run with the animation. There might also be one called "combat" or something similar, that FFvt3R doesn't understand.

  g) What we have to do is either rename an existing Test Key, or create a new one for combat to work correctly. To create a new one, go to the "Num Test Keys" line and increase the number there by one, and then hit the swirled 2 green arrow below it to refresh the Text Keys.

  h) With the new text keys, or using the an existing keys, you need a time during the animation for the contact to happen, and it needs to be called "contact" on the "value" line below the time.

  I) You can watch the animation and try to be accurate as possible with the time for when it should hit the enemy, or just pick a time somewhere in the middle of the animation.

j) Save the kf and try it in game. You'll know its working if when you choose your melee animation during character creation you see "melee" for a choice, or multiple choices if you have more than one melee animation set up. If the title is blank, its probably not set up right.

   Also, once in game, have your character attack an enemy or a map object, If he attacks it until the enemy is defeated or the item is destroyed, things are good.






spydermann93

Hey Rd,

I just want to thank you for providing such detail tutorials! I'll definitely give these a go at some point. Awesome stuff!

UnkoMan

These tutorials are pretty awesome.
This would be a great add to the stickied Tips and Tricks thread, or stickied itself.

DoctorRuina


SickAlice

Good deal as always. I have it bookmarked. If you want I'll take this apart and add it to the other of yours over in my Tutorial section, I consider your offerings essentials. I'll lag on this, I been notably absent due to your standard mounted issues in RL I have to devote my time to but I'm always trying to allocate time for later in the season.

DoctorRuina


Randomdays

Dr R - Not something I would want to tackle, but I wouldn't mind seeing someone who knew what they were doing putting one together....for either this one or the original.

SA - Full permission to reassemble as needed.

Randomdays

Updated the "Coming Soon" post above with some new information for meshers.

RD

Randomdays

Updated the "Odds and Ends" entry (#6 on the thread with some new info and fixes - new import resources for kf, proper bounding and selection box setup and proper setup of contact points for melee to work right.

RD

Randomdays

Adding a new tutorial - Hidden Objects. Part 1

Many meshes have hidden objects on them - usually weapons that appear / disappear during an animation. I "think" these are controlled by the kf and instead of "disappearing", they are  shrunk down out of sight. Making new hidden objects is above my skill level, but I can work with meshes/ kfs that already use them.

You can usually replace one hidden object with another by opening two instances of nifskope and copying/ pasting the item from one to another. Below we'll import a new weapon and put it to use.

In the tutorial below, I'm going to take Gren's Punisher and swap out his right uzi with a White Power Ranger weapon - In Blender of course.

To start, open Blender and delete the starter cube. We'll be import an obj file of the White Ranger. In this case there are 4 files to look at;

1) The obj file, which is the actual mesh

2) The mtl file, which is needed by the obj to set up its material and how the texture is applied. Very important.

3) 2 textures in png format. FF/ FFvt3R needs in textures in "square" format - equal height and width - which these are, and as tgas. So they're have to be converted.

So first, we'll import the obj into Blender. Goto "File" -> "Import -> "Wavefront (.obj)



Find the obj file and select it then select "import.

On the next screen, select "smooth groups" and "groups" from the options.



We now have the Power Ranger in Blender with 2 different weapons. If he's not in front view, Go to "View" and select "Front".



Briefly, turn on textures to see what he would look like in game. Textures really slow down Blender, so after checking them out, turn them off again.

From the little "Draw type" box select "textured". Select "Solid" when done





We're done with the Power Ranger for the moment. If everything isn't selected, hit the "A" key till they are. "Now hit the "H" key to hide them.

Our next step is to import Gren's Punisher. Go to import again, but this time select "NetImmerse/ Gamebryo. Find your nif and import it using standard options.



This time, hit "A" until everything is NOT selected. From the "Objects" header at the bottom, select it and go up to the top and select " "Show/Hide Objects" and then "Show Hidden". This brings the Power Ranger back on screen.



He's a little small compared to the punisher, so we need to enlarge him. Hit the "S" key and then move the mouse to grow or shrink him to the right size. He shouls move from his base position, but if he does, you can hit the "G" key and then use the mouse to put him back center to compare with the punisher.

If were going to import the mesh in and rig it, this would be our start. That's covered in my other lesson.



Now that the weapons are sized to fit the punisher, we can pick one of the two weapon to import and delete the power ranger and the other weapon. Select each one with the mouse and hit the "X" key to get rid of them.



The last step for part one is to select the power ranger gun with the mouse, and then holding down the "Shift" key, select the uzi in the punisher's right hand. Go back to the "objects" -. "Show/Hide" again, and select "Hide Deselected" This will get everyting else out of the way.











Randomdays

Hidden Objects - part 2

You'll notice that there's a "tracer" coming off of the uzi, this is showing that its tied to the armature and is controlled by it and the kfs. Without that, it wouldn't be hidden and wouldn't work right.



The very first thing we'll do deals with the skin. Imports handle skins different than FF sometimes and Blender doesn't like to import to nif unless the settings are correct.

Select just the power ranger weapon and hit the "F5" key - used for shading. Now on the far right of the various windows at the bottom, you'll see one that says "Textures". Select each texture that the mesh has and then check the "Map Input" tab and the "Map to" tab. The "Map input" tab should have "UV" selected and the "Map to" tab should have "Col" selected.



Now that only the power ranger weapon and the uzi are on screen, the tricky part will be to make the power ranger weapon match angle and position with the uzi.

Hit the "F9" key to go back to editing. With the power ranger weapon still selected, go to the object menu again and this time select "Transform" and then "Center New". This moves the center of the mesh from where ever it was to the center of the mesh itself.

Now move your viewpoint around as needed and rotate the power ranger weapon around its center with the "R" key to match the position of the uzi. You'll hsve to probably change your view and rotations a view time in all 3 axis to get it to line up.



Once its lined up, move the weapon onto the uzi with the "G" key and the mouse. Change view as needed and you can also fine tune rotation once its there.



Next to the object header is a mode box on the bottom bar. Select the box and got to "Edit Mode." This will let you see all the vertexes that make up a mesh.



At the top right of the screen, you can see that the weapon is made of 3837 vertexes. This is a bit high so we'll bring it down

The "object" choice is gone from the bottom bar in edit mode, replaced by "mesh" From the popup menu, select "vertexes" and "removed doubles" .This will get rid of duplicate vertexes, in this case over 1400 of them.



This action sometimes messes up the mesh, turning parts of it inside out. Fix this from the same menu with "Normals -. Recalculate outside"



Almost done. Hit the "A" key till all vertexes on the weapon are unselected.

Leave edit mode and return to Object mode from the small box on the lower bar

With the weapon selected first, hold down the "Shift" key and slect the uzi. The weapon needs to first or you'll lose your connection to the armature in the next step

Hit the "Ctrl and the "J" key at the same time to join the two meshes into one.



The weapon is now part of the punisher set up and will be controlled by its armature and the kfs.

We don't need the uzi anymore, so return to edit mode. you'll see just the uzi part of the mesh is highlighted.



Hit the "X" key and select "vertexes" to delete the uzi from the mesh.

Go back to object mode. Select the object menu and go back to the top and select "unhide all" again. The punisher returns with his new weapon.





















Randomdays

Hidden Objects - Part 3

He should be ready to go.

Go to files on the top left and select "export" -> netemerse/ gamebryo.

Select a name for the nif and where you want it to go. I went with a simple "character1" to protect the original mesh.

On the last menu select if you want it for FF of FFvtTR. Make sure the "Force DDS" option is not highlighted, and then export.



Hopefully he'll export without any issues.

Now, open the mesh with nifskope and select the weapon. You may have to go from "show block in tree" to "Show block in list" under "View" at the top to see its skin.

Change the skin from its default "png" type to "tga" type" and save the mesh.



Make sure the new tga skin for the weapon is in the "standard" skin directory for the mesh, and open it with the character viewer.

Select the mesh in character viewer, making sure you select the new version and not the original. Find the ranged animations and pick the one where he originally pulled the uzi out. You should see him now attacking with the new weapon firing away!



End of lesson. I hope this proves helpful. Contact me for errors/ corrections.





crosspotts1.0

thank you for the lessons random dose this mean you can make your own animations in blender and export them to that meshes kf adding it with out needing 3d max

Randomdays

Making an animation from scratch and turning it into a FF kf could be done, but I haven't tried. Sick Alice has done some nice customs that way - He did some TMNT attack animations that were awesome. He might be a better source on information on that.



The manual for the version of Blender that's used by FF has instructions on how to create a basic model and create an animation for it.