Expression Components and Instructions
Components
The component portion of an expression is what will be affected. For example,
= 0 [Instructions]
will take the value of the [Instructions] portion, and push it onto the X position of the Expression bone, while;
= 4 [Instructions]
will take the value of the [Instructions] portion, and push it onto the Y rotation of the bone.
| Component | Value |
|---|---|
| 0 | X Position |
| 1 | Y Position |
| 2 | Z Position |
| 3 | X Rotation |
| 4 | Y Rotation |
| 5 | Z Rotation |
| 6 | X Scale |
| 7 | Y Scale |
| 8 | Z Scale |
Instructions
Instructions are the math portion of expressions. The following operations are allowed:
Number
n [value]
The n instruction pushes a number to the stack, for example:
= 6 n 1
sets the X Scale of the bone to 1
Variable
v [variable]
The v instruction gets a variable, then pushes it to the stack. The variable can either be:
[Component].[Bone] (eg, 4.j_kao_wj, 2.kl_mune_b_wj, 6.j_ude_l_wj)
or
the t instruction (time elapsed)
For example:
= 1 v 4.j_kao_wj
This would set the Y position of the bone to the Y rotation of j_kao_wj, or:
= 2 v t
This would set the Z position of the bone to the value of time elapsed
Function
f [function]
The f instruction gets the value on the stack, applies the function, then pushes the value. The function used can be:
| neg | Negate the value |
| sin | Sine function (in degrees) |
| cos | Cosine function (in degrees) |
| tan | Tangent function (in degrees) |
| abs | Absolute Value function |
| sqrt | Square Root |
| av | Multiplies value by 0.1 |
| floor | Outputs the floor (lowest integer) of a value |
| ceil | Outputs the ceiling (highest integer) of a value |
| round | Roundsthe value |
| asin | Inverse Sine function |
| acos | Inverse Cosine function |
| atan | Inverse Tangent function |
| log | Logarithm function |
| exp | Exponentation function |
| rand_0_1 | Unimplemented, makes value 0. (It is meant to randomly generate between 0 and 1) |
For example:
= 0 v 1 f av
would set the X position of the bone to 0.1 (since the 1 is multiplied by 0.1)
Secondary Functions
g [function]
The g instruction gets two values from the stack, applies the function provided, then pushes the result. The function used can be:
| + | Adds the values |
| - | Subtracts X from Y |
| * | Multiplies the values |
| / | Divides X by Y |
| % | Takes a portion of X by Y |
| == | Outputs 1 if values are equal, else 0 |
| > | Outputs 1 if X is greater, else 0 |
| >= | Outputs 1 if X is greater or equal, else 0 |
| < | Outputs 1 if X is lesser, else 0 |
| <= | Outputs 1 if X is lesser or equal, else 0 |
| != | Outputs 1 if values are not equal, else 0 |
| && | Outputs 1 if both values are 1, else 0 |
| || | Outputs 1 if one value is 1, else 0 |
| min | Outputs the lowest value |
| max | Outputs the highest value |
| fmod | Divides X by Y, and outputs the remainder |
| pow | X to the power of Y |
For example:
= 6 n 1 n 3 g +
would set the X scale of the bone to 4 (since it adds 3 and 1)
