PDA

View Full Version : Auto-Clavicle approach


Cadedra
03-31-2011, 05:41 PM
Hi guys
As you know, almost any arm movement draws the clavicle as well, moving the shoulder. If you raise your hand up, or put it in the front, or in your back, there is a very good chance that your clavicle will follow. So I want to implement an auto-clavicle effect to function as I move my character arm with IK. But I also want to have the power to tune the clavicle rotation in case that I want to set it manually. So the clavicle must not be completely automatic.
I would like to discuss what would the best approach for that be.

Here is my shot:
-Have the arm bones as an IK chain from the shoulder joint to the hand.
-The clavicle bone parents the arm with FK.
-The rotation controller of the clavicle is a standard bezier or anything I can set keys to, and change manually, as if I were not planning to have an auto-clavicle
-Have a script that changes the orientation of the clavicle according to the hand as I move the hand around. This script must disable that effect if I manually change the clavicle orientation without leaving the current frame, because that would mean that I tuned up my clavicle and want to leave it in that position, no matter if I change the pose of the hand again. If I leave the current frame, the effect should be on again, because I am supposed to work on some other pose...

That's it. I think it is pretty cool :cool:... but maybe some one has a better idea...

Note (I do not want to discuss how a script should be written, but only what it should do, so no code is needed.)

Cadedra
03-31-2011, 09:02 PM
Hmm, I said wrong. The clavicle should follow the arm, not the hand.... as the hand moves around.
(And also, I wonder if I can achieve such script, but it does not matter now)

shinyprem
04-01-2011, 12:54 AM
Hi!
I would suggest having a single chain Ik to your clavicle joint and then aim the IK to your arm.
Rgds,

nuternativ
04-01-2011, 01:10 AM
Hi,

I used to work on that before. Here is my method, no script used.

1.Having arm set up with traditional fk/ik controls. Use parent constraints of the control group to the joint instead of parenting the controls under to the hierachy.

2. Clavicle control is parent constraint to the spline end joint.

3. Pipe the ik control translate to a multiplydivide node, multiply it with some value to get proper value to pipe to the roatation of the clavicle control's group.
4.Do the same with the fk control using another multiplydivide node. (some axis may need to be multiplied with negative value to get proper orientation of the clavicle.)

5. Pipe the 2 multiplydivide to a blendcolor node. Then, connect the blendcolor node 'blender' attribute with your ik/fk switch. ( At this point, you can limit the clavicle movement by using clamp node before connecting the value to the blendcolor node.)

6. Make a switch for it, add attribute to a control called 'autoClavicle' with 0 to 1 value and use it as the multiplier of the value comming from the blendcolor (using another multiplydivide).

7. Connect the value form switch-multiplydivide to the clavicle controls group.

That's it not as fansy as you mentioned, but with the switch you can key frame it on or off whenever you like.

hope this helps, excuse my English.

PEN
04-01-2011, 01:50 AM
I have done it in the past with just a node with a lookAt/aim constraint at the clav looking at the IL wrist control. You can't really look at the arm futherbup as it would cause a dependency loop. Then all you need to do is drive the clav with the rotation of the node that has the look at.

elT
04-01-2011, 02:46 AM
Quick and dirty way: Position constraint between the pelvis and the wrist. Just my two cents.

Cadedra
04-01-2011, 07:50 PM
Hi!
I would suggest having a single chain Ik to your clavicle joint and then aim the IK to your arm.
Rgds,
Yes, I used to do that some times, but I would like to sometimes control just the clavicle.

Hi,
I used to work on that before. Here is my method, no script used.
(...)
hope this helps, excuse my English.
Oh, it looks so cool, but I could not understand it very well... I am a Max user... Is that Maya or something? Anyway, I think I got the general idea. I shall try something similar, just to try.
But note, I strive for the most complete steer simplicity with my rigs (while trying not to loose effectiveness). I would like to achieve an auto-clavicle control on which you do not need any switch, because the rig itself recognizes that you want to set off the auto-Clav effect as you manually operate on the clavicle. It is more straight-forward workflow than having to manually switch.
However, you could adapt the automatic switching for your example just by adding a couple of lines of script, nothing too difficult.
And, thanks... it is a nice idea I am going to study and merge with mine.
I have done it in the past with just a node with a lookAt/aim constraint at the clav looking at the IL wrist control. You can't really look at the arm futherbup as it would cause a dependency loop. Then all you need to do is drive the clav with the rotation of the node that has the look at.


Very right. But well, I did not mean that the clavicle was looking at the arm, but just following. I did not explained properly. What I plan to do is having the orientation of the clav depend on the orientation of the arm: the arm rotates up then the clavicle rotates up, the arm rotates back then the clavicle rotates back... Of course, that might be as well a scripted dependency, as different orientations of the arm drive the clavicle with different amounts. For ex, raising the arm affects the orientation of the clavicle more that putting the arm in the front does. Still I have to deeply think about that.

Quick and dirty way: Position constraint between the pelvis and the wrist. Just my two cents.
What? Oh, I do not get it. In Max the result would be an average position between the pelvis and the wrist... But... What do I do with that?

elT
04-01-2011, 08:32 PM
What? Oh, I do not get it. In Max the result would be an average position between the pelvis and the wrist... But... What do I do with that?

Yes, but...

You can turn on 'Keep Initial Offset', but I stay away from it wherever I can. It actually might work nicely here but I leave that up to you.

