Here's a look at the finger script which is probably easier since you have seen the result already
notice I've added comments
;like this after the semicolons, this is not allowed in a real TSM2 script.
open the "advfinger.mdl" from the Components folder of TSM2 in A:M and follow along as the script refers to the various bones. Be careful not to resave it. It needs to remain in V11 format.
CODE
hide "advfinger"
hide "advfinger2"
hide "advfinger3"
hide "advfinger4"
those were the "metatarsal", first bone, second bone and third bone inthe finger respectively
"hide" made all those geometry bones invisible
Next, we make our first new control bone, name it and position it
CODE
create a bone called "finger control1" ; this makes a named bone, TSM will add numbers and "left" or "right" as it repeats this script for separate fingers
with parent the parent of "advfinger" ;this gets the new bone a place in the heirearchy as a child of "hand", which is the parent of the parent of "advfinger"
with start point of "advfinger2";
with end point of "advfinger2"; the bone has the same start and end points as "advfinger2"
with roll of "advfinger2"; and the same roll
basically same drill for the next two control bones :
CODE
create a bone called "finger control2"
with parent "finger control1"; notice that it is child of bone just created
with start point of "advfinger3"
with end point of "advfinger3"
with roll of "advfinger3"
create a bone called "finger control3"
with parent "finger control2"
with start point of "advfinger4"
with end point of "advfinger4"
with roll of "advfinger4"
Now we can start adding fan bones:
CODE
create a bone called "advfinger1fanA"
with parent "advfinger"; it is a child of that metatarsal bone
with start point the end of "advfinger" ; it begins at the tip of that bone
with the rotation of "advfinger" ; it points in the same direction as "advfinger"
with the length of 3; why 3? just a guess, may not be conveniently sized, but doesn't really matter, the bone will be hidden
that was one fan bone.
we make two more starting from the same point, but shorter and shorter so all three aren't exactly superimposed:
CODE
create a bone called "advfinger1fanB"
with parent "advfinger"
with start point the end of "advfinger"
with the rotation of "advfinger"
with the length of 2
hidden ; this hides the bone, I'm not sure why I didn't do that on the first one
create a bone called "advfinger1fanC"
with parent "advfinger"
with start point the end of "advfinger"
with the rotation of "advfinger"
with the length of 1
hidden
this next section creates similar fan bones on the end of the first finger bone and the second finger bone:
CODE
create a bone called "advfinger2fanA"
with parent "advfinger2"
with start point the end of "advfinger2"
with the rotation of "advfinger2"
with the length of 3
create a bone called "advfinger2fanB"
with parent "advfinger2"
with start point the end of "advfinger2"
with the rotation of "advfinger2"
with the length of 2
hidden
create a bone called "advfinger2fanC"
with parent "advfinger2"
with start point the end of "advfinger2"
with the rotation of "advfinger2"
with the length of 1
hidden
create a bone called "advfinger3fanA"
with parent "advfinger3"
with start point the end of "advfinger3"
with the rotation of "advfinger3"
with the length of 3
create a bone called "advfinger3fanB"
with parent "advfinger3"
with start point the end of "advfinger3"
with the rotation of "advfinger3"
with the length of 2
hidden
create a bone called "advfinger3fanC"
with parent "advfinger3"
with start point the end of "advfinger3"
with the rotation of "advfinger3"
with the length of 1
hidden
OK, we're done making bones. On to the constraints...
CODE
in on/off pose unprefixed "TSM constraints" ; creates the entry you see in pose window. "unprefixed" means there wont' be a "right" and "left" version of this.
orient like constrain "advfinger2" to "finger control1"
orient like constrain "advfinger3" to "finger control2"
orient like constrain "advfinger4" to "finger control3"; those three lines made the geometry bones follow the visible control bones
aim at constrain "advfinger" to "finger control1"; the metatarsal bone isn't directly controlled, it points to the first finger bone and is moved by translating the base of the first finger bone
This section was a bit different from the original TSM2. I abandoned the scheme where the last two bones of the finger are controlled by one bone. Each one has a dedicated control bone now.
I could have put the fan constraints in TSM2 but decided to keep them separate
CODE
in on/off pose unprefixed "finger fans"
compensated orient like constrain "advfinger1fanA" to "advfinger2" ;"compensated" means "use offsets"
at enforcement 70% ; if I didn't use this line the enforcement would be 100%
compensated orient like constrain "advfinger1fanB" to "advfinger1fanA"
at enforcement 60%
compensated orient like constrain "advfinger1fanC" to "advfinger1fanB"
at enforcement 30%
I'm not sure why I didn't just constrain those all to "advfinger2" instead of one fanbone to the next. It would have made more sense.
But anyway, we do the same thing for the other fanbone sets...
CODE
compensated orient like constrain "advfinger2fanA" to "advfinger3"
at enforcement 70%
compensated orient like constrain "advfinger2fanB" to "advfinger2fanA"
at enforcement 60%
compensated orient like constrain "advfinger2fanC" to "advfinger2fanB"
at enforcement 30%
compensated orient like constrain "advfinger3fanA" to "advfinger4"
at enforcement 70%
compensated orient like constrain "advfinger3fanB" to "advfinger3fanA"
at enforcement 60%
compensated orient like constrain "advfinger3fanC" to "advfinger3fanB"
at enforcement 30%
Even though there wasn't any mention of "right" or "left" or specific finger numbers in this script, TSM2 manages the task of adding those on all the different fingers it creates.