The purpose of this post is to share with you how I tackled a problem I've always had building/adding specific components to the rig using my StretchIk class as an example.
As a rigger There is always a chance of either over or under doing a rig..
In my opinion a rigger should build a rig where they can add or remove parts from it on the go.
Production requirements change and also animators minds change :) (Don't we all love that).
It may seem an easy concept,but building a pipeline around this idea is not that easy.
There is lots of code involved and lots of properties to add. But the result is awesome and I would say it is definitely worth. Not only during the build process but afterwards when you need to query info or add extra pieces to your rig.
StretchIK is a class that I wrote with that concept in mind. I wanted to be able to add or remove my stretch setup any time during or after creating my rigs.
As you can see in the video, all what I did is instantiate the class with the ik handle.
From the ik handle I get information about the start joint, end joint and all the joints in between, and that's all I need for creating the stretch setup.
The createStretchMethod, builds the stretch setup and creates a settings group, where I save all the info I need about the stretch components, for example the joints real length and metadata for all the created stretch nodes.
Having all the info I need for debugging the setup on one node made my life much much easier. if anything wrong happens, all I need to do is look at the numbers on the group and see which value doesn't make sense.
You probably noticed that I added the stretchLock with another method. stretch lock is an extended functionality for the stretch Ik. It should be added on top of the stretch setup anytime without having to rebuild the stretch setup from scratch.
The reason why at 0:57 I had to set the hingeJoint is that the class works on multiple joints. It doesn't care how many you joints in the chain all what it cares about is what is considered to be the hinge joint from a user point of view. example below
And in the end of course the ability to delete the setup and reset the joints to their default.
The class it self has a bunch of getters and setter beside the working methods. Here is a screen shot of the class properties that I found very important to have.
I hope you enjoyed the post and found some inspiration writing your own metadata based rigging code.
Cheers.