53#define MATRIX_A 0x9908b0dfUL
54#define UMASK 0x80000000UL
55#define LMASK 0x7fffffffUL
56#define MIXBITS(u, v) (((u) & UMASK) | ((v) & LMASK))
57#define TWIST(u, v) ((MIXBITS(u, v) >> 1) ^ ((v) & 1UL ? MATRIX_A : 0UL))
69 state[0] = s & 0xffffffffUL;
70 for (j = 1; j <
N; j++) {
76 state[j] &= 0xffffffffUL;
84 const float range = 32;
105 for (j =
N -
M + 1; --j; p++) {
106 *p = p[
M] ^
TWIST(p[0], p[1]);
109 for (j =
M; --j; p++) {
110 *p = p[
M -
N] ^
TWIST(p[0], p[1]);
140 y ^= (
y << 7) & 0x9d2c5680UL;
141 y ^= (
y << 15) & 0xefc60000UL;
144 return float(
y) / 4294967296.0f;
151#define BPY_NOISE_BASIS_ENUM_DOC \
152 " :param noise_basis: A noise basis string.\n" \
153 " :type noise_basis: Literal['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " \
154 "'VORONOI_F1', 'VORONOI_F2', " \
155 "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " \
158#define BPY_NOISE_METRIC_ENUM_DOC \
159 " :param distance_metric: A distance metric string.\n" \
160 " :type distance_metric: Literal['DISTANCE', 'DISTANCE_SQUARED', 'MANHATTAN', " \
162 "'MINKOVSKY', 'MINKOVSKY_HALF', 'MINKOVSKY_FOUR']\n"
165#define DEFAULT_NOISE_TYPE TEX_STDPERLIN
182#define DEFAULT_METRIC_TYPE TEX_DISTANCE
196static void rand_vn(
float *array_tar,
const int size)
198 float *array_pt = array_tar + (size - 1);
201 *(array_pt--) = 2.0f *
frand() - 1.0f;
210 for (
int j = 0; j < 3; j++) {
219 float x,
float y,
float z,
int oct,
int hard,
int nb,
float ampscale,
float freqscale)
228 for (i = 1; i < oct; i++) {
263 for (i = 1; i < oct; i++) {
287 ".. function:: random()\n"
289 " Returns a random number in the range [0, 1).\n"
291 " :return: The random number.\n"
295 return PyFloat_FromDouble(
frand());
300 M_Noise_random_unit_vector_doc,
301 ".. function:: random_unit_vector(*, size=3)\n"
303 " Returns a unit vector with random entries.\n"
305 " :param size: The size of the vector to be produced, in the range [2, 4].\n"
307 " :return: The random unit vector.\n"
308 " :rtype: :class:`mathutils.Vector`\n");
311 static const char *kwlist[] = {
"size",
nullptr};
312 float vec[4] = {0.0f, 0.0f, 0.0f, 0.0f};
316 if (!PyArg_ParseTupleAndKeywords(args,
320 ":random_unit_vector",
321 const_cast<char **
>(kwlist),
327 if (vec_num > 4 || vec_num < 2) {
328 PyErr_SetString(PyExc_ValueError,
"Vector(): invalid size");
332 while (
norm == 0.0f ||
norm > 1.0f) {
342 M_Noise_random_vector_doc,
343 ".. function:: random_vector(*, size=3)\n"
345 " Returns a vector with random entries in the range (-1, 1).\n"
347 " :param size: The size of the vector to be produced, must be 2 or greater.\n"
349 " :return: The random vector.\n"
350 " :rtype: :class:`mathutils.Vector`\n");
353 static const char *kwlist[] = {
"size",
nullptr};
354 float *vec =
nullptr;
357 if (!PyArg_ParseTupleAndKeywords(args,
362 const_cast<char **
>(kwlist),
369 PyErr_SetString(PyExc_ValueError,
"Vector(): invalid size");
373 vec = PyMem_New(
float, vec_num);
382 M_Noise_seed_set_doc,
383 ".. function:: seed_set(seed, /)\n"
385 " Sets the random seed used for random_unit_vector, random_vector, and random.\n"
387 " :param seed: Seed used for the random generator.\n"
388 " When seed is zero, the current time will be used instead.\n"
389 " :type seed: int\n");
393 if (!PyArg_ParseTuple(args,
407 ".. function:: noise(position, /, *, noise_basis='PERLIN_ORIGINAL')\n"
409 " Returns noise value from the noise basis at the position specified.\n"
411 " :param position: The position to evaluate the selected noise function.\n"
413 " :return: The noise value.\n"
417 static const char *kwlist[] = {
"",
"noise_basis",
nullptr};
420 const char *noise_basis_str =
nullptr;
423 if (!PyArg_ParseTupleAndKeywords(args,
429 const_cast<char **
>(kwlist),
436 if (!noise_basis_str) {
449 return PyFloat_FromDouble(
456 M_Noise_noise_vector_doc,
457 ".. function:: noise_vector(position, /, *, noise_basis='PERLIN_ORIGINAL')\n"
459 " Returns the noise vector from the noise basis at the specified position.\n"
461 " :param position: The position to evaluate the selected noise function.\n"
463 " :return: The noise vector.\n"
464 " :rtype: :class:`mathutils.Vector`\n");
467 static const char *kwlist[] = {
"",
"noise_basis",
nullptr};
469 float vec[3], r_vec[3];
470 const char *noise_basis_str =
nullptr;
473 if (!PyArg_ParseTupleAndKeywords(args,
479 const_cast<char **
>(kwlist),
486 if (!noise_basis_str) {
490 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"noise_vector") == -1)
499 noise_vector(vec[0], vec[1], vec[2], noise_basis_enum, r_vec);
506 M_Noise_turbulence_doc,
507 ".. function:: turbulence(position, octaves, hard, /, *, "
508 "noise_basis='PERLIN_ORIGINAL', amplitude_scale=0.5, frequency_scale=2.0)\n"
510 " Returns the turbulence value from the noise basis at the specified position.\n"
512 " :param position: The position to evaluate the selected noise function.\n"
513 " :type position: :class:`mathutils.Vector`\n"
514 " :param octaves: The number of different noise frequencies used.\n"
515 " :type octaves: int\n"
516 " :param hard: Specifies whether returned turbulence is hard (sharp transitions) or "
517 "soft (smooth transitions).\n"
519 " :param amplitude_scale: The amplitude scaling factor.\n"
520 " :type amplitude_scale: float\n"
521 " :param frequency_scale: The frequency scaling factor.\n"
522 " :type frequency_scale: float\n"
523 " :return: The turbulence value.\n"
527 static const char *kwlist[] = {
528 "",
"",
"",
"noise_basis",
"amplitude_scale",
"frequency_scale",
nullptr};
531 const char *noise_basis_str =
nullptr;
533 float as = 0.5f, fs = 2.0f;
535 if (!PyArg_ParseTupleAndKeywords(args,
545 const_cast<char **
>(kwlist),
556 if (!noise_basis_str) {
560 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"turbulence") == -1)
569 return PyFloat_FromDouble(
turb(vec[0], vec[1], vec[2], oct, hd, noise_basis_enum, as, fs));
574 M_Noise_turbulence_vector_doc,
575 ".. function:: turbulence_vector(position, octaves, hard, /, *, "
576 "noise_basis='PERLIN_ORIGINAL', amplitude_scale=0.5, frequency_scale=2.0)\n"
578 " Returns the turbulence vector from the noise basis at the specified position.\n"
580 " :param position: The position to evaluate the selected noise function.\n"
581 " :type position: :class:`mathutils.Vector`\n"
582 " :param octaves: The number of different noise frequencies used.\n"
583 " :type octaves: int\n"
584 " :param hard: Specifies whether returned turbulence is hard (sharp transitions) or "
585 "soft (smooth transitions).\n"
587 " :param amplitude_scale: The amplitude scaling factor.\n"
588 " :type amplitude_scale: float\n"
589 " :param frequency_scale: The frequency scaling factor.\n"
590 " :type frequency_scale: float\n"
591 " :return: The turbulence vector.\n"
592 " :rtype: :class:`mathutils.Vector`\n");
595 static const char *kwlist[] = {
596 "",
"",
"",
"noise_basis",
"amplitude_scale",
"frequency_scale",
nullptr};
598 float vec[3], r_vec[3];
599 const char *noise_basis_str =
nullptr;
601 float as = 0.5f, fs = 2.0f;
603 if (!PyArg_ParseTupleAndKeywords(args,
612 ":turbulence_vector",
613 const_cast<char **
>(kwlist),
624 if (!noise_basis_str) {
628 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"turbulence_vector") == -1)
637 vTurb(vec[0], vec[1], vec[2], oct, hd, noise_basis_enum, as, fs, r_vec);
646 ".. function:: fractal(position, H, lacunarity, octaves, /, *, "
647 "noise_basis='PERLIN_ORIGINAL')\n"
649 " Returns the fractal Brownian motion (fBm) noise value from the noise basis at the "
650 "specified position.\n"
652 " :param position: The position to evaluate the selected noise function.\n"
653 " :type position: :class:`mathutils.Vector`\n"
654 " :param H: The fractal increment parameter.\n"
656 " :param lacunarity: The gap between successive frequencies.\n"
657 " :type lacunarity: float\n"
658 " :param octaves: The number of different noise frequencies used.\n"
660 " :return: The fractal Brownian motion noise value.\n"
664 static const char *kwlist[] = {
"",
"",
"",
"",
"noise_basis",
nullptr};
667 const char *noise_basis_str =
nullptr;
671 if (!PyArg_ParseTupleAndKeywords(args,
680 const_cast<char **
>(kwlist),
690 if (!noise_basis_str) {
703 return PyFloat_FromDouble(
709 M_Noise_multi_fractal_doc,
710 ".. function:: multi_fractal(position, H, lacunarity, octaves, /, *, "
711 "noise_basis='PERLIN_ORIGINAL')\n"
713 " Returns multifractal noise value from the noise basis at the specified position.\n"
715 " :param position: The position to evaluate the selected noise function.\n"
716 " :type position: :class:`mathutils.Vector`\n"
717 " :param H: Determines the highest fractal dimension.\n"
719 " :param lacunarity: The gap between successive frequencies.\n"
720 " :type lacunarity: float\n"
721 " :param octaves: The number of different noise frequencies used.\n"
723 " :return: The multifractal noise value.\n"
727 static const char *kwlist[] = {
"",
"",
"",
"",
"noise_basis",
nullptr};
730 const char *noise_basis_str =
nullptr;
734 if (!PyArg_ParseTupleAndKeywords(args,
743 const_cast<char **
>(kwlist),
753 if (!noise_basis_str) {
757 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"multi_fractal") == -1)
766 return PyFloat_FromDouble(
772 M_Noise_variable_lacunarity_doc,
773 ".. function:: variable_lacunarity(position, distortion, /, *, "
774 "noise_type1='PERLIN_ORIGINAL', noise_type2='PERLIN_ORIGINAL')\n"
776 " Returns variable lacunarity noise value, a distorted variety of noise, from "
777 "noise type 1 distorted by noise type 2 at the specified position.\n"
779 " :param position: The position to evaluate the selected noise function.\n"
780 " :type position: :class:`mathutils.Vector`\n"
781 " :param distortion: The amount of distortion.\n"
782 " :type distortion: float\n"
783 " :param noise_type1: A noise type string.\n"
784 " :type noise_type1: Literal['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', "
785 "'VORONOI_F1', 'VORONOI_F2', "
786 "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', "
788 " :param noise_type2: A noise type string.\n"
789 " :type noise_type2: Literal['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', "
790 "'VORONOI_F1', 'VORONOI_F2', "
791 "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', "
793 " :return: The variable lacunarity noise value.\n"
797 static const char *kwlist[] = {
"",
"",
"noise_type1",
"noise_type2",
nullptr};
800 const char *noise_type1_str =
nullptr, *noise_type2_str =
nullptr;
804 if (!PyArg_ParseTupleAndKeywords(args,
811 ":variable_lacunarity",
812 const_cast<char **
>(kwlist),
821 if (!noise_type1_str) {
825 bpy_noise_types, noise_type1_str, &noise_type1_enum,
"variable_lacunarity") == -1)
830 if (!noise_type2_str) {
834 bpy_noise_types, noise_type2_str, &noise_type2_enum,
"variable_lacunarity") == -1)
845 vec[0], vec[1], vec[2], d, noise_type1_enum, noise_type2_enum));
850 M_Noise_hetero_terrain_doc,
851 ".. function:: hetero_terrain(position, H, lacunarity, octaves, offset, /, *, "
852 "noise_basis='PERLIN_ORIGINAL')\n"
854 " Returns the heterogeneous terrain value from the noise basis at the specified position.\n"
856 " :param position: The position to evaluate the selected noise function.\n"
857 " :type position: :class:`mathutils.Vector`\n"
858 " :param H: The fractal dimension of the roughest areas.\n"
860 " :param lacunarity: The gap between successive frequencies.\n"
861 " :type lacunarity: float\n"
862 " :param octaves: The number of different noise frequencies used.\n"
863 " :type octaves: float\n"
864 " :param offset: The height of the terrain above 'sea level'.\n"
866 " :return: The heterogeneous terrain value.\n"
870 static const char *kwlist[] = {
"",
"",
"",
"",
"",
"noise_basis",
nullptr};
873 const char *noise_basis_str =
nullptr;
874 float H, lac, oct, ofs;
877 if (!PyArg_ParseTupleAndKeywords(args,
887 const_cast<char **
>(kwlist),
898 if (!noise_basis_str) {
902 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"hetero_terrain") == -1)
911 return PyFloat_FromDouble(
917 M_Noise_hybrid_multi_fractal_doc,
918 ".. function:: hybrid_multi_fractal(position, H, lacunarity, octaves, offset, gain, /, *, "
919 "noise_basis='PERLIN_ORIGINAL')\n"
921 " Returns hybrid multifractal value from the noise basis at the specified position.\n"
923 " :param position: The position to evaluate the selected noise function.\n"
924 " :type position: :class:`mathutils.Vector`\n"
925 " :param H: The fractal dimension of the roughest areas.\n"
927 " :param lacunarity: The gap between successive frequencies.\n"
928 " :type lacunarity: float\n"
929 " :param octaves: The number of different noise frequencies used.\n"
930 " :type octaves: float\n"
931 " :param offset: The height of the terrain above 'sea level'.\n"
932 " :type offset: float\n"
933 " :param gain: Scaling applied to the values.\n"
935 " :return: The hybrid multifractal value.\n"
939 static const char *kwlist[] = {
"",
"",
"",
"",
"",
"",
"noise_basis",
nullptr};
942 const char *noise_basis_str =
nullptr;
943 float H, lac, oct, ofs, gn;
946 if (!PyArg_ParseTupleAndKeywords(args,
956 ":hybrid_multi_fractal",
957 const_cast<char **
>(kwlist),
969 if (!noise_basis_str) {
973 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"hybrid_multi_fractal") == -1)
985 vec[0], vec[1], vec[2],
H, lac, oct, ofs, gn, noise_basis_enum));
990 M_Noise_ridged_multi_fractal_doc,
991 ".. function:: ridged_multi_fractal(position, H, lacunarity, octaves, offset, gain, /, *, "
992 "noise_basis='PERLIN_ORIGINAL')\n"
994 " Returns ridged multifractal value from the noise basis at the specified position.\n"
996 " :param position: The position to evaluate the selected noise function.\n"
997 " :type position: :class:`mathutils.Vector`\n"
998 " :param H: The fractal dimension of the roughest areas.\n"
1000 " :param lacunarity: The gap between successive frequencies.\n"
1001 " :type lacunarity: float\n"
1002 " :param octaves: The number of different noise frequencies used.\n"
1003 " :type octaves: float\n"
1004 " :param offset: The height of the terrain above 'sea level'.\n"
1005 " :type offset: float\n"
1006 " :param gain: Scaling applied to the values.\n"
1008 " :return: The ridged multifractal value.\n"
1009 " :rtype: float\n");
1012 static const char *kwlist[] = {
"",
"",
"",
"",
"",
"",
"noise_basis",
nullptr};
1015 const char *noise_basis_str =
nullptr;
1016 float H, lac, oct, ofs, gn;
1019 if (!PyArg_ParseTupleAndKeywords(args,
1029 ":ridged_multi_fractal",
1030 const_cast<char **
>(kwlist),
1042 if (!noise_basis_str) {
1046 bpy_noise_types, noise_basis_str, &noise_basis_enum,
"ridged_multi_fractal") == -1)
1058 vec[0], vec[1], vec[2],
H, lac, oct, ofs, gn, noise_basis_enum));
1063 M_Noise_voronoi_doc,
1064 ".. function:: voronoi(position, /, *, distance_metric='DISTANCE', exponent=2.5)\n"
1066 " Returns a list of distances to the four closest features and their locations.\n"
1068 " :param position: The position to evaluate the selected noise function.\n"
1070 " :param exponent: The exponent for Minkowski distance metric.\n"
1071 " :type exponent: float\n"
1072 " :return: A list of distances to the four closest features and their locations.\n"
1073 " :rtype: list[list[float] | list[:class:`mathutils.Vector`]]\n");
1076 static const char *kwlist[] = {
"",
"distance_metric",
"exponent",
nullptr};
1081 const char *metric_str =
nullptr;
1082 float da[4], pa[12];
1088 if (!PyArg_ParseTupleAndKeywords(args,
1095 const_cast<char **
>(kwlist),
1114 list = PyList_New(4);
1118 for (i = 0; i < 4; i++) {
1120 PyList_SET_ITEM(
list, i,
v);
1123 ret = Py_BuildValue(
"[[ffff]O]", da[0], da[1], da[2], da[3],
list);
1131 ".. function:: cell(position, /)\n"
1133 " Returns cell noise value at the specified position.\n"
1135 " :param position: The position to evaluate the cell noise at.\n"
1136 " :type position: :class:`mathutils.Vector`\n"
1137 " :return: The cell noise value.\n"
1138 " :rtype: float\n");
1144 if (!PyArg_ParseTuple(args,
1156 return PyFloat_FromDouble(
BLI_noise_cell(vec[0], vec[1], vec[2]));
1161 M_Noise_cell_vector_doc,
1162 ".. function:: cell_vector(position, /)\n"
1164 " Returns cell noise vector at the specified position.\n"
1166 " :param position: The position to evaluate the cell noise at.\n"
1167 " :type position: :class:`mathutils.Vector`\n"
1168 " :return: The cell noise vector.\n"
1169 " :rtype: :class:`mathutils.Vector`\n");
1173 float vec[3], r_vec[3];
1175 if (!PyArg_ParseTuple(args,
1193# pragma clang diagnostic push
1194# pragma clang diagnostic ignored "-Wcast-function-type"
1196# pragma GCC diagnostic push
1197# pragma GCC diagnostic ignored "-Wcast-function-type"
1202 {
"seed_set",
static_cast<PyCFunction
>(
M_Noise_seed_set), METH_VARARGS, M_Noise_seed_set_doc},
1203 {
"random",
reinterpret_cast<PyCFunction
>(
M_Noise_random), METH_NOARGS, M_Noise_random_doc},
1204 {
"random_unit_vector",
1206 METH_VARARGS | METH_KEYWORDS,
1207 M_Noise_random_unit_vector_doc},
1210 METH_VARARGS | METH_KEYWORDS,
1211 M_Noise_random_vector_doc},
1214 METH_VARARGS | METH_KEYWORDS,
1218 METH_VARARGS | METH_KEYWORDS,
1219 M_Noise_noise_vector_doc},
1222 METH_VARARGS | METH_KEYWORDS,
1223 M_Noise_turbulence_doc},
1224 {
"turbulence_vector",
1226 METH_VARARGS | METH_KEYWORDS,
1227 M_Noise_turbulence_vector_doc},
1230 METH_VARARGS | METH_KEYWORDS,
1231 M_Noise_fractal_doc},
1234 METH_VARARGS | METH_KEYWORDS,
1235 M_Noise_multi_fractal_doc},
1236 {
"variable_lacunarity",
1238 METH_VARARGS | METH_KEYWORDS,
1239 M_Noise_variable_lacunarity_doc},
1242 METH_VARARGS | METH_KEYWORDS,
1243 M_Noise_hetero_terrain_doc},
1244 {
"hybrid_multi_fractal",
1246 METH_VARARGS | METH_KEYWORDS,
1247 M_Noise_hybrid_multi_fractal_doc},
1248 {
"ridged_multi_fractal",
1250 METH_VARARGS | METH_KEYWORDS,
1251 M_Noise_ridged_multi_fractal_doc},
1254 METH_VARARGS | METH_KEYWORDS,
1255 M_Noise_voronoi_doc},
1256 {
"cell",
static_cast<PyCFunction
>(
M_Noise_cell), METH_VARARGS, M_Noise_cell_doc},
1260 M_Noise_cell_vector_doc},
1261 {
nullptr,
nullptr, 0,
nullptr},
1266# pragma clang diagnostic pop
1268# pragma GCC diagnostic pop
1275 "The Blender noise module.");
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
SIMD_FORCE_INLINE btScalar norm() const
Return the norm (length) of the vector.
#define BPY_NOISE_BASIS_ENUM_DOC
#define DEFAULT_METRIC_TYPE
#define BPY_NOISE_METRIC_ENUM_DOC
#define DEFAULT_NOISE_TYPE
float BLI_noise_mg_ridged_multi_fractal(float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis)
PyMODINIT_FUNC PyInit_mathutils_noise()
static void rand_vn(float *array_tar, const int size)
static PyMethodDef M_Noise_methods[]
float normalize_vn(float *array_tar, int size)
static PyObject * M_Noise_variable_lacunarity(PyObject *, PyObject *args, PyObject *kw)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyObject * M_Noise_multi_fractal(PyObject *, PyObject *args, PyObject *kw)
static PyObject * M_Noise_random_unit_vector(PyObject *, PyObject *args, PyObject *kw)
float BLI_noise_generic_noise(float noisesize, float x, float y, float z, bool hard, int noisebasis)
int PyC_FlagSet_ValueFromID(const PyC_FlagSet *item, const char *identifier, int *r_value, const char *error_prefix)
float BLI_noise_mg_hybrid_multi_fractal(float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis)
static void noise_vector(float x, float y, float z, int nb, float v[3])
ATTR_WARN_UNUSED_RESULT const BMVert * v
float BLI_noise_mg_multi_fractal(float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
static PyObject * M_Noise_cell_vector(PyObject *, PyObject *args)
static PyObject * M_Noise_turbulence_vector(PyObject *, PyObject *args, PyObject *kw)
PyObject * Vector_CreatePyObject_alloc(float *vec, const int vec_num, PyTypeObject *base_type)
float BLI_noise_mg_hetero_terrain(float x, float y, float z, float H, float lacunarity, float octaves, float offset, int noisebasis)
static PyC_FlagSet bpy_noise_metrics[]
static PyC_FlagSet bpy_noise_types[]
static PyObject * M_Noise_noise(PyObject *, PyObject *args, PyObject *kw)
static PyObject * M_Noise_ridged_multi_fractal(PyObject *, PyObject *args, PyObject *kw)
static void init_genrand(ulong s)
PyObject * Vector_CreatePyObject(const float *vec, const int vec_num, PyTypeObject *base_type)
static void vTurb(float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale, float v[3])
void BLI_noise_voronoi(float x, float y, float z, float *da, float *pa, float me, int dtype)
float BLI_noise_mg_fbm(float x, float y, float z, float H, float lacunarity, float octaves, int noisebasis)
static PyObject * M_Noise_voronoi(PyObject *, PyObject *args, PyObject *kw)
static PyObject * M_Noise_noise_vector(PyObject *, PyObject *args, PyObject *kw)
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
static void setRndSeed(int seed)
float BLI_noise_mg_variable_lacunarity(float x, float y, float z, float distortion, int nbas1, int nbas2)
static PyObject * M_Noise_hybrid_multi_fractal(PyObject *, PyObject *args, PyObject *kw)
static float state_offset_vector[3 *3]
float BLI_noise_cell(float x, float y, float z)
static PyObject * M_Noise_random_vector(PyObject *, PyObject *args, PyObject *kw)
void BLI_noise_cell_v3(float x, float y, float z, float r_ca[3])
static PyObject * M_Noise_random(PyObject *)
static float turb(float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale)
static PyObject * M_Noise_cell(PyObject *, PyObject *args)
static PyObject * M_Noise_hetero_terrain(PyObject *, PyObject *args, PyObject *kw)
static PyObject * M_Noise_fractal(PyObject *, PyObject *args, PyObject *kw)
static PyModuleDef M_Noise_module_def
static PyObject * M_Noise_turbulence(PyObject *, PyObject *args, PyObject *kw)
static PyObject * M_Noise_seed_set(PyObject *, PyObject *args)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float