Gildor's Forums

Author Topic: Loading, editing and animating  (Read 22492 times)
Loading, editing and animating
« on: November 03, 2010, 08:23 »

bump, redirected from the blog....
here's the last tutorial I posted, on English, so it's available for you english-speakers.

Loading, editing and animating.

Since promise is debt, here's the how-to for loading and editing L2 models in Max.
I'm going to graphic the explanation with the models I extracted on the last tutorial, although the animation and edition process can be applied to any model, either imported or manually created.

Ok... so, for this we will need:
-a functional Max release (any from v7 will do)
-a simple image editor that can handle .tga files (the simpler the program, the better, because Max uses a big amount of memory. I recommend Futurix or Gimp. This is mostly for quick fixes on the files. Corel or Photoshop will work too, but only if you're familiar and used to them)
-lots of time and attention (because errors tend to happen, and they can ruin the process)

First of all, open Max, load Gildor's plugin (if you use .PSK packages) or import the models you will work on. If they are characters, they will have to be rigged to bones, either skeletons or biped systems.

We can use the model without textures, but if we want to edit the model for a specific textures (like those with alpha channels, where we can overlap some transparent faces of the model without having undesired results) we need to know the set of textures of that model because each texture is applied to a specific mesh. Here's where the graphic editor comes in handy.

If we want to build a specific model, we first need to know how it looks once finished, so that we can identify which mesh and texture we need. For this, we can use the web On the nav toolbar, we click on "Fashion", and select the model we want from the drop-down lists. In this example, I'm going with a classic: Human Fighter with Theca armor.

On the graphic editor, we search the Theca texture.
The quickest way is to filter the files by the tag "_U" (Upper body)

Of all the "_U" tags, we can now make a quick visual recon, until we find a signature feature of the texture we want (in this case, the easiest way is to find the lion)

Once we find the file of the chest, all the information we need is on the name itself:


Model: Male fighter (Humans don't specify race, as do Dwarves and Orcs, since the difference is on warrior and mage. This changes for the Elves, since they used the same model for both professions, and the difference is on the gender)
Mesh: 007 (a full body usually keeps the same mesh number, with different section: _u, _l, _g and _b)

Texture: 63 (the same texture group can affect different meshes, as we will see, but the same texture number will bring the same texture model for every race. Theca will always be 63, no matter race or gender.)
Section: U (Upper Body. _L = Legs. _G = Gloves. _B = Boots)
Alpha: Specular (Alpha channel sets up the brightness of each section). On transparent textures, the alpha channel will be noted as "_ori" and there will be another file with "_sp" tag.

So, once we find the Theca torso, we just need to hold to the Theca code (63) to find the rest of the set

And, back in Max, we filter the meshes by mesh code (006 & 007)

In this case, as I said, the Theca set is formed by two groups of meshes of different code. Other sets, specially those lower-grade sets, are often formed by a single group of meshes

Hard to figure out, but pretty straightforward, huh?

Now, it IS possible to animate without having a head loaded up, but let's load it because there are a few points that will require attention from now.

Heads are named with suffix _F (face), and there's only one mesh for each model, with 3 textures.

Hairstyles, on the other hand, are different for each race and gender, but they mostly have 4 styles for men, and 7 for women, generally 2 meshes each, and 4 different textures (with few exceptions like the male Orc or Dwarf, which have one a bald mesh and the other a mixed hair and moustache mesh)

The standard for hairstyles, both meshes and textures, seems to be as follows:

MFighter_m000_t03_m00_ah_ori.tga    para textures

MFighter_m000_m00_ah.psk       para meshes

In the case of hairstyles, the section name can be either "ah" or "bh" ('A' Hair / 'B' Hair). AH means the front style, and BH the back style)
In some cases, like the female dark elf, there can be a mesh called _ah_u00, or _bh_u00. This _u00 indicates the mesh used when the character wears a high-neck armor like a Karmian or an Apella.
Note that the mesh and hairstyle numbers are independent. That is, there's no relation between BODY MESH 000 and HAIRSTYLE MESH 000. They are un-related since they are interchangeable.

Ok, so once we have the model we want, it's a good idea to SAVE it, even if it's not a final version. There seems to be a bug on Gildor's plugin, or in Max's code, or somewhere, that causes the Undo menu to screw up from time to time. So, better to be on the safe side and make a backup to get back to if we need it.

From now on, we enter on the model edition itself.

As a first step BEFORE loading any animation, we must "standarize" the model. That is:
-weld all the meshes
-tune the model as we want (there are armors like the Blue Wolf that have a big oversized shoulder, for example)
-name the bones in an error-proof way (Max tends to screw up the names if we reference the model in another scene and create copies of the skeleton)
-load all the mesh sets we need in the same file (As, for example, on the models I'm currently using on production: every character has its skeleton, face, hairstyle, armor, fatigues, and dress clothing on the same file)

To edit the meshes, simply select a mesh, access the modification menu, and edit the mesh as needed.
In my case, I simply weld the overlapping vertices and smooth out the mesh. It helps to reduce blurred shadows and unwanted speculars on the renderings (commonly called "make-up" when it involves "actors")

To weld the mesh, select all the vertices, and weld those that overlap on a single spot.
Using 0.1 threshold is enough in this case, but on more detailed meshes, it's useful to set the lowest possible threshold.
The threshold indicates how far apart those vertices have to be, for the welding to ignore them. Any two vertices closer than that distance (in Max units) will be merged and simplified.

To smooth out the mesh, it's necessary to know where it's going to be used, what material it's made of, and what kind of light it will be lit with.
In this case, being a kind of "leather", a complete smoothing is enough. In other cases, like heavy metallic armor, it's better to cut the smoothing on sharp edges, to give the illusion of thickness and volume.
To adjust the smoothing, select the whole mesh, and adjust the smoothing threshold.

The smoothing threshold indicates where to "cut" the mesh along two faces. If the selected faces are placed at a greater angle than the setting, those faces will end up in two different smoothing groups, and the edge will be marked. If those faces are at a lesser angle, the edge smooths out, and the faces seem to be continuous, as if the edge was ironed out or polished.

Again, it's a good idea to SAVE now.

Continuing with the model standarization, there's a matter we haver to consider every time we work with a new one of these models: the face and hair meshes are NOT correctly tied to the bones.
I have no idea if this is a plugin error, or they were made this way by NCSoft, but if we add an animation without correcting the head, it's very likely that when we move the model, the head will end up in the hip!

To fix this, we access the Skin modifier on both the face and the hairstyle, and enable the "Vertices" selection.

On the mesh, we select all the vertices.

The model turns red, marking us that all the vertices we selected are completely affected by the bone we have selected. But, by default, the selected bone is not the head, as it should be, but the base bone: Bip01

On the bone list, select the _Head bone, and assign the selected vertices to the head, with the Absolute weight control.

The Absolute control causes all the selected vertices to be affected 100% (1.0) by the selected bone of the list
If we were to use the Relative control, we could cause several bones to affect the selection. It's not convenient for the head, but it might come in handy for the female skirts, or the long hairstyles, since they share movement with the legs or the back of the character

Once we set the face and the hairstyle to the Head bone, we can say the model is "Standarized" (error-free. mostly.)

This is what you should have.

To animate the model, we can use thee procedures:
-Keyframe animation,
-Load the stock animations of L2, OR
-Tie a biped system and use motion capture, motion flow, or .bip files

Keyframe animation is a very, VERY, delicate and precise work. It's useful to correct small errors or to work over a specific part (like a close-up of the face, hands or feet, if it's not too complex), but it's way too complex to animate a model completely through keyframe animation. So, for the sake of keeping the readers interested, I'm not going to explain it.
Biped animation saves quite a lot of time, but the biped system is not compatible (at least, not practically) with the bone system we use. Although it does save a lot of time in relation to keyframe animation, when it comes to biped animation, it's better to re-rig the model over a biped, from scratch. The rigging and weighting process, in that case, is the complex part, so I'm not going to focus on that either.

There are quite a lot of tutorials on how to animate a biped or by keyframe in websites like Turbosquid, 3dRealms, Youtube or even Autodesk's own site. These are some practical ones:

To give a basic idea about the production of "Lair of Antharas" (and shed some light over the next one: Seal of Shilen), and over the general edition of both the animation and the final compositing (on After FX, Audition and Premiere), I'm going to explain the Motion Mixer system, which works with animation blocks, tracks, filters and outputs. On the Adobe suite, this system encompasses images, audio, tracks, outputs and mixers, but the block system is roughly the same, and it gives a good idea on how to compose a work out of other different parts

So, let's leave the model aside, and work on the skeleton:
On a new file (or the model itself, but it's better not to screw up the files), import any mesh from Gildor's plugin. That will bring up the mesh and the whole skeleton along with it.
At the same time, import the animation package for that mesh (in this case MFighter), that's usually on the MeshAnimation folder. To have a better handling of the skeleton, delete or hide the mesh. We don't need it anyways.

In order to work with the motion mixer, we need to have the files we will load in .XAF format (eXchange Animation File)
In order to generate a XAF file, we need motion on the bones, so, load the preset animation from the animation package, and select the whole skeleton.
The XAF file will be created based on the selection. Although we can use a section of the skeleton instead of the whole structure, it's always a good idea to prepare the whole structure, and then "trim the ends" on the final edition.

As I said, with the mixer system (or any mixer, for that matter), the final product is made up from different sections which are mixed together. To edit these animations, we need several different animations from the animation package, so let's save some different files.
It's a good idea to check the "fix loop animation" mark, which will allow the final animation to be looped over, without unwanted "jumps" on the sequence. This will turn out useful when we loop the walking animation.

In my case, I have exported Walk_1HS, Walk_Hand, and ShieldAtk_1HS. To export an animation, once we have the selection we want to export, we use the option "File -> Save animation". Watch the in and out frames of the animation. If you loaded several animations while you were selecting your material, there might be some residual frames after the last frame displayed, so be sure you export the selection you are looking at on the track bar below.

Once we exported the material, we can start editing. It's convenient to reset Max, to delete any residual errors on the Undo menu.
After cleaning Max, import a new skeleton (or open the warrior model) and open the mixer.
You can access the motion mixer from the "Graph Editor" menu
On the motion mixer, we need to specify which objects we want to control with it, so, load the skeleton on a new track

To create a new track, click on "Add Max Objects", and select the whole skeleton, excluding the armor mesh and the head

WARNING: be V E R Y careful with the selection from now on. The selection filters work by selecting objects from a list, so any rogue clicks can change the selection for worse. Before clicking Apply or Accept, double check your selection list

Once we have our track created, we need to bring the raw material.
Any .xaf clip we load to this track, will affect the bones on the scene that are tied to this track (the whole group, in this case), so bone edition (position, rotation, scale) from the scene is restricted from now on. Any movement applied to the bones, will have to be made from the mixer (one of the disadvantages of this system)

To import the clips we want to use, right-click on the track, open the "New clips" rollout, and select "From File". On the dialog frame, find the file "Walk_1HS". This will bring a base to work with: a looped walking animation, over which we can add anoter animation and modify parts independently
In the case that Max ask us to "map" the model, on the dialog box, select the whole left list, the whole right list, and click on "Hierarchy". This will tie up the bones of the xaf file to the bones on the scene, taking the base bone as reference. Any bone linked to this base bone will be seen as "Base's child 1", "Base's child 2", "Base's child 1's CHILD", "Base's child 2's CHILD" and so on, leaving the naming apart. (more info on this system to come)

Block Walk_1HS has 13 frames, which if we play back at 24 or 30 fps (standard for a video), will be quite fast. To correct the timing, scale the clip to a longer size. That will separate the inner keys and make it run slower.

Now... scaling the animation only affects time, and what we need is to create a fluid loop.
To loop the animation and create a smooth transition, we need a transition track
To convert the current track to a transition track, right-click on the track, and select "convert to transition track"
This adds up two more lines inside the track, that we will use to overlap clips.

To loop the movement, duplicate the clip. Take the clip, and drag it away, while pressing SHIFT

Set the clip on the opposing subtrack, and on the middle track, we have the transition. Since both clips are already set to be looped (courtesy of the "Fix loop" mark ^^), it's enough to put them one frame apart.
If you need precision, you can zoom on the track with the mouse wheel (or with the zoom button, above the track space)

Repeat the procedure to fill the 100-frame track.
This will give an animation of about 3 seconds, of the character walking.

If we want to adjust the pacing, we can scale the whole animation track, but it's better if we import the clip back, brand new, adjust one loop, and repeat the blocks again.

This far, we have a preety "dull" animation, without much action. Simply a walk loop.
To give this guy a bit more of life, let's mix some extra animations.

We already have the file ShieldAtk_1HS, which on itself is pretty dynamic. Which, if we mix over a base animation, can give an interesting result
In this example, let's create a kind of "leave me alone" or "en-passant strike" animation, where the character will strike something away, while walking forward.

In order to mix more than one animation, we need another track, but related to the same group of bones. To add another track, right-click on the left margin, and select "Add trackgroup above/below". This new track will load affecting the same bone structure as the previous one. You can tell the grouping by looking at the track blocks themselves. Tracks grouped under the same left-margin block, will affect the same objects. If any clips loaded in this new track are not looped, once the clip ends, the animation will resume on the frame of the animation below it.
The overlapping is preety straightforward: as in a table, from bottom to top, the "top" clip covers the "bottom" clip.

To straighten this out, load ShieldAtk_1HS. It's convenient to fix the lenght by the same factor as the walking clip, to keep it tuned and realistic. This is: about twice as long

Here we see how, even standing on a frame with both tracks loaded, the model is only affected by "ShieldAtk_1HS" on full expression.

Since I loaded this clip just for the arm animation, let's filter the track to those bones only.
To edit the output, right-click on the margin and select "Filter".

In this new list, select the "Left" branch, from the shoulder.
(Here comes the precision on selection I mentioned. Tongue)

Now, on the same frame we were on, the model now comes back to its "walking" pose, while the arm poses itself to the effect of "ShieldAtk". If we move along the animation, we will see the difference.

Almost there...
To polish the effect a little more and make it more "realistic", we can do two things:
-trim the "ShieldAtk" clip on the point where the arm moves, or...
-smooth the clip's output with the "Weight" control

The "weight" control (sort of a "volume" control for the audio mixers) let us adjust how much the track affects the whole animation.
In this case, we need to work over "ShieldAtk" alone, without having the input of "Walk_1HS". So, cancel the walk track with the controls on the left: "M" for "Mute track"

If, as in the picture, we hace ShieldAtk placed at frame 0, the arm effect starts about frame 30. So, from that point, edit the weight control.

Place the marker on frame 25, and on frame 30. From frame 0 to frame 25, set the line to 0 (no output for this clip), and from frame 30 on, set the weight to 1 (full output). We can also smooth the output up to the end, setting the last frame to 0. This gradually cancels this track and returns the control to "Walk_1HS". We can also slide the markings (with the Weight button on) to smooth the inner and outer points of the transition.

Slide the whole clip about half way through the track, to add animation space before and after (usefull when you edit a composed scene), activate "Walk_1HS" again, and Voila!. You get a composed animation that looks realistic and (almost) without editing the bones themselves

Hero Member
Posts: 7975

View Profile WWW
Re: Loading, editing and animating
« Reply #1 on: April 06, 2012, 13:52 »

This thread were split from Lineage 2 video - Lair of Antharas thread.
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS