Aller au contenu

Photo

Gmax - Weighting/Rigging a body mesh


  • Veuillez vous connecter pour répondre
48 réponses à ce sujet

#1
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

Hello all,

again I hope, that someone is able to point me into the right direction.

 

I have successfully rigged a NWN2 head model before in Gmax (and wrote a little tutorial on that to be found on both vaults). So, rigging in Gmax seems to be possible.

 

Now I started a project, where I want to re-weight a body. Since Gmax does not import the weighting / looses the weighting on import, meshes have to be weighted again.

 

I managed to figure out, which bones are needed to weight a body mesh (with the help of Blender). But I get strange results - some verts create a texture, which drops all the way to the bottom center.

 

This example: 1 Bone: Ribcage, 3 Verts (100% weight = red)
 

flaw_010.jpg

 

Testwise added a second bone (FHip1) and weighted the same verts, so they share weight. Still the same result!.

 

 

Here another test:

 

flaw_011.jpg

-> Forgot to add here, that the belly is starting to stick out...

 

 

This also happens, when I rigg the whole body mesh with all bones needed!

 

I just can't nail down, what causes this!



#2
4760

4760
  • Members
  • 1 204 messages

If I remember correctly, things like that happened to me when the vertex was not weighted at all, or "forgotten" in the envelope and actually was included in another bone's vertices.



#3
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

Thanks - that was one kick into the right direction: I added the first bone (Ribcage) and the mesh turned blue. Then I weighted those 3 verts. I thought, by adding a bone (getting the blue weight feedback) it was weighted to the whole mesh and so every vert got a weight. That is not the case. So I had only those 3 weighted and the others were not.

 

When I first fully weight all the verts to the first bone (Ribcage) and then reduce the weight again to "blue", all verts have a weight and the whole mesh shows up (no dropping ones).

 

But would I do it that way: Weight all the verts to one bone first, so all verts have a weight and later, when adding other bones, overwrite this weight with the bone for that region? In my example this would mean, that the toe region still has a weight of the Ribcage bone...

 

So this is a question to all the Max rigger:

What is you way to rig a body from scratch?

Is there a special order to rig a body according of the hierachy of the skeleton, eg. Bhip1->FHip1->LHip1->LLeg1...(leg bones) -> RLeg1 ...?

Does P_HHM_skel itself need to be added as a bone, eg. as the first bone to be the base bone?

 

Since I don't have Max, I can't check this out.



#4
Tchos

Tchos
  • Members
  • 5 042 messages

Does this all mean that I could in theory learn to rig a creature model to an existing NWN2 skeleton in Gmax?


  • Rolo Kipp aime ceci

#5
Happycrow

Happycrow
  • Members
  • 612 messages

That question had crossed my mind as well...



#6
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages
<shopping for...>

Does this all mean that I could in theory learn to rig a creature model to an existing NWN2 skeleton in Gmax?

As I understand it, *if* we could get some skeleton analogs (a set of bones arranged exactly like and named exactly like the GR2 skels), then, yes.

At least in NWMax, and I'm hoping Tazpns, the skin mesh is weighted by bone name. This means we *should* be able to weight it properly... though we still couldn't create new aims or skels :-(

We just need some kind Expotron to put up some skeleton analogs to weight to :-) A pretty exciting idea, to me :-)

<...crash dummies>

#7
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

