Aller au contenu

Calculation Modifier

By Kriss Norde

The Calculation modifier applies a simple arithmetic operation between two values to drive a parameter. Simpler than the Expression modifier (no syntax to learn), but limited to A op B with op = Add, Subtract, Multiply, Divide, etc. Ideal for basic relationships between parameters.

Overview

Calculation is a modifier: you add it by right-clicking a target parameter. It takes two inputs (First and Second Operand) and applies the chosen operation. The result feeds the parameter.

Typical cases: one parameter = another × 2, the sum of two values, the difference between two sliders. For more complex relationships (conditions, trig functions), switch to the Expression modifier.

Where to find this modifier

  • Right-click a parameter in the Inspector → Modify With → Calculation.
  • The modifier appears as a new node in the graph.

Available operations

Add
A + B. Combines two additive contributions.
Subtract
A - B. Difference between two values.
Multiply
A × B. Scales one value by another.
Divide
A / B. Ratio. Watch out for division by zero.
Modulo
A mod B. Remainder of the division. For cyclic effects.
Power
A^B. Raises to a power.

Setup

Link scale Y to scale X (consistency):
Transform.Size.Y → Calculation (First = Transform.Size.X,
                                Second = 1.0,
                                Op = Multiply)
   = Y equals X (proportional lock)

Drive blur from time:
Blur.Size → Calculation (First = Time,
                         Second = 5,
                         Op = Multiply)
   = blur increases linearly with time

Difference of values:
Result → Calculation (First = SliderA,
                      Second = SliderB,
                      Op = Subtract)
   = Result = A - B

Controls tab

Operation (default: Add)
Type of math operation.
First Operand
First value. Can be typed in directly or linked to another parameter with an expression.
Second Operand
Second value. Same as above.

Use cases

  • Linking two parameters - scale X and Y kept in sync, position X and Y with a constant offset.
  • Driving from Time - make a parameter change linearly over time by multiplying Time.
  • Unit conversion - degrees to radians (Multiply by π/180), pixels to normalized.
  • Constant offset - a value equal to another + a constant (Add).
  • Simple cyclic effect - Modulo of Time for a loop.
  • Simple logic without Expression - so you do not have to learn the Expression syntax for trivial cases.

Tips

  • Prefer Calculation for 2 values, and Expression for complex formulas (more than 2 values, conditions, sin/cos).
  • Link the operands to other parameters - turn the First Operand into an expression =Transform1.Size.X to link it dynamically.
  • Dividing by zero = trouble - be careful with Divide. Add a small value (e.g. 0.001) to Second to be safe.
  • Chain them for formulas - for A + B × C, use two Calculations in a row. But for 3+ values, Expression becomes more readable.
  • Can be disabled - the modifier can be disabled with a right-click to compare with/without.
  • No native animation - Calculation itself cannot be animated, but its operands can (with keyframes or expressions).
  • For random / shake, use the Perturb modifier, which is built for that.