DESCRIPTION:
This script lets you switch and match Poses between IK/FK controls in the animation scene.
Works for Riggs that don't have IK/FK match built in and requires only Standard FK controls and IK Pole Vector Setup. The Controls are defined once and can be stored in Node for easy reuse throughout the animation.
INSTALLATION:
a) Copy the file (mog_ikFkSwitchPro.py) to your Maya scripts directory. On Windows that is Documents/maya/20xx/scripts/
b) Open Maya. In the Script Editor (Python), past the following code:
c) Hit execute (or Ctrl Enter)
USAGE:
>>>>>>>>>>>>>>> SETUP STORE NODE FOR LIMB MATCHING <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1. Define Limb to work on
This always needs to be defined bofore loading/storing/switching
Sides are treated seperately.
2. Define Ctrls necessary by selecting them and hit the << button
<< FK1: Upper arm
<< FK2: Lower arm
<< FK3: Hand
<< IK Ctrl: IK Hand
<< IK Pole:
<< Switch Ctrl: The ctrl that is used to switch between ik and fk mode
<< Switch Attr: The attribute that is dialed to switch.
It can be highlighted in the channel box and hit <<
3. Define Behavior
>> Knee Bend: Primary bend axis for the knee/ellbow. Bend the knee/ellbow 90 degree. What axis does it bend?
Knee Bend values for common rigs:
Malcolm(c Animschool): : +X Armx, -X Legs
Steward(c Animation Mentor): -Y Arms, +Z Legs
Jack(c Animsquad): -Y Arms, +X Legs
Norman: +Z Arms/Legs
>> Rotation Offset:
Some Riggs have different orientations in their IK and FK ctrls and joints.
This becomes obvious when running 'Match' from fk to ik and seeing a 90 degree offset in the wrist
Set the offset with that value and run 'Match' again to align them
Rotation Offsets for common rigs (X,Y,Z):
Malcolm(c Animschool): : (0, 0, 180) Right Arm/Leg, (0, 180, 0) Left Arm/Leg
Steward(c Animation Mentor): (180, 0, 0) Right Arm, (-20,-90, 0) Right Leg, (160,-90, 0) Left Leg
Jack(c Animsquad): (-180, 0, 0) Right Side
Norman: (0, -90, -90) Right Arm, (0, 90, -90) Left Arm, (-90,-90,0) Right Leg, (90,-90,0) Left Leg,
>>>>>>>>>>>>>>>>>>> UPDATE A EXISTING STORE NODE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1. Load: Selected a Ctl in viewport, if a Setup Node exists in the Scene, load it into the Setup fields in the UI\
2. Make modifications
3. Save/Update and confirm to overwrite existing Store node
>>>>>>>>>>>>>>>>>>>>>>>>>>> SWITCH / MATCH <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1. Select a Ctrl in the viewport and click "Load Store Node from Selections".
When a Setup Node exists a green bar will light up
2. Match IK >> FK or FK >> IK to match the limb between the modes
>>>>>>>>>>>>>>>>>>>>>>>>>>> ADDITONAL BUTTONS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Switch IK/FK: Simple switches between IK/FK modes (does not do any matching)
Select all IK or FK ctrls: Select all nodes for this mode as stored in the Seup node
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PRO BUTTONS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Key all IK/FK: Creates a keyframe for all IK/FK Ctrls on current frame
Bake IK/FK: Bakes the entire frame range to ik or fk. Leaves source keys clean
Bake IK/FK AllKeys: Bakes all keyframes in frame range to ik or fk.
Export Store Nodes: Save all store nodes into .ma/.mb Store File saved in the same location as the scene.
The file name is the same as the scene + _IKFKSTORE and located in the same folder as the file
Already existing store nodes in the scene will be overwritten
Import Store Nodes: Opens file dialogue to select the previously exported Store File
LIMITATIONS:
- Pole Vector Control is required and will not run if controlled with attribute
- Works only on Referenced Riggs
Future Improvements/Optimzations planned:
- Make script work/not error if there is no polevector
// Questions/comments/bugs/issues to
// monikagelbmannATgmailDOTcom