[Bf-committers] Proof of Concept Matrix Key patch
rolandh at reed-witting.com
Mon Oct 24 15:26:18 CEST 2005
This little patch is a proof-of-concept for a problem noted when
generating keyframes on objects and bones whose locations or
rotations are changed by constraints like CopyLoc, CopyRot and MinMax
-- discussed in the ToDo tracker here:
When a user attempts to set a keyframe on an object with a
constraint, the key is not generated for the visual (matrix) location
of the object, but at the location where the object would be if it
were not constrained. This can lead to unexpected behaviors. A couple
of solutions were suggested by Ton in the ToDo tracker.
Solution (B), as proposed by Ton, is to have a way for objects (or
bones) under constraint to return their constrained location when the
user requests that a Key be created.
My patch does this, as proof of concept and usefulness, for locations
only (no rotation) and at the object level only (no bones). I'm still
puzzling through the posechannel stuff, which is why this is
The upshot is that when pressing I-key in a 3D window on an object, a
new Keying method is available: Matrix. It sets an IPO location key
for the current visual location of the object, using the object's
matrix (which reflects all transforms, including constraints).
The coding style is cheapo (mostly a full-function C&P), and I don't
think I have the chops to implement this in an elegant way, but I
thought that if someone saw the usefulness of this, some better coder
than myself could put it on their todo list.
The usefulness to animators is this: You can attach a floor
constraint to a foot bone (or leg IK empty), using the Sticky button.
It then becomes very quick and easy to place your feet on the floor,
as they will stick when they hit the floor threshold. To plant a
keyframe, you set a Matrix key. Advance frames, make another Key,
advance, then move the foot off the floor. Repeat. This way, you get
the full speed advantage of the using the constraint to keep things
on the floor, while obtaining the smooth animation capability of
using IPOs. For making a simple walkcycle, you do not gain much, but
when keyframing a walking/staggering/running character for an
irregular animation that goes beyond a walk cycle, this gives you an
immense speedup. In fact, after you've keyed your staggering
character, you can even remove the Floor constraint from the object,
making the constraint, in effect, a keyframing tool.
I've compiled this and played with it for a while. It's a very slick workflow.
This writeup and the patch itself can be found on the Patch tracker:
Roland Hess - harkyman
More information about the Bf-committers