It is possible to load an existing model and the skeleton into Gmax (via Tazpn's importer/exporter). Since Gmax looses the weightmap, it has to be rigged again. So it should be possible to create a totally new mesh and rig it to an exsisting skeleton.

 

What you don't get, when importing (or exporting) is an option window, which you seem to get in Max when using Expotron or Tazpan's tool.

 

Thus, the creature mesh is not scaled up. And even though, the skeleton is loaded into Gmax and the bones are present (Select Objects list), it is not visualized.

 

Meanwhile I found, that you can uniform scale the creature mesh (up 10.000) and then you see the envelopes of the bones at the right position (not sure, if they point into the correct directions though).

 

nwn2_m10.jpg

 

You can do the scaling up and scaling down right before the export (WITHOUT doing a ResetXForm - seems to work) after you did the rigging, but its doesn't seem make any difference. Since I (until now) painted the weights instead of using the envelopes, I (until now), did it without the scaling.

 

The problem is to get a rigging reference without having Max. I use Blender to view the weighting, but no Blender version (2.46, 2.59, 2.69) exported any of the rigged test meshes (skin flagged) correctly. And the naming of the bones differ. Plus Blender seems to group certain bones (eg. the FHip+BHip+...=Pelvis).

 

I have written down all the main bones in Blender and aligned them to the (G)Max names. Will puplish that, as soon as I figured out this body rigging thing.

 

 

So, my call to the Max user out there again:

- What is you way to rig a body from scratch?

- Would I weight all the verts to one bone first, so all verts have a weight and later, when adding other bones, overwrite this weight with the bone for that region? In my example this would mean, that the toe region still has a weight of the Ribcage bone...

- Is there a special order to rig a body according of the hierachy of the skeleton, eg. Bhip1->FHip1->LHip1->LLeg1...(leg bones) -> RLeg1 ...?

 

nwn2_s10.jpg

 

- Does P_HHM_skel itself need to be added as a bone, eg. as the first bone to be the base bone?

- I have not really worked with envelopes, so are the positions of those envelopes shown in the first picture ok? Can they stay that way, if you use "Paint Weights" (instead of tweaking the envelopes)?

 

AND: Is there a tool out there, which enables you to do a quick check of the weighting. ATM I use the toolset, but you always have to close it down and reload it to show changes to a model. That's a slow business...



#8
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

Ignore! Double post - Sorry!



#9
4760

4760
  • Members
  • 1 204 messages

- What is you way to rig a body from scratch?

 

I found that adding a bone after the skinning was done created more problems than deleting the skin modifier, creating a new one and adding all the bones again.

So, basically: place all the bones you would need inside the mesh (don't forget to freeze the rotations when you're done), and then add everything to the skin. Most of the weighting will be done (not correctly, but not too far).


  • Rolo Kipp et TheOneBlackRider aiment ceci

#10
-Semper-

-Semper-
  • Members
  • 2 256 messages
So, my call to the Max user out there again:

- What is you way to rig a body from scratch?

- Would I weight all the verts to one bone first, so all verts have a weight and later, when adding other bones, overwrite this weight with the bone for that region? In my example this would mean, that the toe region still has a weight of the Ribcage bone...

- Is there a special order to rig a body according of the hierachy of the skeleton, eg. Bhip1->FHip1->LHip1->LLeg1...(leg bones) -> RLeg1 ...?

- Does P_HHM_skel itself need to be added as a bone, eg. as the first bone to be the base bone?

- I have not really worked with envelopes, so are the positions of those envelopes shown in the first picture ok? Can they stay that way, if you use "Paint Weights" (instead of tweaking the envelopes)?

 

AND: Is there a tool out there, which enables you to do a quick check of the weighting. ATM I use the toolset, but you always have to close it down and reload it to show changes to a model. That's a slow business...

 

- first adding the skin modifier and changing the bone affect limit to 3 before clicking "edit envelopes", second adding all the bones and editing the envelopes as good as possible (the better the work within this step the least fine tuning has to be done later!), third would be some rudimentary animated limb movement to check the stretching, fourth and last is manually blending between the bone weights to remove bad weighting

- you could weight all the vertices to one bone initially but editing the envelopes is way more efficient; zero weights should be removed

- there's no special order; every vertex is influenced by 1 to 3 bones

- the base or root bone has to be added too, basically it's the pelvis and therefore crucial

- the position of envelopes control the weighting and can be changed fast and easy; if you don't want to work with envelopes you can manually paint the weights or add values with the weight tool; you don't have to use them

- weight checks are done within the program you are using; just animate the limb and check the stretching


  • TheOneBlackRider et 4760 aiment ceci

#11
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

Off Topic: Semper! :D Greetings from the north!

 

On Topic: And thanks! Another step taken! "root bone [P_HHM_skel] has to be added too, basically it's the pelvis and therefore crucial": CHECK.

 

But here comes another question:

While roaming the internet for weighted NWN2 bodies, I stumbled upon a screen from a Max scene, where there were also ap_bones (attachment points) included within the weighting. Actually the FHip1 weighted the upper pelvis region (around the belly button), the ap_pelvis the lower (genital) area. (Stupid as I am, I didn't safe the screen and I can't find it anymore... :whistle: ).
Intresting enough, Blender does give you only one pelvis bone too weight all around the waist (well, the imported skeleton/armature has Hip_front, Hip_back_Hip.r and Hip.l, but these are not choosable to weight).
And Blender doesn't offer any ap_bones at all to weight.

 

So, question is: Are ap_bones needed to weight a body or would it be enough, if eg. FHip1 covers the area of FHip1 + ap_pelvis?

 

If the body is supposed to wear a shiel, the ap_shield_left/right would have to be weighted, too, right?



#12
-Semper-

-Semper-
  • Members
  • 2 256 messages

hi there, long time no read ;)

 

