CGTalk > Software > Autodesk Maya > Maya Character Setup
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-21-2013, 02:32 AM   #1
TheN8man
Analytical Perfectionist
 
TheN8man's Avatar
portfolio
Nathan Chisholm
New Zealand
 
Join Date: Aug 2010
Posts: 9
IK Forearm Twist driver for rotations past +-720 degrees?

Situation:
A semi-cartoony arm, with an IK/FK setup; using separate chains for the FK, IK and bind (including around 7 forearm twist) joints.

Challenge / Problem:
I am looking for a way to enable the wrist to be twisted an indefinite (but for this post, +- 720 degrees) amount and still have the twist joints distribute the total rotation relative to the elbow; without the twist joints flipping back to the shortest distance when the rotation passes +-360degrees.
How the twist is actually implemented is not the question.
The issue is how to reliably calculate the total rotation of the wrist, around the axis/joint which would point along the length of the forearm ('twist axis').


Current Unsatisfactory Solutions:
1. Use a direct connection from the wrist control
- Pros: No flipping of values;
- Cons: This fails when gimball lock etc. results in either: the rotation that was connected not rotating the hand around the twist axis; or a different axis rotating the hand around the twist axis.

2. Use an expression, to calculate the rotation difference (of the IK wrist joint in the twist axis) since the last evaluated frame (ie. `getAttr -t (obj.lastEvaluatedFrameCustomAttr) obj.attribute`), countering any sudden changes (eg. 179degrees straight to -180degrees) by adding or subtracting 360degrees to the rotation difference between the frames, and adding that rotation difference to the value used to drive the twist.
- Pros: When played from start (ie. rendered), or even scrubbed from animation start frame, the arm twist evaluates correctly with no twisting, provided the initial pose is non flipped.
- Cons: The start frame assumes the arm/wrist pose to be at a non-flipped position, or otherwise the initial offset (multiple of 360) must be set manually; The arm twist does not evaluate until keyed; If a frame is jumped to on the timeline, the arm twist may not evaluate correctly. The expression may trigger the 'cycleCheck' warning.

Does anyone know of a more practical method, preferably one that works without requiring keys?


(Method 2. Experimental expression ):
Code:
if ((hand_ctrl.enableNoFlip == 0) || (frame == `playbackOptions -q -ast`)) { hand_ctrl.noFlipArmTwistRotation = wristTwist.rotateX; } else { $frameDif = frame - attrHolderJnt.prevFrame; $rotDif = ((`getAttr wristTwist.rotateX`) - (`getAttr -t (attrHolderJnt.prevFrame) wristTwist.rotateX`)); if ($rotDif > 180) { hand_ctrl.noFlipArmTwistRotation += $rotDif - 360; } else if ($rotDif < -180) { hand_ctrl.noFlipArmTwistRotation += $rotDif + 360; } else if ($frameDif != 0) { hand_ctrl.noFlipArmTwistRotation += $rotDif; } } attrHolderJnt.prevFrame = frame;
__________________
--- The nobleman makes nobleplans and by nobledeeds he stands! ---

Last edited by TheN8man : 02-21-2013 at 04:13 AM. Reason: Added experimental expression code
 
Old 02-21-2013, 06:47 AM   #2
TheN8man
Analytical Perfectionist
 
TheN8man's Avatar
portfolio
Nathan Chisholm
New Zealand
 
Join Date: Aug 2010
Posts: 9
Examples

__________________
--- The nobleman makes nobleplans and by nobledeeds he stands! ---
 
Old 02-21-2013, 06:47 AM   #3
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:31 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.