Finally, everything works.
It gives smooth animation in blend in-blend out situations. Other things are rearranged as well, so that it handles different cases better. I'm going to try to make a demo animation tomorrow, and possibly post a binary as well.
pinBone changes are in place. The original method where the transform was applied at the object level worked, but not in all cases. It broke when used with blendin-blendout, which is a pretty crucial feature. So, I had to apply the transforms within the poses themselves. I have that working, finally.
Now, I have to change the original calculation method a bit. Right now, it's just using the pose from the last frame of the previous NLA strip - fast and easy. I need to make it calculate it based on the actual point of overlap. Not difficult, but I just haven't done it yet.
The feature works, at a basic level. I noticed a couple of unexpected behaviors that I have to track down, but let me tell you it's cool.
I'm not going to make an anim yet, because of the the small glitches, but here's what I did tonight:
1. made a walkcycle action.
2. made an action in which my character jumps from one (imaginary) platform to another, ending the action several units above and to the left of where it started.
3. Added into NLA: jump action, walk action, jump action, using pinBone on the left foot, then the right foot.
4. The resulting animation... oh hell. Here's what happens:
That's right - the positioning of the armature picks up where the last one left off
, at least in reference to the pinned bone. Remember- each action was designed individually, with no regard for armature positioning.
Yes, I know that the walkcycle's crap, and that the hands go weird at the end, but all in all, I'm a happy guy tonight.
pinBone is 75% done! I'm kind of amazed. Maybe I've passed a critical point in understanding the sources. Whatever the case, the bone position calculation is done, and the matrix caching is done. The numbers look good. So it works in theory
All that's left to do is to apply the appropriate transform during bone/armature positioning (probably in the function "do_all_actions"), and we have a powerful new character animation feature.
(I was hooting and hollering when the numbers came up correctly in the console window. My wife thinks I'm a geek.)