attachment points are never weighted because they don't deform the base mesh. those are just secondary bones where vfx effects and armor pieces are attached so that they move in conjunction with the base mesh. those seconday bones are linked to a parent bone. same with fhip1, bhip1, lhip1 and rhip1. those are also attachment points for armor pieces and child bones of the root - i dunno if they are even used by the engine. the root bone (named like the base skeleton file) is the only pelvis area vertices are weighted to.

 

basically it's down to this: the skin modifier contains only bones which deform the actually used base mesh. everything else is linked to such a bone and controlled through the hierarchy.


  • TheOneBlackRider aime ceci

#13
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages

<looking...>

 

...

 

nwn2_m10.jpg

 

...

- I have not really worked with envelopes, so are the positions of those envelopes shown in the first picture ok? Can they stay that way, if you use "Paint Weights" (instead of tweaking the envelopes)?

 

AND: Is there a tool out there, which enables you to do a quick check of the weighting. ATM I use the toolset, but you always have to close it down and reload it to show changes to a model. That's a slow business...

Each of those bones look rotated 90 degrees to me... they should follow the structure of the model and be linked end to end. Or is that side handle the envelope widget in GMax? It bothers me you can't see the linkages...

 

In Max (sorry) there is both a weight table for manually editing each bone weight on each vertex, and a graphic tool that colors the mesh by weight. When I get a chance, I'll see what the equivalent is in GMax.

 

I generally use the methods -Semper- outlined, with the exception that in NwN1 the verts have a 4 bone limit, not 3. But definitely rig your bones and envelopes the best you can before adding them all at once to the skin modifier. Let (G)Max do the initial weighting based on the envelopes.

 

<...sidelong>



#14
-Semper-

-Semper-
  • Members
  • 2 256 messages

I generally use the methods -Semper- outlined, with the exception that in NwN1 the verts have a 4 bone limit, not 3. But definitely rig your bones and envelopes the best you can before adding them all at once to the skin modifier. Let (G)Max do the initial weighting based on the envelopes.

 

on a side note: i've read that nwn2 also uses a max bone limit of 4 per vertex, but as far as i've checked i only ran into 3 weighted bones.

those grey bars should be the envelope handles and not the bones. they're totally screwed after importing and need fixing if you want to use them in conjunction with a custom mesh.



#15
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages

<lurking like a...>

 

(Edit: Click for video of the model in action)

GMax-NWmaxBones_001.png

This is what a skin-mesh model looks like in GMax. Note the color coded shading on the skin? And how the bones are linked?

Edit: I can't find a weight table, and a weight table is.. pretty crucial, IMO ;-P

Also, in this pic, I have the mesh (used for shadow-casting) on the bones hidden.

 

<...g-man>


  • TheOneBlackRider aime ceci

#16
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

@ Semper:

Yes, I'm dancing on more than one wedding. :)

Last few month it has been the NWN1 Dragonlance project, I'm heavily involved in. The NWN2 Dragonlance project was resting a bit due to RL things of the team. Before that, it was mainly NWN2 placeables, which work quiet well in Gmax. But things are moving again and this gives me the motivation to get THIS going in Gmax, so we can get the Draconians a working disguise!  :D

 

Back to the topic:

I had the feeling, that I'm getting closer, but now, I'm not sure again, if I fully understand: So, only root(?) bones need to be weighted. But what are the root(?) bones? Shurely p_hhm_skel for the pelvis. The others? - Which are the "bones which deform the actually used base mesh"?

 

Below is the list of the bones shown by Blender. The according ones in Gmax would be L(+R)LegAnkle, LArm010, LArm011, LArm02,  Head (=B45), LArmCollarBone, (h=handbones), LLeg1, LLeg2, LLegAnkle, LLegAnkleDigit011, aso.

 

blende10.jpg

If so, that would be the reason, why Blender wouldn't display the at_bones. And the blender "pelvis" is p_hhm_skel. So I would not have to weight BHip1, FHip1, aso., because they are linked to p_hhm_skel = pelvis, right?

 

