IK FK Match
How To Match Limb Module IK & FK Controls
In order to switch & match IK and FK controls of a limb module, please use the following code snippets. The following code is selection based. Select any control related to the limb module you want to switch and run the method.
- Mode 0: Match IK Controls to the FK controls
- Mode 1: Match FK Controls to the IK controls
#import Mansur-Rig's Block-Utility python module, to access the method
from mansur.block.core import blockUtility as blkUtils
#Mode 0 - Match IK to FK
blkUtils.limbMatchFkIK(pm.ls(sl=True)[0], 0)
#import Mansur-Rig's Block-Utility python module, to access the method
from mansur.block.core import blockUtility as blkUtils
#Mode 1 - Match FK to IK
blkUtils.limbMatchFkIK(pm.ls(sl=True)[0], 1)
Using the code snippet as a picker button
In case you are creating a picker, it is recommended to add FK & IK switch buttons for easy access in animation. The way to do so is simply to insert the above snippets as a "custom script" into a picker button.
- Open Block Builder, and move to "Picker" tab.
- While any control is selected, click "Edit Picker Layout" to open the picker layout editor.
- Click "Create Free PLG" to create a new free picker button, and position it within your picker layout.
- While the new PLG is selected, click "PLG Settings" to open it's attributes.
- In the opened UI, insert any of the above code snippets.
- Optionally add a text in the "button text" line edit to indicate it's behaviour- for example: "To FK" or "To IK".
- Optionally add the Module's UI control into the controls select list.
- Repeat the process for the reverse operation.
- test the buttons by openning the picker, and clicking the button.