Jeremy Birn |
Contrary to popular belief, most common expressions contain little or no math. A lot
of them just say one fcurve or parameter to equal another, and work like a kind of
constraint. So here's "a very simple tutorial:"
- Get a primitive sphere and a primitive cube, then select the sphere, and
Expressions>Edit.
- For the Sphere's fcurve, choose .etrnx (you don't have to remember how to spell .etrnx,
you can click the fcurve button and choose it "multiple choice" from the list.)
- For the expression, choose the sphere (you can use the object selector if you forget the
sphere's name), and then choose .etrnx as the f-curve.
Click OK, and this constrains the position of the sphere in x to the position of the cube
in x.
If you want an expression to control an object's shape, it's just about as simple:
- Get a null, and in Info>Selection, name it "Smile" (or call it something
else).
- Load or set-up a shape-animated object. Set its shape interp mode to shape weights.
- With the shape-animated object selected, choose Expressions>Edit, and specify .wshp2
(Shape Weight 2) as the f-curve.
- For the expression, choose the null (named Smile) and the f-curve .etrnx (so it just
says Smile.etrnx as the expression.)
Click OK, and that's all you need to make a null into a slider control a shape. As you
move the null along x, the weighting of shape 2 increases.
Of course, changing the expression to Smile.etrnx/10 would let you move the Smile
slider over a range of 10 units instead of 1. And if you have several null sliders with
different names, you could click "Next" a few times and add similar expressions
to link the other shape weights to the other nulls. |