If my model had a hand, would I still need to add and weight LArmOPalmDigit011+012 (=Thumb), etc.? I guess so, because these are also weighted in Blender.

 

And if these are the needed bones to be weighted, do I still have to "Add Bone" all the other bones, which don't need to be weighted (BHip1, FHip1, ap_pelvis, ...)? Quote Semper: "the skin modifier contains only bones which deform the actually used base mesh", so the answer would be "no"?

 

@Rolo: As far as I see, there is no weight table in Gmax.

 

Thanks for all you help, people!



#17
-Semper-

-Semper-
  • Members
  • 2 256 messages
So, only root(?) bones need to be weighted. But what are the root(?) bones? Shurely p_hhm_skel for the pelvis. The others? - Which are the "bones which deform the actually used base mesh"? If my model had a hand, would I still need to add and weight LArmOPalmDigit011+012 (=Thumb), etc.? I guess so, because these are also weighted in Blender.

 

And if these are the needed bones to be weighted, do I still have to "Add Bone" all the other bones, which don't need to be weighted (BHip1, FHip1, ap_pelvis, ...)? Quote Semper: "the skin modifier contains only bones which deform the actually used base mesh", so the answer would be "no"?

 

there's only one root and that's the pelvis - this is where the bone hierarchy starts. beside those 4 hip bones and all the attachment points the f_bones are only needed (and animated) in cinematics. this means that you only need them if you're creating heads for close ups. every other bone that drives the mesh can be added to the skin modifier. can't you simply check by importing a mesh with the skeleton to gmax? the skin modifier should be applied already and every added bone is weighted too. if your model has hands then you have to weight the digit bones if you want animated fingers.

 

yes, the answer is no. the skin modifier contains only weighted bones!


  • TheOneBlackRider aime ceci

#18
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

Thanks, Semper. Now, that this is (hopefully) sorted (for me), I'll do another rigging try and will report.

If all works well, I'll sum this up in a little Gmax tutorial.

 

 can't you simply check by importing a mesh with the skeleton to gmax? the skin modifier should be applied already and every added bone is weighted too.

 

No, I can't, well, Gmax can't. The import seems to be working only half way for Gmax. You don't get an option window on in- or export (like you get with Expotron/Tazpn+Max/Blender).The meshes (and texture mapping) are imported. The skeleton is not imported and the skin modifier gets lost, with this all the weighting. You have to do an extra import for the skeleton. This is, why I was lacking a reference to work of (as with the mino-heads you talked me through back then), also because Blender gave me a bone list, which didn't match the info Gmax was showing with the imported skeleton. This is, why I have to reweight the whole body mesh to make it work.

 

EDIT May 26th: Gmax can import a skeleton/bones, collision spheres and the skin modifier (though the weighting is a mess and needs to b redone)! I finally found the reason for "my" Gmax importing the mesh only. Will post that into another topic soon! (End of edit.)

 

So, Blender seemed to be an option, but exporting a skin flagged mesh failed on all tested versions (2.46, 2.59, 2.69 with the according import/export scripts). Blender seems to be working for eg. placeables, but not for (all kind of) skined meshes, it seems. Since Gmax does working exports, if reweighted, I go fo Gmax (and I know Gmax better than Blender... ;).

 

Will report, when I have a result.



#19
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages
<naming names... >

It's all about the names and the hierarchy.
The names have to be identical to the names you see in the skeleton.
If blender is renaming the bones, you'll have to rename them back :-\
You *do* have to weight BHip1 and FHip1 and every other gr2 bone.

<... And kicking assets>

#20
-Semper-

-Semper-
  • Members
  • 2 256 messages

You *do* have to weight BHip1 and FHip1 and every other gr2 bone.

 

could you elaborate on that? why should vertices be weighted to that bones? they are not needed for the animations and only there so that the engine knows where to put vfx and armor parts. they are driven through hierarchy alone.



#21
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages

<shooting...>

 

Without seeing the mapping itself (how it looks in Expotron/Max), I have to guess what is a bone or not by the naming conventions and the place in the hierarchy.

 

If they are not weighted in an existing model that uses that skel, then no, you don't need to weight them. But they are not AP_ or F_ nodes (not attachment points or face bones), so I am quite leery of this

...but no Blender version (2.46, 2.59, 2.69) exported any of the rigged test meshes (skin flagged) correctly. And the naming of the bones differ. Plus Blender seems to group certain bones (eg. the FHip+BHip+...=Pelvis).

