• Editor
  • Best practices for rigging mesh joints?

  • Modificato
Related Discussions
...

So I just got Spine Pro for myself as an early Christmas present and I'm having fun with all the new features. However, mesh rigging is proving to be just a tad tricky. I've gotten the hang of setting vert weights so that meshes don't horribly distort when I bend them, but I'm having trouble figuring out how to handle joints that need to bend sharply.

Like, a wrist never has to bend more than about 45 degrees; I'm not really having issues with that, but for an elbow or knee, which should be able to bend nearly 180, the part away from the bend tends to distort - it looks like the joint is being stretched flat, when the elbow/knee should still be protruding somewhat.

Any suggestions on how to wrap my head around this?

Welcome to Spine! :happy: And Merry Christmas! :party:

The method Spine uses to bind bones to a mesh is called "linear blend skinning" (though we always call it "weights", reserving "skinning" for Spine's skins functionality to reduce confusion). You may be able to find documentation creating meshes that perform well with linear blend skinning, since it isn't unique to Spine. Linear blend skinning is fast to compute at runtime, but unfortunately is not very good at preserving volume during tight bends. There's only so much you can do with placing vertices in your mesh, if bent enough the mesh probably still collapses at the joint. We are likely to provide alternative (and more expensive to compute) methods sometime in the future.

You can deform the mesh manually to fix a joint that collapses too much when bent too far. A similar (and probably better) option is to add a bone at the joint (eg knee or elbow) and weight the vertices that collapse at the joint to that bone. You can then scale that bone to expand and contract the problematic vertices. You could even try writing code that scales this bone automatically based on the angle of the joint.

Just my two cents...

Cent #1: I usually get good results putting vertices like this...

Two parallel lines of interconnected vertices to maintain line art volume, and a central vertex that matches the tip and origin of the two bones that make the knee joint.

Moreover, if you were to click on the thigh mesh you'll see a similar arrangement of vertices that also have a central vertex at the joint.

Cent #2: I'm using two layers there instead of one for the whole leg. One for the thigh and another for the shin. You lose far less volume that way and can adjust that crease vertices individually so they don't end at the center of the knee.

This is how it looks when the vertices are moved...

Also, ask your artist to draw the lower limb layer (in this case the shin) to cover the whole joint so it looks rounded when it gets bent.

Please, mind that this comes only from my limited experience (five months worth). Others may have another tips to give you, incompatible with my approach. 😉


Edit: I've just realized that I've linked the already bent limb to show you how I rig... and that's not particularly clear, so let me show you the straight setup pose instead:

Later on, when you bend the limb, those vertices at the left get overlapped, but then you're supposed to fine tune weights and only after that moving the vertices themselves at key frames.

Thanks Abelius! Note you can delete the vertices at the corners of your mesh, which will prevent those transparent pixels from being rendered at all. This can help to reduce your fill rate on mobile. Desktops are so powerful it won't matter.

Yes, you enlightened me this day about that, no doubt. 😃

Abelius ha scritto

I usually get good results putting vertices like this...

Wow that's pretty smart! Thanks for sharing!

Erikari ha scritto
Abelius ha scritto

I usually get good results putting vertices like this...

Wow that's pretty smart! Thanks for sharing!

Actually it's not my idea. Got it from a Take10 tutorial. :p

You're welcome in any case!

6 giorni dopo

Thanks for the tips, everyone. I got one other question: what's the best way to make a mesh symmetrical? Like, say I've got a character I need to animate from a front view; how do I make sure the mesh vertices are aligned identically on both sides? There doesn't seem to be a way to punch in specific X/Y coordinates for vertices like there is with bones and images...

Ryusui ha scritto

Thanks for the tips, everyone. I got one other question: what's the best way to make a mesh symmetrical? Like, say I've got a character I need to animate from a front view; how do I make sure the mesh vertices are aligned identically on both sides? There doesn't seem to be a way to punch in specific X/Y coordinates for vertices like there is with bones and images...

That's a very good question. In the editor, no idea, but you could import a dummy version of your image where you placed points and lines already so that at least it would be easier to do the job, and then just save tha image again without the marks.

There really is no easy way to make meshes symmetrical. At least not with 100% accuracy. Erikari's suggestion will work. Not optimal I know.
Do you find yourself in need on symmetrical meshes often?

Well, currently I'm fiddling with trying to animate a character from a front view, but come to think of it, wouldn't it be possible to create, for instance, a mesh for an arm or leg, then duplicate and mirror it?