ExprUtils

Inherits Double2DParam

Synopsis

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

Functions

Member functions description

NatronEngine.ExprUtils.boxstep(x, a)
Parameters
  • xfloat

  • afloat

Return type

float

if x < a then 0 otherwise 1

NatronEngine.ExprUtils.linearstep(x, a, b)
Parameters
  • xfloat

  • afloat

  • bfloat

Return type

float

Transitions linearly when a < x < b

NatronEngine.ExprUtils.boxstep(x, a, b)
Parameters
  • xfloat

  • afloat

  • bfloat

Return type

float

Transitions smoothly (cubic) when a < x < b

NatronEngine.ExprUtils.gaussstep(x, a, b)
Parameters
  • xfloat

  • afloat

  • bfloat

Return type

float

Transitions smoothly (exponentially) when a < x < b

NatronEngine.ExprUtils.remap(x, source, range, falloff, interp)
Parameters
  • xfloat

  • sourcefloat

  • rangefloat

  • fallofffloat

  • interpfloat

Return type

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
  • xfloat

  • yfloat

  • alphafloat

Return type

float

Linear interpolation of a and b according to alpha

NatronEngine.ExprUtils.hash(args)
Parameters

argsSequence

Return type

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

xfloat

Return type

float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters

pDouble2DTuple

Return type

float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters

pDouble3DTuple

Return type

float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.noise(p)
Parameters

pColorTuple

Return type

float

Original perlin noise at location (C2 interpolant)

NatronEngine.ExprUtils.snoise(p)
Parameters

pDouble3DTuple

Return type

float

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

NatronEngine.ExprUtils.vnoise(p)
Parameters

pDouble3DTuple

Return type

Double3DTuple

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

NatronEngine.ExprUtils.cnoise(p)
Parameters

pDouble3DTuple

Return type

Double3DTuple

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

NatronEngine.ExprUtils.snoise4(p)
Parameters

pColorTuple

Return type

float

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

NatronEngine.ExprUtils.vnoise4(p)
Parameters

pColorTuple

Return type

Double3DTuple

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

NatronEngine.ExprUtils.cnoise4(p)
Parameters

pColorTuple

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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
  • pDouble3DTuple

  • octavesint

  • lacunarityfloat

  • gainfloat

Return type

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

pDouble3DTuple

Return type

float

cellnoise 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

pDouble3DTuple

Return type

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
Return type

float

Periodic noise