I usually animate in a straight ahead manner, where I create a pose... keyframe... move forward on the timeline... create the next pose and so on. Since there are no keys ahead of where I am working, the last pose is held when I move forward. I find it easy to do a first pass this way.
But the first pass is rarely final and when changing some animation in the middle of a sequence it is often easier to delete a block of keyframes rather than mess with the existing ones. But now the keyframes that come after the deleted section mean those poses are no longer held when I move forward in time.
djSetKeyframe.mel was written to enable a more "straight ahead" approach when making changes to these middle bits.
Say for example, I delete all the keyframes between frame 100 and 200 so I can redo that section. I would then start by setting a new keyframe at frame 199. Then I goto to the last keyframe before frame 100 and run djSetKeyframe 1 0; which copies that keyframe to frame 199 and sets the inbetween tangents to linear. This creates a "hold" until frame 199.
Now I can work forward as I did in my first pass. Each new keyframe I set using djSetKeyframe 1 0; to simultaneously update the hold frame at 199. Of course, at some point the new animation needs to blend back into the old, so then I just delete the keyframe at 199.
The numbers you see after the command in the above examples, change its behaviour. The first is the "push" flag; set to 0 behaves just like the channel box rmb-menu Key Selected. Set to 1 and it will also copy the new keyframe forward.
The second number is the "unlock tangent weights" flag. (I wish I knew how to make unlocked weighted tangents the default in maya) Set this 2nd number to 0 and you get the usual locked tangent weights, but set it to 1 and the weights will be unlocked as you create new keyframes.
djSetKeyframe.mel was written to be mapped to hot-keys (or marking menus if you prefer). I have djSetKeyframe 0 1; mapped to [s] and djSetKeyframe 1 1; mapped to [S].
NOTES and CREDITS: This script requires the installation of Hamish McKenzies zooToolbox. I have used a proc called zooSetkeyPush which is just one of many useful functions that are part of the marking menu built by zooSetKey.mel.
Download djSetKeyframe.rar from here. (see file header for full usage details)
An afterthought: As I re-read this tonight, I realize that I will probably be asked "Why dont you just use "step" tangents instead ?". The simple answer is... um... that's not the way I prefer to work. I like to be able to scrub through my animation as I am creating it so I can judge the momentum and flow of my action. I know this is a departure from the widely used workflow of blocking out the action using only poses and step tangents on the first pass. (And I was reminded of this recently while reading Cameron Fielding's blog where he links to a nice document by Mike Walling) Getting those key poses down is essential, I agree. I'm impatient though. I want to see it move too. This is what I have become used to.