Jump to content
Sign in to follow this  
STALKERGB

STALKERGB's Weighting overview

Recommended Posts

Hello!

Firstly, this isn't really a tutorial as much as an overview of weighting, what it is, how to "do" it and ways of checking your work. Unfortunately there isn't really a speedy way to do manual weighting (although I'm sure a clever person has/could come up with some script for O2) and a lot of it can be trial and error but if have a bit of patience you can get the results you want. All the info below is stuff that I have learnt myself so it may well be wrong in places, its just my understanding of the subject. If anyone finds any inaccuracies, post and I'll get round to changing it.

Ok well, lets really start with the basics...

If you have ever clicked on a selection for an infantry model in O2 then you've probably seen lots of points light up in various red, blue and purple tones. To put it most simply, these colours refer to the "weight" each point has for a certain selection such as "LeftArm" or "Head". As you can probably guess, each of these selections dictates how your model will animate in game. So as an example, what ever you define under the "Head" selection will move when the model's head turns up, down, left and right.

Now lets say you create a new ammo pouch model for your infantry, obviously you are going want it to move/animate like the other ammo pouches round it. So, we are going to have to add it to a selection. Now you could select say, "Spine1" and then all of your new pouch and add it to the "Spine1" selection but you will probably find that if you had a quick test of that it would still move differently in game. Thats probably because it is still weighted differently even if it is defined to the same "Spine1" selection. So lets get down to weighting it, while we are at it, lets find a faster way of testing whether the weighting is better. Loading up the game takes too long...

Right then, so where do we find the weighting tool?

Select "Edit" from the drop down tabs at the top of O2, under that at the bottom there should be an option called "Edit Modes" and under that should be an option called "Paint Vertices". If you click that it will bring up a new little window which we will get to in a second. To get out of the "Paint Vertices" mode, you can enter one of the more common edit modes such as "Select Vertices" (shortcut V) or "Select Object" (Shortcut O). While we are on the topic of shortcuts, it is probably worth your while adding the "Paint Vetices" to a keyboard shortcut if it isn't designated to one already. You can do this by selecting "File" in the top left of O2 and then clicking on "ShortCuts". From there you can add it to whatever you prefer. Mine is added to "1" on the keyboard.

Anyway, I think its time for pictures. That little window that appeared when you select "Paint Vertices" has a couple different sliders on it each with a slightly different purpose. I'll go through each below.

weightbox.jpg

Weight: I guess the most important one, this changes how much the vertices you paint are affected by the selection you add them to. The more red the colour the more heavily affected the points will be. And the more blue the colour, the less affected points will be by the selection they are added to. As a practical example, if I added something to the "LeftArm" selection with all the points being red, then in game they will move much more when the arm goes up or down. If those points were blue, then they would move far less as the arm goes up and down.

Solid Area Size: As you will see, your cursor will have changed to a circle, sliding this option to the left makes the circle smaller and sliding to the right makes it bigger. Basically changing the size of the area that you will "paint". When you left click, the area inside the circle will be "painted" and have a weight applied to it.

Smooth Area Size: This adds a second circle outside of the first one, using this will add an area that gets weighted less than the area inside the first circle. It creates a gradually decreasing weighted effect. This can be useful for areas like arms and legs where one part is heavily defined by a selection and the area around it is less affected by it. As you can see on the picture, the left side has had the Smooth Area Size slider over to the right which has meant the outer points are less heavily weighted. The picture on the right has not used the Smooth Area Size at all.

Strength: This basically determines how strongly your selected colour is applied to the points you paint. It affects blue, lesser weighted points, more subtly . If you selected a very bright red but had a low strength (left is low, right is high) then the colour that will be painted onto your points will probably be a purple colour first time, you will have to click a couple more times to get closer to the red you originally selected. This can be good if you slowly want to increase a weight to see how it affects an area.

Well lets look at actually using that shall we?

Depending on what you are weighting, there are a few ways of doing things. Lets start by looking at a body part, for example the Left Arm. The first thing I do before I start messing around with weights, is make a backup of my model. So if it all goes wrong, at least you can go back to where you were.

The best thing to do is use a BIS sample model as reference, you can use the Arma 1 models or the Arma 2 sample character. Which ever you prefer.

What I do is open up my model and copy over a bis sample infantry model (without any extra proxies). I then move it to the right or left of my model so I can see both together. Its probably good to make a selection called something like "All BIS Sample". So with the BIS sample completely selected, right click in the selection window and choose the "new" option. Then name it what you want. Doing this makes it easier to delete the sample model when you no longer need it as reference.

newselection.jpg

Hopefully what you have now is your own model, and the BIS sample you are going to be using as reference next to it like in this picture below, my model is on the left, and the sample is the ARMA 1 US soldier on the right. As you can also see I can compare how the "LeftArm" selection looks on the reference, and on my model. Unfortunately I can't tell you "how" to weight the arm as it is very much a case of painting on a colour similar to the reference and then testing to see what changes are needed.

ref.jpg

Once you have painted an area and you want to add it to a selection you can either do what was shown above (right click then select "new" and then name it) or if you want to add it to a selection you already have you can right click in the selections window and create a new selection, call it something like "LeftArmAdd". Then while holding "ctrl" on your keyboard, select "LeftArm" so that both selections are highlighted. Now you can right click on "LeftArm" and select "Redefine" from the options:

leftarmadd.jpg

For weighting pouches, you probably don't need a reference model to the side of your own model. Instead what you can do is weight it before you place it in position on your model. So, like in the picture below, I have picked the selection which is closest to where I want my new pouch to go on my model. In this case it is "Spine3", you can go through the selections clicking on each one until you find one that is approximately in the same position as where you pouch will go. Once you have found one, find a colour on the "weight" slider that is closest to the area where your pouch will be. Generally I find that it is a good idea to paint ALL of a pouch one weight, otherwise you can end up with the pouch twisting as different parts of it are being affected more, or less by a selection. That's not to say you can't have a pouch defined to "Spine3" and "Spine2", just its a good idea to make sure the WHOLE pouch is defined to both.

pouchS.jpg

Larger

Now to add the pouch to the selection (Spine3), you can right click on "Spine3" in the selection window and click "redefine". Make sure that you still have the original points from Spine3 selected or you will lose the weighting originally defined by the selection. If you are in doubt, create a new selection and combine the two as I explained above. Just a quick note, sometimes you may want to weight two parts of one pouch differently so it does twist or bend when the model's body moves, this can be useful for very long pouches. Normally you can work out whether you will need to do this if you imagine the pouch on yourself, if you think it would bend then it might be worth weighting different parts different weights.

That's the main areas of actually weighting a model, like I said, it's not really possible to teach you how to weight each point you will need to weight. Its basically using other sample models as reference and a lot of trial and error. Might be worth having a mess around first just to get an idea of how the sliders affect everything and how that transfers when you click on your model and start painting.

Edited by STALKERGB
  • Like 3

Share this post


Link to post
Share on other sites

How can I test if my weighting is any good?

One way of doing this is packing your addon, launching the game and seeing how it looks. This takes quite a long time so wouldn't it be good if we had a way of doing it within O2? Lucky we do!

For this you are going to need some animations, personally I use ICP_Anims by Nightkiller. You can also use ARMA1 animations if you know where to find them in the Armed Assault directory on your hard drive, the Arma2 anims are binarized so AFAIK you can't use them. Anyway, once you have your .pbo with anims in, unpack it somewhere easy to find in your P: drive. If you look in the unpacked folder you will see a lot of files called "anim-name-here.rtm", these are the animations you will use. Right, now time to go back to your model, if you have never used keyframes before, you will probably need to add the window to your display. You can add it by selecting the "Windows" tab at the top of O2 and clicking on the option called "Animations". You should now have a little box appear somewhere that looks like this:

keyframe.jpg

Once you have this window up, right click in the centre of it. There should be an option called "From Matrices", click that and then locate you animations you unpacked earlier, select one of them and click on "open". Because I am using the ICP anims in my example, I'm going to select "m4_2.rtm" and click "open". Hopefully, the window should now have some keyframes in it. For the ICP anims, I need to select the keyframe numbered "0.10000", as it is a static animation there are only two keyframes, if it was not static there would be many more. If you are unsure which keyframe puts your model into the animation just click through until you see something happen.

animS.jpg

Larger

As you can see in mine, the area I was weighting was the "LeftArm" and it appears to have been done ok. There doesn't seem to be anything out of place or any distorted areas so I can move on to a new area that needs work. If there were any individual points that were not right, you can select the keyframe that puts your model back in its original pose (in this case, with ICP anims its -0.5000) and edit them.

After you have re-weighted an area you will need to reload the animation to see any affect. (that was the right click, "from matrices" bit I talked about earlier). By doing this, you should be able to see points moving as you change the weights on them, make sure you use the same animation otherwise it can be harder to tell what effect your editing has just had. If you want to get rid of an animation, right click in the keyframe window and select "Delete All Animations".

Just an extra tip for people: If the rest of you model is getting in the way when you try and weight areas you can select the area you dont want to see (using "select vertices", shortcut V) and the pressing "ctrl+H" to hide that area. This doesn't delete it, it just makes it invisible so there is less on screen when you edit. To make it re-appear, press "ctrl+A" to select the whole model and then press "ctrl+shift+H" to unhide everything.

A second little tip (mainly for weighting a model's body) would be to make sure you don't do too bigger area at once. If you do it can get quite messy, also if you do it in smaller steps then if something goes wrong there is less to undo. Also, using a lower "strength" setting for weighting can help to show you if you are moving in the right direction without making any huge changes to the weighting.

Right well hopefully that is a decent overview of the different areas behind weighting a model manually. Like I said, that's from my own experience so there may be better ways of doing things and if there is any incorrect information just say and I'll get on to editing it. If anyone has comments/questions post them and I'll do my best to help.

Thanks

Matt

Edited by STALKERGB
  • Like 3

Share this post


Link to post
Share on other sites
likef.png

Edited by PuFu

Share this post


Link to post
Share on other sites

yep, great tutorial!

BTW this doesnt just work for rtm's but for rigid model.cfg anims as well:

weightsv.jpg

here you can see the top of the track being rigged in such a way that when the wheel damper moves upward, not only do the verts above it do too but also the adjacent verts move about 50% to avoid sharp edges on big displacements.

Share this post


Link to post
Share on other sites

Ah that's interesting, thanks for the info on that SA, I did wonder if you could apply the same kind of thing to vehicles and rigid model.cfg anims. I've only really played around with the basics of animation like that, very simple stuff like tracks/dampers/crew hatches so never really had a chance to take it further.

Out of interest, do the BIS vehicles use this? I seem to remember the Arma1 samples didn't. Seems like this just adds that extra bit of polish :)

Share this post


Link to post
Share on other sites

Yep I have successfully applied this to fabric gun mantle covers for example, avoids a lot of stupid stretching.

mantle.jpg

Edited by Soul_Assassin

Share this post


Link to post
Share on other sites
yep, great tutorial!

BTW this doesnt just work for rtm's but for rigid model.cfg anims as well:

weightsv.jpg

here you can see the top of the track being rigged in such a way that when the wheel damper moves upward, not only do the verts above it do too but also the adjacent verts move about 50% to avoid sharp edges on big displacements.

are the blue vertices part of the damper selection?

Share this post


Link to post
Share on other sites

no, the damper are verts under the wheel. the selection on the pic is a bone directly connected to the damper, so that upper track moves when lower track moves.

Share this post


Link to post
Share on other sites

To add slightly to what Soul Assassin is saying, this is how they animated the antennas on Willy's Jeep in Operation Flashpoint (IIRC), if anyone remembers that. They weighted the antennas to the damper bone, giving the appearance of 'overlapping action'.

Share this post


Link to post
Share on other sites

Thank you soo much for this!

Can finally go fix my Recon Marines.

Really great contribution to the community :)

Share this post


Link to post
Share on other sites
no, the damper are verts under the wheel. the selection on the pic is a bone directly connected to the damper, so that upper track moves when lower track moves.

ok are they part of a named selection? im assuming so

Share this post


Link to post
Share on other sites
ok are they part of a named selection? im assuming so

the verts under the wheel are 100% leftwheelunder# (#represents the number of the wheel)

the verts directly over the wheel are 100% leftwheelover# while the ones adjacent are a 50/50% spread over the current selection and the preceding and following selections.

Illustrated in ASCII:

..........50% lwo2.........................50% lwo3

..........50% lwo3....100% lwo3.....50% lwo4....100% lwo4

------------*--------------*---------------*---------------*------------

---------------------------*-------------------------------*------------

............................100% lwu3........................100% lwu4

Bone set up:

.......

"lwu3","", // under(damper)

"lw3","lwu3", // wheel

"lwo3","lwu3", // over (to displace together with the damper)

........

and lwu3 is set up as a damper.

Share this post


Link to post
Share on other sites

Glad people are gonna find this useful :)

