c4d.utils.noise.C4DNoise
¶
An important technique for generating procedural textures is the use of fractal noise.
c4d.utils.noise.
C4DNoise
¶
C4DNoise.CreateMenuContainer()
C4DNoise.HasOctaves()
C4DNoise.HasCycles()
C4DNoise.HasAbsolute()
C4DNoise.EvaluateSampleOffset()
C4DNoise.InitFbm()
C4DNoise.Noise()
C4DNoise.SNoise()
C4DNoise.Turbulence()
C4DNoise.Fbm()
C4DNoise.RidgedMultifractal()
C4DNoise.
__init__
(
[
seed=665
]
)
¶
Parameters: | seed ( int ) – Noise seed. |
---|---|
Return type: | c4d.utils.noise.C4DNoise |
Returns: | A new noise object. |
C4DNoise.
CreateMenuContainer
(
[
bIncludeNone=False
]
)
¶
Creates a menu container with the different noise options available:
bc = 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. |
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 . |
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 . |
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 . |
C4DNoise.
EvaluateSampleOffset
(
type
,
rOctaves
,
rDelta
)
¶
Evaluates the sample offset.
Parameters: |
|
---|---|
Return type: |
float |
Returns: |
The sample offset. |
C4DNoise.
InitFbm
(
lMaxOctaves
,
rLacunarity
,
h
)
¶
Initializes fractal brownian motion.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
Initializes fractal brownian motion |
C4DNoise.
Noise
(
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: |
|
---|---|
Return type: |
float |
Returns: |
Noise sample. |
C4DNoise.
SNoise
(
p
,
lRepeat
[
,
t=0.0
]
)
¶
Generate a periodic signed noise value.
Parameters: |
|
---|---|
Return type: |
float |
Returns: |
Signed noise value, this is between -1.0 and 1.0. |
C4DNoise.
Turbulence
(
p
,
rOctaves
,
bAsolute
[
,
t=0.0
]
)
¶
Generate a turbulence value, this is a sum of multiple noises with different frequency.
Parameters: |
|
---|---|
Return type: |
float |
Returns: |
Noise sample. |
C4DNoise.
Fbm
(
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: |
|
---|---|
Return type: |
float |
Returns: |
The fbm value. |
C4DNoise.
RidgedMultifractal
(
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: |
|
---|---|
Return type: |
float |
Returns: |
The fractal value. |
Creates a noise and save it in a bitmap:
import c4d from c4d.utils.noise import C4DNoise from c4d import bitmaps width = 300 height = 300 noisetype = c4d.NOISE_DISPL_TURB bmp = bitmaps.BaseBitmap() bmp.Init(width, height, 24) # Create and initialize the noise instance p = C4DNoise(1234) p.InitFbm(21, 2.1, 0.5) rw = float(width-1) rh = float(height-1) # Iterate through the bitmap and set the noise value per pixel for x in xrange(width): for y in xrange(height): r = p.Noise(noisetype, False, c4d.Vector(x/rw, y/rh, 0) * 7.0, octaves=5) o = int(255.0*r) if o < 0: o = 0 elif o > 255: o = 255 bmp[x, y] = (o, o, o) bitmaps.ShowBitmap(bmp)
Type: NOISE_BOX_NOISE
![]()
Type: NOISE_BLIST_TURB
![]()
Type: NOISE_BUYA
![]()
Type: NOISE_CELL_NOISE
![]()
Type: NOISE_CELL_VORONOI
![]()
Type: NOISE_CRANAL
![]()
Type: NOISE_DENTS
![]()
Type: NOISE_DISPL_TURB
![]()
Type: NOISE_ELECTRIC
![]()
Type: NOISE_FBM
![]()
Type: NOISE_FIRE
![]()
Type: NOISE_GASEOUS
![]()
Type: NOISE_HAMA
![]()
Type: NOISE_LUKA
![]()
Type: NOISE_MOD_NOISE
![]()
Type: NOISE_NAKI
![]()
Type: NOISE_NOISE
![]()
Type: NOISE_NONE
![]()
Type: NOISE_NUTOUS
![]()
Type: NOISE_OBER
![]()
Type: NOISE_PEZO
![]()
Type: NOISE_POXO
![]()
Type: NOISE_SEMA
![]()
Type: NOISE_SPARSE_CONV
![]()
Type: NOISE_STUPL
![]()
Type: NOISE_TURBULENCE
![]()
Type: NOISE_VL_NOISE
![]()
Type: NOISE_VORONOI_1
![]()
Type: NOISE_VORONOI_2
![]()
Type: NOISE_VORONOI_3
![]()
Type: NOISE_WAVY_TURB
![]()
Type: NOISE_ZADA
![]()