# ExprUtils¶

Inherits Double2DParam

## Synopsis¶

Various functions useful for expressions. Most noise functions have been taken from the Walt Disney Animation Studio SeExpr library.

### Member functions description¶

NatronEngine.ExprUtils.boxstep(x, a)
Parameters: x – float a – float float if x < a then 0 otherwise 1
NatronEngine.ExprUtils.linearstep(x, a, b)
Parameters: x – float a – float b – float float Transitions linearly when a < x < b
NatronEngine.ExprUtils.boxstep(x, a, b)
Parameters: x – float a – float b – float float

Transitions smoothly (cubic) when a < x < b

NatronEngine.ExprUtils.gaussstep(x, a, b)
Parameters: x – float a – float b – float float

Transitions smoothly (exponentially) when a < x < b

NatronEngine.ExprUtils.remap(x, source, range, falloff, interp)
Parameters: x – float source – float range – float falloff – float interp – float float

General remapping function. When x is within +/- range of source, the result is 1. The result falls to 0 beyond that range over falloff distance. The falloff shape is controlled by interp: linear = 0 smooth = 1 gaussian = 2

NatronEngine.ExprUtils.mix(x, y, alpha)
Parameters: x – float y – float alpha – float float

Linear interpolation of a and b according to alpha

NatronEngine.ExprUtils.hash(args)
Parameters: args – Sequence float

Like random, but with no internal seeds. Any number of seeds may be given and the result will be a random function based on all the seeds.

NatronEngine.ExprUtils.noise(x)
Parameters: x – float float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters: p – Double2DTuple float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters: p – Double3DTuple float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters: p – ColorTuple float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.snoise(p)
Parameters: p – Double3DTuple float

Signed noise w/ range -1 to 1 formed with original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.vnoise(p)
Parameters: p – Double3DTuple Double3DTuple

Vector noise formed with original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.cnoise(p)
Parameters: p – Double3DTuple Double3DTuple

Color noise formed with original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.snoise4(p)
Parameters: p – ColorTuple float

4D signed noise w/ range -1 to 1 formed with original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.vnoise4(p)
Parameters: p – ColorTuple Double3DTuple

4D vector noise formed with original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.cnoise4(p)
Parameters: p – ColorTuple Double3DTuple

4D color noise formed with original perlin noise at location (C2 interpolant)”

NatronEngine.ExprUtils.turbulence(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float float FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.vturbulence(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.cturbulence(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.fbm(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float float FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.vfbm(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.fbm4(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float float FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.vfbm4(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.cfbm(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.cfbm4(p[, ocaves=6, lacunarity=2, gain=0.5])
Parameters: p – Double3DTuple octaves – int lacunarity – float gain – float Double3DTuple FBM (Fractal Brownian Motion) is a multi-frequency noise function. The base frequency is the same as the noise function. The total number of frequencies is controlled by octaves. The lacunarity is the spacing between the frequencies - A value of 2 means each octave is twice the previous frequency. The gain controls how much each frequency is scaled relative to the previous frequency.
NatronEngine.ExprUtils.cellnoise(p)
Parameters: p – Double3DTuple floatcellnoise generates a field of constant colored cubes based on the integer location This is the same as the prman cellnoise function
NatronEngine.ExprUtils.ccellnoise(p)
Parameters: p – Double3DTuple Double3DTuple

cellnoise generates a field of constant colored cubes based on the integer location This is the same as the prman cellnoise function

NatronEngine.ExprUtils.pnoise(p, period)
Parameters: p – Double3DTuple period – Double3DTuple float

Periodic noise