Also, if anyone has any specific questions or areas they want advice on weighting just post in this thread and I'll do my best to help (as will other I assume)

Share this post


Link to post
Share on other sites

A BIG "Thank You" STALKERGB, for this Perfect overview !

Edited by SyNcRoNiCzZ

Share this post


Link to post
Share on other sites

Thanks for taking the time to put this together. Very handy and much appreciated.

Share this post


Link to post
Share on other sites

This guide is just unbelievably helpful and well written! This is just what we need to fix the last oddities with our soldier. Many thanks to you STALKERGB!

One question though, is there possibly a way to avoid brushing all verticies behind the ones you're trying to select? :p It's really a mess trying to hit the correct ones, and then cleaning up the ones you dont want in your selection. Would be a lot easier if just one surface was affected by it so you could work around the object instead of straight through it.

Share this post


Link to post
Share on other sites

Yeah that can be a pain, the only real solution I can think of is either to use smaller brush sizes so you can be more accurate with the weighting or before you start it might work if you hide the area you don't need weighting (using ctrl + h) and the with a bit of luck when you paint the verts it won't add it to the ones you have hidden. When you are done, you should be able to select all (ctrl + a) and unhide it all (shift + ctrl + h).

Share this post


Link to post
Share on other sites

hi, how do you give a vertex zero weight? i want to disassociate a vertex from one of the named selections.

Share this post


Link to post
Share on other sites

Make sure you are in Vertices mode (V) so you can choose individual points then select the "selection" you want (such as LeftArm etc).

With the selection highlighted on the model hold down ctrl + shift and left-click-drag over the point(s) you want to remove. When you have removed the points, redefine the selection and thats it.

If that doesn't make sense I'll stick up some pictures for you.

Share this post


Link to post
Share on other sites

when you say "BLUE heavily affects them" do you mean that something that floats in the air, like my goggles, will be lowered down? or is it not that obvious? lol

Share this post


Link to post
Share on other sites

Is that a serious question?

The vertices are weighed to the skeleton. If your goggles are weighed to the head, having them blue will mean they don't move as tightly with the head skeleton as having them red.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×