Jump to content
Hash, Inc. Forums

Constraint enforcements... D'oh! (now with GIFs!)


Recommended Posts

  • 2 weeks later...
  • Hash Fellow

So...

 

For several weeks in Live Answer Time we've been looking at rigging, using Steve Shelton's dragon as our example case.

StevesDragon.PNG

This dragon has a long tail and I figured it would be better to create a tail rig from scratch than to use a generic solution in TSM2.

 

Part of the structure needs a series of constraints on a chain of bones with the aim of making smooth curves like this, controlled by just one target bone.

Bones90Degrees.PNG

 

Basically there are "Orient Like" constraints with enforcement percentages less than 100% from the base to the tip to create the gradual curve.

You might intuitively think that if you have 10 bones in a chain, you could give each one "Orient Like" with 10% enforcement and that would sum up to 100% of the direction of the target bone by the end of the chain. That doesn't work however...

 

AllSame.gif

 

The problem is that each bone figures out the angle it is trying to cover, not from its default position in the model, but from where its parent bone has currently placed it. You can rotate 10% of the remaining angle an infinite number of times and never complete 100% of the bend.

 

 

Or, you might think, as I did, that you could evenly increase the enforcement percentages along the chain to get the right bend. This gets an approximately right result on very short chains of just four or five bones, but on longer chains a problem becomes obvious.

These bones are "Orient Like" enforced 10%, 20%, 30%... on up to 100% on the last bone.

 

10-20-30-40.gif



Incrementing the enforcement percentage in even amounts puts too much of the bend near the base. By the time it gets to the 50% bone, most of the bend is already done.

We could make these numbers work by re-ordering the hierarchy of the chain so that the bones are all siblings and no longer parents and children. This creates a new problem. The bones rotate but no longer behave like a chain...

 

Siblings.gif

 

 

We could fix that by adding a "Translate To" constraint to each bone to re-attach it to its former parent. This way it inherits the translation of its "parent" but none of the rotation. 10-20-30-40... works now...

 

AttachedSiblings.gif




That's a good result but that's extra work that may not be necessary. Can we get that even bend without having to detach and then "translate to" all the bones?

It turns out there is an easy-to calculate approximation...

If we have a chain of ten bones, we would expect the first bone to do 1/10th of the curve. Give that bone 10% enforcement.

 

Of the nine remaining bones, we would expect the first one to do 1/9th of the remaining curve. That's about 11%

 

Of the eight remaining bones, we would expect the first one to do 1/8th of the remaining curve. That's about 12%

 

Of the seven remaining bones, we would expect the first one to do 1/7th of the remaining curve. That's about 14%

 

See where this is going? The fraction is always 1/x where x is the number of bones remaining.

 

The last bone is the first of one remaining bone. It does 1/1th of the remaining curve or 100% enforcement.

 

fractions.PNG


This formula will work for any number of bones. This series of enforcements gets us a result very close to the all-siblings and "translate to" version above but with less work....

 

 

Fractions.gif

 

 

 

 

It only took me 20 years to figure this out!

  • ____ 1
Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...