c4d.utils.noise.C4DNoise

class c4d.utils.noise.C4DNoise

An important technique for generating procedural textures is the use of fractal noise.

See also

Noise Types.

Methods Signatures

C4DNoise.__init__(self[, seed])
type seed:int
C4DNoise.InitFbm(self, lMaxOctaves, ...) Initializes fractal brownian motion.
C4DNoise.Noise(self, t, two_d, p[, ...]) Samples a 2D or 3D noise.
C4DNoise.SNoise(self, p, lRepeat[, t]) Generate a periodic signed noise value.
C4DNoise.Turbulence(self, p, rOctaves, ...) Generate a turbulence value, this is a sum of multiple noises with different frequency.
C4DNoise.Fbm(self, p, rOctaves, lRepeat) Generate a periodic Fractional Brownian Motion value.
C4DNoise.RidgedMultifractal(self, p, rOctaves, ...) Generate a periodic fractal function used for such things as landscapes or mountain ranges.

Static Methods Signatures

c4d.utils.noise.C4DNoise.CreateMenuContainer([bIncludeNone]) Creates a menu container with the different noise options available:
c4d.utils.noise.C4DNoise.HasOctaves(t) Checks if a certain noise type supports the octaves parameter.
c4d.utils.noise.C4DNoise.HasCycles(t) Checks if a certain noise type supports the cycles parameter.
c4d.utils.noise.C4DNoise.HasAbsolute(t) Checks if a certain noise type supports the absolute parameter.
c4d.utils.noise.C4DNoise.EvaluateSampleOffset(type, rOctaves, rDelta) Evaluates the sample offset.

Methods Documentation

C4DNoise.__init__(self, seed=665)
Parameters:seed (int) – Noise seed.
Return type:c4d.utils.noise.C4DNoise
Returns:A new noise object.
C4DNoise.InitFbm(self, lMaxOctaves, rLacunarity, h)

Initializes fractal brownian motion.

Parameters:
  • lMaxOctaves (int) – The maximum octave.
  • rLacunarity (float) – This parameter controls the scale of each successive fractal overlay.
  • h (float) – H-Parameter
Return type:

bool

Returns:

Initializes fractal brownian motion

C4DNoise.Noise(self, t, two_d, p, time=0.0, octaves=4.0, absolute=False, sampleRad=0.25, detailAtt=0.25, t_repeat=0)

Samples a 2D or 3D noise.

Parameters:
  • t (int) –

    The noise Type: Noise Types

    Note

    Please use InitFbm() before you use one of the following noise types: NOISE_ZADA, NOISE_DISPL_VORONOI, NOISE_OBER, NOISE_FBM, NOISE_BUYA.

  • two_d (bool) – True for 2D Sampling, False for 3D Sampling
  • p (c4d.Vector) – Noise coordinate.
  • time (float) – Time.
  • octaves (float) – Octaves, if supported. See HasOctaves()
  • absolute (bool) – Absolute value, if supported. See HasAbsolute()
  • sampleRad (float) – Sample radius.
  • detailAtt (float) – Detail attenuation.
  • t_repeat (int) – Must be 2^x - 1, where x = [1..10], i.e. one of 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1023. A noise repeats itself in time every 1024 units. Using a smaller repeat the noise will repeat at an earlier time.
Return type:

float

Returns:

Noise sample.

C4DNoise.SNoise(self, p, lRepeat, t=0.0)

Generate a periodic signed noise value.

Parameters:
  • p (c4d.Vector) – Noise coordinate.
  • lRepeat (int) – Must be 2^x - 1, where x = [1..10], i.e. one of 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1023. A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
  • t (float) – The time.
Return type:

float

Returns:

Signed noise value, this is between -1.0 and 1.0.

C4DNoise.Turbulence(self, p, rOctaves, bAsolute, lRepeat, t=0.0)

Generate a turbulence value, this is a sum of multiple noises with different frequency.

Parameters:
  • p (c4d.Vector) – Turbulence coordinate
  • rOctaves (float) – The number of octaves.
  • bAbsolute (bool) – True for absolute values.
  • lRepeat (int) – Must be 2^x - 1, where x = [1..10], i.e. one of 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1023. A noise repeats itself in time every 1024 units. Using a smaller lRepeat the noise will repeat at an earlier time.
  • t (float) – The time.
Return type:

float

Returns:

Noise sample.

C4DNoise.Fbm(self, p, rOctaves, lRepeat, t=0.0)

Generate a periodic Fractional Brownian Motion value.

Note

Needs the call InitFbm() before.

Warning

The rOctaves value must not exceed the value passed to InitFbm() but can be lower.

Parameters:
  • p (c4d.Vector) – The evaluation point.
  • rOctaves (float) – The octaves
  • lRepeat (int) – Must be 2^x - 1, where x = [1..10], i.e. one of 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1023. A noise repeats itself in time every 1024 units. Using a smaller repeat the noise will repeat at an earlier time.
  • t (float) – The time
Return type:

float

Returns:

The fbm value.

C4DNoise.RidgedMultifractal(self, p, rOctaves, rOffset, rGain, lRepeat, t=0)

Generate a periodic fractal function used for such things as landscapes or mountain ranges.

Note

Needs the call InitFbm() before.

Warning

The rOctaves value must not exceed the value passed to InitFbm() but can be lower.

Parameters:
  • p (c4d.Vector) – The evaluation point.
  • rOctaves (float) – The octave.
  • rOffset (float) – The zero offset, this controls the multifractality.
  • rGain (float) – The amplification of the fractal value.
  • lRepeat (float) – Must be 2^x - 1, where x = [1..10], i.e. one of 1, 3, 7, 15, 31, 63, 127, 255, 511, and 1023. A noise repeats itself in time every 1024 units. Using a smaller lrepeat the noise will repeat at an earlier time.
  • t (float) – The time.
Return type:

float

Returns:

The fractal value.

Static Methods Documentation

static c4d.utils.noise.C4DNoise.CreateMenuContainer(bIncludeNone=False)

Creates a menu container with the different noise options available:

import c4d



bc = c4d.utils.noise.C4DNoise.CreateMenuContainer(False)

for index, name in bc:

    print index, name

Parameters:bIncludeNone (bool) – Include the none option.
Return type:c4d.BaseContainer
Returns:Generated noise menu.
static c4d.utils.noise.C4DNoise.HasOctaves(t)

Checks if a certain noise type supports the octaves parameter.

Parameters:t (int) – Noise type.
Return type:bool
Returns:True if octaves is supported, otherwise False.
static c4d.utils.noise.C4DNoise.HasCycles(t)

Checks if a certain noise type supports the cycles parameter.

Parameters:t (int) – Noise type.
Return type:bool
Returns:True if cycles is supported, otherwise False.
static c4d.utils.noise.C4DNoise.HasAbsolute(t)

Checks if a certain noise type supports the absolute parameter.

Parameters:t (int) – Noise type.
Return type:bool
Returns:True if absolute is supported, otherwise False.
static c4d.utils.noise.C4DNoise.EvaluateSampleOffset(type, rOctaves, rDelta)

Evaluates the sample offset.

Parameters:
  • type (int) – Noise type.
  • rOctaves (float) – Number of octaves.
  • rDelta (float) – Delta.
Return type:

float

Returns:

The sample offset.