IK-FK MAXScript And Test Scene

Hello, my name’s Harry and I’m currently at Caledonian University in Glasgow, Scotland studying for a masters in 3D animation (my background is in mathematics), I’m really interested in rigging and hope to write my summer project about it.

Anyway, this is the first (proper) script that I’ve written and wanted to get some feedback on it. When you select an object and run the script, an Attribute Holder modifier is placed at the top of the stack and renamed IK-FK Controls, the script works with 3 bone IK and FK systems and provides an interface for things like IK-FK blending aswell as controlling things like the IK swivel angle, IK stretch and Bendy arms - all of which can be done through parameter wiring.

The real reason I wrote this script was to find a way to snap and IK chain to an FK chain not just in position, but also in rotation - which means calculating the swivel angle. I’ve tried to comment the script so that you can see what’s going on.

In the test scene the script has been applied to a helper, I’d normally apply it to a hand bone so that it was easily accessible whether you’re working in IK or FK.

I have a section in the script for bendy arms, I had thought about moving that to another script which might include IK pinning - should I keep it where it is?

NOTE: in the test scene only the IK-FK Blend, Snap To IK, Snap To FK, Snap IK-FK and Snap FK-IK have been set up to use - other options like the IK Stretch work with parameter wiring but haven’t been set up.

Thanks,
-Harry