If there is any difference between the skel names/hierarchy and the skin modifier's bones they will not be loaded.

 

 

<...in the dark>



#22
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

I was a bit confused by Rolo's reply: "You *do* have to weight BHip1 and FHip1 and every other gr2 bone", but did, to see, if they need to be weighted, a weighting with just P_HHM_skel as a pelivs bone (weighting it all around the waist), no BHip1, FHip1, LHip1, RHip1 and then the other body bones, like Spine, Ribcage, Arm, Leg and it seems to be working just fine. The animation look good. The toon can equip a shield and a weapon and the animation with them look good, too.

So we're getting to it! Thanks!

 

I do have an issue in the belly region, though and I've not figured out yet, what causes this:

nwn2_r10.jpg

Maybe I need to shift the weight mapping of the pelvis (p_hhm_skel) and Ribcage a bit. Will test, but if you know the solution already, please post.

 

This is not a Blender topic, but since Rolo wrote this:

Quote

...but no Blender version (2.46, 2.59, 2.69) exported any of the rigged test meshes (skin flagged) correctly. And the naming of the bones differ. Plus Blender seems to group certain bones (eg. the FHip+BHip+...=Pelvis).

"If there is any difference between the skel names/hierarchy and the skin modifier's bones they will not be loaded."

 

With the import/export scripts for Blender 4.x comes a body tutorial by Jester and she/he seems to have done it with 4.46. This Blender version (and 2.5x with the according 2.5x scripts) does import the bones and shows the skeleton with the naming posted a few post back. Jester was able to do an export with the body mesh of the tutorial, so it seems, that Blender just uses visually a different naming, but internaly applies the correct naming (as to be seen withing [G]Max).

 

ATM the skeleton import for Blender 2.69 seems to be broken (http://neverwinterva...rtexport-plugin - vers. 2.6.2.3.1), but RJShae is trying to look into it

 

Edit: It's not broken! I was missing the armature in the plugin folder...

But still: When imported/exported there seems to be an issue with some faces. RJShae is looking into it!

Check here: http://neverwinterva...t-plugin-update


  • Rolo Kipp aime ceci

#23
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

OK, got the belly straight! Had to weight the waist (p_hhm_skel) a bit more up and make it share weights with the Ribcage plus weighting the ribcage a bit more into the waist region.

 

But it's my hand to choose something with more obstacles: The robe part behind the legs - when walking/running, the leg moves through the rob and is to be seen from behind. This doesn't happen with the original model. I tried a few weighting settings. The best result (but not perfect) is, if RLeg2 and LLeg2 only share a small part of the middle of the robe, but still you can see a leg, when the leg comes into the back position during a walk. I enlarged the shared region, but then it got worse. If I don't let them share verts, I get a gap in the robe... :angry:

Hah! Why didn't I choose a model with just 2 legs? :rolleyes: (Remark: I do want this back robe, so I need to get it working. :D )

 

Another thing I noticed, which doesn't really belong to this rigging post, is, that my model lost all the shinyness of the metallic parts: The original model (p_hhm_cl_body25) has a shiny belt and some shiny deco lines -> see last post with the belly-shape pic. I tried to set flags like "Transparency Mask" Or "Environment Map", but that didn't do the job. ATM, I use the original textures, so no changes there. Probably another Gmax import info getting lost...



#24
-Semper-

-Semper-
  • Members
  • 2 256 messages

guess you lost the material settings. check them before exporting and everything should work. for reference just read through point 3 of the placeables.doc from obsidian, especially the specular level and glosiness. for p_hhm_cl_body25 they should be at 115  and 15.


  • TheOneBlackRider aime ceci

#25
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

guess you lost the material settings. check them before exporting and everything should work. for reference just read through point 3 of the placeables.doc from obsidian, especially the specular level and glosiness. for p_hhm_cl_body25 they should be at 115  and 15.

Strike! Specular value as not been imported. The rest seems to be ok. Shinyness is back. Thanks!

 

Now, it's only the back robe with the leg going through while walking. ATM I lack the knowledge of giving a prognosis on the outcome of my weightings. So it's "try and error" until I find a working weighting. Maybe less weight on the back/robe and full weight on the shin front?

Maybe somebody finds the time and is able to read a clou out of a max file (p_hhm_cl_body25)... *winks*