Blender
V3.3
|
#include <Python.h>
#include "BLI_math.h"
#include "BLI_noise.h"
#include "BLI_utildefines.h"
#include "DNA_texture_types.h"
#include "../generic/py_capi_utils.h"
#include "mathutils.h"
#include "mathutils_noise.h"
Go to the source code of this file.
Macros | |
#define | N 624 |
#define | M 397 |
#define | MATRIX_A 0x9908b0dfUL /* constant vector a */ |
#define | UMASK 0x80000000UL /* most significant w-r bits */ |
#define | LMASK 0x7fffffffUL /* least significant r bits */ |
#define | MIXBITS(u, v) (((u)&UMASK) | ((v)&LMASK)) |
#define | TWIST(u, v) ((MIXBITS(u, v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL)) |
#define | BPY_NOISE_BASIS_ENUM_DOC |
#define | BPY_NOISE_METRIC_ENUM_DOC |
#define | DEFAULT_NOISE_TYPE TEX_STDPERLIN |
#define | DEFAULT_METRIC_TYPE TEX_DISTANCE |
Functions | |
static void | init_genrand (ulong s) |
static void | next_state (void) |
static void | setRndSeed (int seed) |
static float | frand (void) |
static void | rand_vn (float *array_tar, const int size) |
static void | noise_vector (float x, float y, float z, int nb, float v[3]) |
static float | turb (float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale) |
static void | vTurb (float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale, float v[3]) |
PyDoc_STRVAR (M_Noise_doc, "The Blender noise module") | |
PyDoc_STRVAR (M_Noise_random_doc, ".. function:: random()\n" "\n" " Returns a random number in the range [0, 1).\n" "\n" " :return: The random number.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_random (PyObject *UNUSED(self)) |
PyDoc_STRVAR (M_Noise_random_unit_vector_doc, ".. function:: random_unit_vector(size=3)\n" "\n" " Returns a unit vector with random entries.\n" "\n" " :arg size: The size of the vector to be produced, in the range [2, 4].\n" " :type size: int\n" " :return: The random unit vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
static PyObject * | M_Noise_random_unit_vector (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_random_vector_doc, ".. function:: random_vector(size=3)\n" "\n" " Returns a vector with random entries in the range (-1, 1).\n" "\n" " :arg size: The size of the vector to be produced.\n" " :type size: int\n" " :return: The random vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
static PyObject * | M_Noise_random_vector (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_seed_set_doc, ".. function:: seed_set(seed)\n" "\n" " Sets the random seed used for random_unit_vector, and random.\n" "\n" " :arg seed: Seed used for the random generator.\n" " When seed is zero, the current time will be used instead.\n" " :type seed: int\n") | |
static PyObject * | M_Noise_seed_set (PyObject *UNUSED(self), PyObject *args) |
PyDoc_STRVAR (M_Noise_noise_doc, ".. function:: noise(position, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns noise value from the noise basis at the position specified.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The noise value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_noise (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_noise_vector_doc, ".. function:: noise_vector(position, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the noise vector from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The noise vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
static PyObject * | M_Noise_noise_vector (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_turbulence_doc, ".. function:: turbulence(position, octaves, hard, noise_basis='PERLIN_ORIGINAL', " "amplitude_scale=0.5, frequency_scale=2.0)\n" "\n" " Returns the turbulence value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC " :arg amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :arg frequency_scale: The frequency scaling factor\n" " :type frequency_scale: float\n" " :return: The turbulence value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_turbulence (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_turbulence_vector_doc, ".. function:: turbulence_vector(position, octaves, hard, " "noise_basis='PERLIN_ORIGINAL', amplitude_scale=0.5, frequency_scale=2.0)\n" "\n" " Returns the turbulence vector from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC " :arg amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :arg frequency_scale: The frequency scaling factor\n" " :type frequency_scale: float\n" " :return: The turbulence vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
static PyObject * | M_Noise_turbulence_vector (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_fractal_doc, ".. function:: fractal(position, H, lacunarity, octaves, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the fractal Brownian motion (fBm) noise value from the noise basis at the " "specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal increment factor.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The fractal Brownian motion noise value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_fractal (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_multi_fractal_doc, ".. function:: multi_fractal(position, H, lacunarity, octaves, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns multifractal noise value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal increment factor.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The multifractal noise value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_multi_fractal (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_variable_lacunarity_doc, ".. function:: variable_lacunarity(position, distortion, " "noise_type1='PERLIN_ORIGINAL', noise_type2='PERLIN_ORIGINAL')\n" "\n" " Returns variable lacunarity noise value, a distorted variety of noise, from " "noise type 1 distorted by noise type 2 at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg distortion: The amount of distortion.\n" " :type distortion: float\n" " :arg noise_type1: Enumerator in ['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " "'VORONOI_F1', 'VORONOI_F2', " "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " "'CELLNOISE'].\n" " :type noise_type1: string\n" " :arg noise_type2: Enumerator in ['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " "'VORONOI_F1', 'VORONOI_F2', " "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " "'CELLNOISE'].\n" " :type noise_type2: string\n" " :return: The variable lacunarity noise value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_variable_lacunarity (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_hetero_terrain_doc, ".. function:: hetero_terrain(position, H, lacunarity, octaves, offset, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the heterogeneous terrain value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The heterogeneous terrain value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_hetero_terrain (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_hybrid_multi_fractal_doc, ".. function:: hybrid_multi_fractal(position, H, lacunarity, octaves, offset, gain, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns hybrid multifractal value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :arg gain: Scaling applied to the values.\n" " :type gain: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The hybrid multifractal value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_hybrid_multi_fractal (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_ridged_multi_fractal_doc, ".. function:: ridged_multi_fractal(position, H, lacunarity, octaves, offset, gain, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns ridged multifractal value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :arg gain: Scaling applied to the values.\n" " :type gain: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The ridged multifractal value.\n" " :rtype: float\n") | |
static PyObject * | M_Noise_ridged_multi_fractal (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
PyDoc_STRVAR (M_Noise_voronoi_doc, ".. function:: voronoi(position, distance_metric='DISTANCE', exponent=2.5)\n" "\n" " Returns a list of distances to the four closest features and their locations.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_METRIC_ENUM_DOC " :arg exponent: The exponent for Minkowski distance metric.\n" " :type exponent: float\n" " :return: A list of distances to the four closest features and their locations.\n" " :rtype: list of four floats, list of four :class:`mathutils.Vector` types\n") | |
static PyObject * | M_Noise_voronoi (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
Variables | |
static ulong | state [N] |
static int | left = 1 |
static int | initf = 0 |
static ulong * | next |
static float | state_offset_vector [3 *3] |
static PyC_FlagSet | bpy_noise_types [] |
static PyC_FlagSet | bpy_noise_metrics [] |
This file defines the 'noise' module, a general purpose module to access blenders noise functions.
Definition in file mathutils_noise.c.
#define BPY_NOISE_BASIS_ENUM_DOC |
Definition at line 146 of file mathutils_noise.c.
#define BPY_NOISE_METRIC_ENUM_DOC |
Definition at line 153 of file mathutils_noise.c.
#define DEFAULT_METRIC_TYPE TEX_DISTANCE |
Definition at line 177 of file mathutils_noise.c.
#define DEFAULT_NOISE_TYPE TEX_STDPERLIN |
Definition at line 160 of file mathutils_noise.c.
Definition at line 50 of file mathutils_noise.c.
#define M 397 |
Definition at line 47 of file mathutils_noise.c.
Definition at line 48 of file mathutils_noise.c.
Definition at line 51 of file mathutils_noise.c.
#define N 624 |
Definition at line 46 of file mathutils_noise.c.
Definition at line 52 of file mathutils_noise.c.
Definition at line 49 of file mathutils_noise.c.
Definition at line 124 of file mathutils_noise.c.
References left, next, next_state(), and y.
Referenced by M_Noise_random(), and rand_vn().
Definition at line 61 of file mathutils_noise.c.
References ARRAY_SIZE, float(), initf, left, N, state, and state_offset_vector.
Referenced by next_state(), and setRndSeed().
|
static |
Definition at line 589 of file mathutils_noise.c.
References BLI_noise_mg_fbm(), bpy_noise_types, DEFAULT_NOISE_TYPE, H, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 767 of file mathutils_noise.c.
References BLI_noise_mg_hetero_terrain(), bpy_noise_types, DEFAULT_NOISE_TYPE, H, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 826 of file mathutils_noise.c.
References BLI_noise_mg_hybrid_multi_fractal(), bpy_noise_types, DEFAULT_NOISE_TYPE, H, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 643 of file mathutils_noise.c.
References BLI_noise_mg_multi_fractal(), bpy_noise_types, DEFAULT_NOISE_TYPE, H, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 386 of file mathutils_noise.c.
References BLI_noise_generic_noise(), bpy_noise_types, DEFAULT_NOISE_TYPE, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 425 of file mathutils_noise.c.
References bpy_noise_types, DEFAULT_NOISE_TYPE, mathutils_array_parse(), noise_vector(), NULL, PyC_FlagSet_ValueFromID(), and Vector_CreatePyObject().
|
static |
Definition at line 289 of file mathutils_noise.c.
References frand().
|
static |
Definition at line 303 of file mathutils_noise.c.
References norm(), normalize_vn(), NULL, rand_vn(), and Vector_CreatePyObject().
|
static |
Definition at line 337 of file mathutils_noise.c.
References NULL, rand_vn(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 888 of file mathutils_noise.c.
References BLI_noise_mg_ridged_multi_fractal(), bpy_noise_types, DEFAULT_NOISE_TYPE, H, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 367 of file mathutils_noise.c.
References NULL, and setRndSeed().
|
static |
Definition at line 474 of file mathutils_noise.c.
References bpy_noise_types, DEFAULT_NOISE_TYPE, mathutils_array_parse(), NULL, PyC_FlagSet_ValueFromID(), and turb().
|
static |
Definition at line 531 of file mathutils_noise.c.
References bpy_noise_types, DEFAULT_NOISE_TYPE, mathutils_array_parse(), NULL, PyC_FlagSet_ValueFromID(), Vector_CreatePyObject(), and vTurb().
|
static |
Definition at line 703 of file mathutils_noise.c.
References BLI_noise_mg_variable_lacunarity(), bpy_noise_types, DEFAULT_NOISE_TYPE, mathutils_array_parse(), NULL, and PyC_FlagSet_ValueFromID().
|
static |
Definition at line 940 of file mathutils_noise.c.
References BLI_noise_voronoi(), bpy_noise_metrics, DEFAULT_METRIC_TYPE, mathutils_array_parse(), NULL, PyC_FlagSet_ValueFromID(), ret, v, and Vector_CreatePyObject().
Definition at line 201 of file mathutils_noise.c.
References BLI_noise_generic_noise(), state_offset_vector, v, x, y, and z.
Referenced by M_Noise_noise_vector(), and vTurb().
PyDoc_STRVAR | ( | M_Noise_fractal_doc | , |
".. function:: fractal(position, H, lacunarity, octaves, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the fractal Brownian motion (fBm) noise value from the noise basis at the " "specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal increment factor.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The fractal Brownian motion noise value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_hetero_terrain_doc | , |
".. function:: hetero_terrain(position, H, lacunarity, octaves, offset, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the heterogeneous terrain value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The heterogeneous terrain value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_hybrid_multi_fractal_doc | , |
".. function:: hybrid_multi_fractal(position, H, lacunarity, octaves, offset, gain, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns hybrid multifractal value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :arg gain: Scaling applied to the values.\n" " :type gain: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The hybrid multifractal value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_multi_fractal_doc | , |
".. function:: multi_fractal(position, H, lacunarity, octaves, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns multifractal noise value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal increment factor.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The multifractal noise value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_noise_doc | , |
".. function:: noise(position, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns noise value from the noise basis at the position specified.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The noise value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_noise_vector_doc | , |
".. function:: noise_vector(position, noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns the noise vector from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The noise vector.\n" " :rtype: :class:`mathutils.Vector`\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_random_doc | , |
".. function:: random()\n" "\n" " Returns a random number in the range [ | 0, | ||
1 | |||
) |
PyDoc_STRVAR | ( | M_Noise_random_unit_vector_doc | , |
".. function:: random_unit_vector(size=3)\n" "\n" " Returns a unit vector with random entries.\n" "\n" " :arg size: The size of the vector to be | produced, | ||
in the range .\n" " :type size:int\n" " :return:The random unit vector.\n" " :rtype::class:`mathutils.Vector`\n" | [2, 4] | ||
) |
PyDoc_STRVAR | ( | M_Noise_random_vector_doc | , |
".. function:: random_vector(size=3)\n" "\n" " Returns a vector with random entries in the range (-1, 1).\n" "\n" " :arg size: The size of the vector to be produced.\n" " :type size: int\n" " :return: The random vector.\n" " :rtype: :class:`mathutils.Vector`\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_ridged_multi_fractal_doc | , |
".. function:: ridged_multi_fractal(position, H, lacunarity, octaves, offset, gain, " "noise_basis='PERLIN_ORIGINAL')\n" "\n" " Returns ridged multifractal value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :arg lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :arg gain: Scaling applied to the values.\n" " :type gain: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The ridged multifractal value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_seed_set_doc | , |
".. function:: seed_set(seed)\n" "\n" " Sets the random seed used for | random_unit_vector, | ||
and random.\n" "\n" " :arg seed:Seed used for the random generator.\n" " When seed is | zero, | ||
the current time will be used instead.\n" " :type seed:int\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_turbulence_doc | , |
".. function:: turbulence(position, octaves, hard, noise_basis='PERLIN_ORIGINAL', " "amplitude_scale=0.5, frequency_scale=2.0)\n" "\n" " Returns the turbulence value from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC " :arg amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :arg frequency_scale: The frequency scaling factor\n" " :type frequency_scale: float\n" " :return: The turbulence value.\n" " :rtype: float\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_turbulence_vector_doc | , |
".. function:: turbulence_vector(position, octaves, hard, " "noise_basis='PERLIN_ORIGINAL', amplitude_scale=0.5, frequency_scale=2.0)\n" "\n" " Returns the turbulence vector from the noise basis at the specified position.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :arg octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :arg hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: boolean\n" BPY_NOISE_BASIS_ENUM_DOC " :arg amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :arg frequency_scale: The frequency scaling factor\n" " :type frequency_scale: float\n" " :return: The turbulence vector.\n" " :rtype: :class:`mathutils.Vector`\n" | |||
) |
PyDoc_STRVAR | ( | M_Noise_variable_lacunarity_doc | , |
".. function:: variable_lacunarity(position, distortion, " "noise_type1='PERLIN_ORIGINAL', noise_type2='PERLIN_ORIGINAL')\n" "\n" " Returns variable lacunarity noise | value, | ||
a distorted variety of | noise, | ||
from " "noise type 1 distorted by noise type 2 at the specified position.\n" "\n" " :arg position:The position to evaluate the selected noise function.\n" " :type position::class:`mathutils.Vector`\n" " :arg distortion:The amount of distortion.\n" " :type distortion:float\n" " :arg noise_type1:Enumerator in .\n" " :type noise_type1:string\n" " :arg noise_type2:Enumerator in .\n" " :type noise_type2:string\n" " :return:The variable lacunarity noise value.\n" " :rtype:float\n" | [ 'BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " " 'VORONOI_F1', 'VORONOI_F2', " " 'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " " 'CELLNOISE'][ 'BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " " 'VORONOI_F1', 'VORONOI_F2', " " 'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " " 'CELLNOISE'] | ||
) |
PyDoc_STRVAR | ( | M_Noise_voronoi_doc | , |
".. function:: voronoi(position, distance_metric='DISTANCE', exponent=2.5)\n" "\n" " Returns a list of distances to the four closest features and their locations.\n" "\n" " :arg position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_METRIC_ENUM_DOC " :arg exponent: The exponent for Minkowski distance metric.\n" " :type exponent: float\n" " :return: A list of distances to the four closest features and their locations.\n" " :rtype: list of four | floats, | ||
list of four :class:`mathutils.Vector` types\n" | |||
) |
Definition at line 191 of file mathutils_noise.c.
References frand(), and size().
Referenced by M_Noise_random_unit_vector(), and M_Noise_random_vector().
|
static |
Definition at line 113 of file mathutils_noise.c.
References init_genrand(), NULL, seed, and time.
Referenced by M_Noise_seed_set().
|
static |
Definition at line 213 of file mathutils_noise.c.
References BLI_noise_generic_noise(), fabsf, float(), usdtokens::out(), t, x, y, and z.
Referenced by M_Noise_turbulence(), magic(), and pointdensity().
|
static |
Definition at line 239 of file mathutils_noise.c.
References fabsf, noise_vector(), t, v, x, y, and z.
Referenced by M_Noise_turbulence_vector().
|
static |
Definition at line 179 of file mathutils_noise.c.
Referenced by M_Noise_voronoi().
|
static |
Definition at line 162 of file mathutils_noise.c.
Referenced by M_Noise_fractal(), M_Noise_hetero_terrain(), M_Noise_hybrid_multi_fractal(), M_Noise_multi_fractal(), M_Noise_noise(), M_Noise_noise_vector(), M_Noise_ridged_multi_fractal(), M_Noise_turbulence(), M_Noise_turbulence_vector(), and M_Noise_variable_lacunarity().
|
static |
Definition at line 56 of file mathutils_noise.c.
Referenced by init_genrand(), next_state(), and window_main_loop().
|
static |
Definition at line 55 of file mathutils_noise.c.
Referenced by MD5Hash::append(), BKE_colorband_evaluate(), BKE_tracking_get_projection_matrix(), BLI_split_name_num(), BLI_uniquename_cb(), BVHBuild::build_node(), bvh_reference_sort_threaded(), blender::bke::curves::bezier::calculate_point_handles(), GHOST_SystemNULL::createWindow(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), GHOST_SystemCocoa::createWindow(), do_version_select_mouse(), draw_frustum_boundbox_calc(), blender::compositor::SMAABlendingWeightCalculationOperation::execute_pixel(), blender::compositor::SMAANeighborhoodBlendingOperation::execute_pixel(), frand(), GHOST_CreateWindow(), GHOST_WindowCocoa::GHOST_WindowCocoa(), GHOST_WindowSDL::GHOST_WindowSDL(), GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), GPU_matrix_frustum_set(), GPU_matrix_ortho_2d_set(), GPU_matrix_ortho_set(), graph_bezt_get_transform_selection(), libmv::HorizontalStack(), libmv::HStack(), immDrawPixelsTexTiled_scaling_clipping(), init_genrand(), kdtree_balance(), blender::nodes::node_geo_curve_trim_cc::lookup_control_point_position(), mat4_frustum_set(), mat4_ortho_set(), next_state(), Freestyle::NodePerspectiveCamera::NodePerspectiveCamera(), offset_in_plane(), orthographic_m4(), perspective_m4(), planes_from_projmat(), blender::deg::BuilderStack::print_backtrace(), quad_crosses_symmetry_plane(), query_qual(), sb_cf_threads_run(), sb_sfesf_threads_run(), screen_areas_align(), blender::bke::curves::bezier::segment_is_vector(), blender::nodes::node_geo_curve_handle_type_selection_cc::select_by_handle_type(), seq_snap_source_points_build(), SEQ_transform_fix_single_image_seq_offsets(), SeqTransInfo(), sequencer_image_crop_init(), BVHSpatialSplit::split(), BVHMixedSplit::split(), BVHObjectSplit::split(), BVHSpatialSplit::split_reference(), StereoProjection(), txt_split_curline(), ui_but_is_row_alignment_group(), UI_icon_alert_imbuf_get(), ui_popup_block_position(), blender::compositor::SMAABlendingWeightCalculationOperation::update_memory_buffer_partial(), blender::compositor::SMAANeighborhoodBlendingOperation::update_memory_buffer_partial(), View(), voronoi_getXOfEdge(), voronoiEdge_new(), and voronoiParabola_setLeft().
|
static |
Definition at line 57 of file mathutils_noise.c.
Referenced by Freestyle::__recursiveSplit(), iTaSC::Cache::addCacheItem(), BMeshFairingContext::adjacents_coords_from_loop(), adjacet_vertices_index_from_adjacent_edge(), ANIM_keyingset_infos_exit(), animdata_filter_remove_duplis(), animdata_filter_remove_invalid(), animfilter_nla(), blender::compositor::antialias_tagbuf(), base_callback(), blender::eevee::VelocityModule::bind_resources(), BKE_fcurve_bezt_subdivide_handles(), BKE_fcurve_handles_recalc_ex(), BKE_gpencil_stroke_subdivide(), BKE_mask_spline_feather_collapse_inner_loops(), BKE_mesh_uv_vert_map_create(), BKE_nurb_handle_calc(), BKE_nurb_handle_calc_ex(), BKE_nurb_handle_calc_simple(), BKE_pchan_bbone_spline_params_get(), BKE_sculpt_mask_layers_ensure(), BLI_freelist(), BLI_freelistN(), BLI_linklist_free(), BLI_linklist_free_pool(), BLI_linklist_freeN(), BLI_linklist_pop(), BLI_linklist_pop_pool(), BLI_linklist_reverse(), BLI_listbase_from_link(), BLI_listbase_reverse(), bm_decim_triangulate_begin(), bm_edgering_pair_interpolate(), bm_face_split_by_concave(), BM_face_split_edgenet_connect_islands(), bm_face_triangulate_mapping(), BM_log_entry_add(), BM_mesh_triangulate(), bm_uv_edge_select_build_islands(), BM_uv_element_map_create(), BM_uv_vert_map_create(), bmesh_loop_validate(), blender::deg::DepsgraphRelationBuilder::build_rig(), C_BVHTree_FromPolygons(), calc_keyHandles(), calchandle_curvemap(), calchandleNurb_intern(), calchandlesNurb_intern(), ccg_ehash_free(), ccg_ehash_insert(), blender::compositor::check_corners(), clean_fcurve(), iTaSC::CacheChannel::clear(), btDbvtBroadphase::collide(), blender::fn::MFProcedureDotExport::create_edges(), Freestyle::createStroke(), dc_tri(), delete_metaelems_exec(), direction_bisect(), blender::bke::curves::poly::direction_bisect(), btIDebugDraw::drawArc(), drw_debug_draw_lines(), drw_debug_draw_spheres(), drw_registered_engines_free(), dynamicPaint_createUVSurface(), ebone_spline_preview(), ED_workspace_delete(), edbm_fill_grid_prepare(), BezierSpline::ensure_auto_handles(), GJK< btConvexTemplate >::Evaluate(), gjkepa2_impl::GJK::Evaluate(), face_map_move_exec(), GHOST_TimerManager::fireTimer(), frand(), generate_geometry(), get_line_pos_wrapped(), blender::fn::MFProcedureDotExport::get_next_instruction_in_block(), get_shortest_pattern_side(), Freestyle::Functions0D::getFEdges(), btConvexHullComputer::Edge::getNextEdgeOfVertex(), gpencil_interpolate_update_points(), gpencil_stroke_perimeter_ex(), gpencil_stroke_subdivide(), gpencil_subdivide_stroke(), gpu_node_graph_prune_unused(), GPU_pass_cache_free(), GPU_pass_cache_garbage_collect(), hair_spring_next(), Freestyle::WVertex::incoming_edge_iterator::increment(), Freestyle::Stroke::InsertVertex(), keyframe_jump_exec(), layerInterp_mdeformvert(), lineart_triangle_intersect_math(), list_sort_do(), marker_jump_exec(), minter_v3_v3v3v3_ref(), MOD_solidify_nonmanifold_modifyMesh(), multiresbake_freejob(), next_state(), GHOST_TimerManager::nextFireTime(), nlaedit_duplicate_exec(), nlaedit_split_exec(), blender::ed::space_node::node_link_insert_offset_ntree(), blender::ed::space_node::node_remove_linked(), blender::nodes::node_geo_curve_fillet_cc::node_update(), blender::nodes::node_geo_curve_primitive_arc_cc::node_update(), blender::nodes::node_geo_curve_primitive_circle_cc::node_update(), blender::nodes::node_geo_curve_primitive_line_cc::node_update(), blender::nodes::node_geo_curve_resample_cc::node_update(), blender::nodes::node_geo_curve_sample_cc::node_update(), blender::nodes::node_geo_curve_to_points_cc::node_update(), blender::nodes::node_geo_curve_trim_cc::node_update(), blender::nodes::node_geo_string_to_curves_cc::node_update(), object_blend_read_data(), Freestyle::Functions0D::VertexOrientation2DF0D::operator()(), Freestyle::Functions0D::VertexOrientation3DF0D::operator()(), Freestyle::Functions0D::Curvature2DAngleF0D::operator()(), phash_insert(), point_calculate_handle(), pose_grab_with_ik_clear(), pose_ik_clear_exec(), pose_select_connected_invoke(), pose_select_linked_exec(), poselib_preview_get_next(), GHOST_SystemCocoa::processEvents(), GHOST_SystemSDL::processEvents(), GHOST_SystemWin32::processEvents(), GHOST_SystemX11::processEvents(), RE_engines_exit(), rearrange_island_down(), recalcData_nla(), remove_tagged_functions(), Freestyle::Stroke::Resample(), RNA_def_property_collection_funcs(), rna_freelistN(), sample_fcurve(), select_adjacent_cp(), selmap_build_bezier_less(), selmap_build_bezier_more(), seq_cache_recycle_linked(), seq_cache_set_temp_cache_linked(), sequencer_strip_jump_exec(), GHOST_TimerTask::setNext(), btAxisSweep3Internal< BP_FP_INT_TYPE >::Handle::SetNextFree(), btSimpleBroadphaseProxy::SetNextFree(), slide_check_corners(), ss_sync_from_uv(), subdivide_nonauto_handles(), Freestyle::ViewEdgeInternal::SVertexIterator::SVertexIterator(), target_callback(), TEST(), testsort_listbase_sort_is_stable(), tilt_bezpart(), tracking_get_keyframed_marker(), tracks_map_merge(), ui_multibut_free(), unescape(), weight_paint_sample_enum_itemf(), and blender::ed::space_node::WIDGETGROUP_node_corner_pin_refresh().
Definition at line 54 of file mathutils_noise.c.
Referenced by init_genrand(), and next_state().
|
static |
Definition at line 58 of file mathutils_noise.c.
Referenced by init_genrand(), and noise_vector().