Tilbage til den forige side

Simple Expression tutorial

 

Question Does anybody out there have a very simple Tutorial for some Expressions. (for expl. Noise, shape).

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:"

  1. Get a primitive sphere and a primitive cube, then select the sphere, and Expressions>Edit.
  2. 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.)
  3. 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:

  1. Get a null, and in Info>Selection, name it "Smile" (or call it something else).
  2. Load or set-up a shape-animated object. Set its shape interp mode to shape weights.
  3. With the shape-animated object selected, choose Expressions>Edit, and specify .wshp2 (Shape Weight 2) as the f-curve.
  4. 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.

Last updated 29-mar-1998