Instead, I put another PositionXYZ on top of it, set it to active and position the Clavicle back to it's proper place. Then make a slider for position constraint weight and use it to control the auto clavicle 'effect'.

It's a quick and dirty way to get the auto-clavicle going while still having full control over it. Emphasis on quick and dirty. :)

Cadedra
04-02-2011, 06:52 PM
elT, you always amaze me! Oh, master, can I be your apprentice?:bowdown:
He he, just kidding. But, seriously, your ideas are great!
I like this one a lot. Just one thing: consider the case of a man moving his hand in a way that he only moves the arm from the elbow down. The part of the arm running from the shoulder to the elbow remains still. In that case, the autoclavicle you propose would respond to the hand movement but it would be not natural since the arm is not moving from the elbow up...
So, would it be better to make the pos constraint betwen the hip and the elbow?
I am just asking, I recognize this idea was yours and it is great idea! (yet quick and dirty :))

elT
04-02-2011, 07:30 PM
elT, you always amaze me! Oh, master, can I be your apprentice?:bowdown:
He he, just kidding. But, seriously, your ideas are great!
I like this one a lot. Just one thing: consider the case of a man moving his hand in a way that he only moves the arm from the elbow down. The part of the arm running from the shoulder to the elbow remains still. In that case, the autoclavicle you propose would respond to the hand movement but it would be not natural since the arm is not moving from the elbow up...
So, would it be better to make the pos constraint betwen the hip and the elbow?
I am just asking, I recognize this idea was yours and it is great idea! (yet quick and dirty :))

If you make that slide and wire it to Position constraint controller weight, you can turn of auto-clavicle on on again whenever you like.

This is not my idea. I found it somewhere in the depths of internet, I can't remember who the original author is but it's not me.

An oh, BTW, I'm far too much of an apprentice my self to be anyone's master. ;)

PEN
04-03-2011, 12:32 PM
The constrain method I suggested works very well and I have used it in production many times. Use an Expose Transform helper to get the rotation of the lookAt node but use another point helper align to the lookAt node as the reference object in the EXTM so you get 0 values to start with in the Local Euler Angles. Then you could either wire to the EXTM's local Euler values or use reaction manager so you can control a curve for the rate of change.

Cadedra
04-03-2011, 09:46 PM
Thanks very much PEN...
...and I have to admit (oh, big shame!) that I did not know the expose transform helper. Just met it today, thanks to your comment. And it was like :banghead:
Looks like I have a LOT to learn yet. I do not deserve to be called a rigger :cry:.
But I will study hard!

JHN
04-05-2011, 08:46 AM
Here's my experimental approach, trying to limit the amount of extra nodes.
A script controller on the clavicle y rotation with a custom attribute setup like


clavicleCA = attributes clavicleCA version:1
(

parameters tags --rollout:tagsRollout
(
clavicle type:#maxObject
elbow type:#maxObject
)

fn getDif =
(
try
in coordsys clavicle.node elbow.node.pos
catch
0
)
)

custAttributes.add $.rotation.controller[1][1].controller clavicleCA
clavicleCA = $.rotation.controller[1][1].controller.clavicleCA
clavicleCA.clavicle = nodeTransformMonitor node:$bone01 forwardTransformChangeMsgs:false
clavicleCA.elbow = nodeTransformMonitor node:$bone03 forwardTransformChangeMsgs:false


now the script controller does this

val = (this.clavicleCA.getDif())

if val.z > 0 then
-(degToRad val.z)
else
0


Now if you look at the linked file (max2010 file), you see it works. But there's update issues, i think the CA values has tick offsets, so there's no dependency problem in this setup but at sometimes it looks as if the upperarm "floats" off from the clavicle. This is not something I use in production but I'm tinkering with it, see if it can be production proved.

File: http://public.subd.nl/cgtalk/AutoClavicle_001.max (268k)

Any comments are definitely appreciated!
-Johan

eek
04-05-2011, 02:26 PM
I just got up, so this is as rough as my stubble.. :)



ang = acos (dot ctrl.transform.row3 shoulder.transform.row3)
weight = ((amax 0 (amin ang 90.0))/90.0) - 1.0

case of -- for the shoulder
(
(weight > 0.0): (90.0 * weight)
default: matrix3 1
)


where ctrl is constrained/parented to the shoulder - 'shoulder' would need im guessing to be a pointer to a weak reference.

Cadedra
04-07-2011, 05:34 PM
Good. Great two examples. You two raise the clavicle automatically as the arm raises from 90-horizontal position (adjustable in the case of eek)... if I got you right.
Wouldn't it be nice as well to have the auto-clavicle rotating to the front and to the back as the arm goes too far those ways? Of course, it would take a similar expression, no need to write it down.

These ways, you can have your autoclavicle on/off by adjusting the weight of the controller in a ... list controller? But I propose not to have a switch for this effect. Instead, have it to activate/deactivate automatically.
How? Maybe by having a callback running that set the autoclavicle effect off (0) when you manually adjust the clavicle, because that means you want to use your pose and not the one achieved via the AC effect.... What do you think?

mhdmhd
05-14-2011, 12:49 AM
I am interested in more about that subject, I have been searching for a way that doesn't include Reaction manager.
Could it be two ways ,rotating up and down if the arm is pulled down too much?
eek, could you explain just a little about your technique?

CGTalk Moderation
05-14-2011, 12:49 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.