Wednesday, 9 November 2016

Update 3: Arms IK/FK toggle


Entry1

Something we've never really gotten around to doing with rigging in our classes is, well, rigging. We've gone as far as to place joints in relation to a mesh, but have done nothing past that. Today I will start by working out how to bind skin, create controllers, and be able to toggle IK/FK.

I found an arm from second year where we had placed the joints inside the mesh and I have added basic nurbs shapes for controllers.



Entry2

I have used parenting and constraints in order to make the hand locator and elbow pole behave as intended. I add a rotate chain solver IK handle connecting the shoulder and wrist. Finally, I have bound the skin using the Geodesic Voxel method, which seems to yield the best and quickest results. For the sake of this exercise, I will not worry about weight painting too much. Seen below, the rig is now behaving as intended


Entry3:

Next up is making the toggle for IK/FK. This will be done with a driven key. I've created another nurbs shape with an boolean attribute. This will drive the toggle between IK/FK, as well as the visibility for the controls. The connections are driven through the connection editor



Entry4:

Since I already have controllers for the IK mode, I need to still create some for the FK. I've often seen orbs made of three rings used in this place, but when grouping nurbs circles in the regular fashion they maintain a hierarchy. Reading through Rigging for Game by Eyal Assaf I have found that Python or MEL can be used to remedy this. The example given used MEL, so that is what I used as well. The jist of it is a line fo code reading:

parent -shape -relative [a list of the names of the shapes you wish to group, seperated with spaces] [the name of the object you wish to add those shapes to];

This results in a complex nurb shape where any part of it can be clicked without worrying about a hierarchy


Entry5:

This part requires me to be able to invert the boolean on the IK toggle, but I at first had no clue how to do this. I found that nodes can be created in the hypergraph, then thought I could use a MultiplyDivide node to multiply by -1 thus inverting it (forgetting thats not how booleans work all at the same time). One of these nodes is a reverse node. This node seems to be able to flip a fed boolean and does what I need. Connections are driven through the connection editor.

I had to restructure the parenting and constraints of many of the components involved, but the end result is as desired and allows the use to toggle between IK and FK, and remembers the last posion of both.

IK and controllers, working as intended

FK and controllers, with only one small hiccup

The only issue with this setup is that, when switching from IK to FK, the FK wrist orientation remains the same as it was when it was IK


Overall this seems to be a success, though I know there are other ways to get this working, one of which includes using multiple sets of joints for each type of control method.



No comments:

Post a Comment