|
Blender V5.3
|
#include <ctime>#include <Python.h>#include "BLI_math_vector_c.hh"#include "BLI_noise_c.hh"#include "BLI_utildefines.hh"#include "DNA_texture_types.h"#include "../generic/py_capi_utils.hh"#include "mathutils.hh"#include "mathutils_noise.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| BMesh Iterators. | |
Macros | |
| #define | N 624 |
| #define | M 397 |
| #define | MATRIX_A 0x9908b0dfUL |
| #define | UMASK 0x80000000UL |
| #define | LMASK 0x7fffffffUL |
| #define | MIXBITS(u, v) |
| #define | TWIST(u, v) |
| #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 | blender::init_genrand (ulong s) |
| static void | blender::next_state () |
| static void | blender::setRndSeed (int seed) |
| static float | blender::frand () |
| static void | blender::rand_vn (float *array_tar, const int size) |
| static void | blender::noise_vector (float x, float y, float z, int nb, float v[3]) |
| static float | blender::turb (float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale) |
| static void | blender::vTurb (float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale, float v[3]) |
| blender::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 * | blender::M_Noise_random (PyObject *) |
| blender::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" " :param 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 * | blender::M_Noise_random_unit_vector (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param size: The size of the vector to be produced, must be 2 or greater.\n" " :type size: int\n" " :return: The random vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | blender::M_Noise_random_vector (PyObject *, PyObject *args, PyObject *kw) |
| blender::PyDoc_STRVAR (M_Noise_seed_set_doc, ".. function:: seed_set(seed, /)\n" "\n" " Sets the random seed used for random_unit_vector, random_vector, and random.\n" "\n" " :param 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 * | blender::M_Noise_seed_set (PyObject *, PyObject *args) |
| blender::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" " :param 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 * | blender::M_Noise_noise (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param 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 * | blender::M_Noise_noise_vector (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :param hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: bool\n" BPY_NOISE_BASIS_ENUM_DOC " :param amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :param frequency_scale: The frequency scaling factor.\n" " :type frequency_scale: float\n" " :return: The turbulence value.\n" " :rtype: float\n") | |
| static PyObject * | blender::M_Noise_turbulence (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: int\n" " :param hard: Specifies whether returned turbulence is hard (sharp transitions) or " "soft (smooth transitions).\n" " :type hard: bool\n" BPY_NOISE_BASIS_ENUM_DOC " :param amplitude_scale: The amplitude scaling factor.\n" " :type amplitude_scale: float\n" " :param frequency_scale: The frequency scaling factor.\n" " :type frequency_scale: float\n" " :return: The turbulence vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | blender::M_Noise_turbulence_vector (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param H: The fractal increment parameter.\n" " :type H: float\n" " :param lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The fractal Brownian motion noise value.\n" " :rtype: float\n") | |
| static PyObject * | blender::M_Noise_fractal (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param H: Determines the highest fractal dimension.\n" " :type H: float\n" " :param lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: float\n" BPY_NOISE_BASIS_ENUM_DOC " :return: The multifractal noise value.\n" " :rtype: float\n") | |
| static PyObject * | blender::M_Noise_multi_fractal (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param distortion: The amount of distortion.\n" " :type distortion: float\n" " :param noise_type1: A noise type string.\n" " :type noise_type1: Literal['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " "'VORONOI_F1', 'VORONOI_F2', " "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " "'CELLNOISE']\n" " :param noise_type2: A noise type string.\n" " :type noise_type2: Literal['BLENDER', 'PERLIN_ORIGINAL', 'PERLIN_NEW', " "'VORONOI_F1', 'VORONOI_F2', " "'VORONOI_F3', 'VORONOI_F4', 'VORONOI_F2F1', 'VORONOI_CRACKLE', " "'CELLNOISE']\n" " :return: The variable lacunarity noise value.\n" " :rtype: float\n") | |
| static PyObject * | blender::M_Noise_variable_lacunarity (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :param lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: float\n" " :param 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 * | blender::M_Noise_hetero_terrain (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :param lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: float\n" " :param offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :param 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 * | blender::M_Noise_hybrid_multi_fractal (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" " :param H: The fractal dimension of the roughest areas.\n" " :type H: float\n" " :param lacunarity: The gap between successive frequencies.\n" " :type lacunarity: float\n" " :param octaves: The number of different noise frequencies used.\n" " :type octaves: float\n" " :param offset: The height of the terrain above 'sea level'.\n" " :type offset: float\n" " :param 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 * | blender::M_Noise_ridged_multi_fractal (PyObject *, PyObject *args, PyObject *kw) |
| blender::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" " :param position: The position to evaluate the selected noise function.\n" " :type position: :class:`mathutils.Vector`\n" BPY_NOISE_METRIC_ENUM_DOC " :param 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[list[float] | list[:class:`mathutils.Vector`]]\n") | |
| static PyObject * | blender::M_Noise_voronoi (PyObject *, PyObject *args, PyObject *kw) |
| blender::PyDoc_STRVAR (M_Noise_cell_doc, ".. function:: cell(position, /)\n" "\n" " Returns cell noise value at the specified position.\n" "\n" " :param position: The position to evaluate the cell noise at.\n" " :type position: :class:`mathutils.Vector`\n" " :return: The cell noise value.\n" " :rtype: float\n") | |
| static PyObject * | blender::M_Noise_cell (PyObject *, PyObject *args) |
| blender::PyDoc_STRVAR (M_Noise_cell_vector_doc, ".. function:: cell_vector(position, /)\n" "\n" " Returns cell noise vector at the specified position.\n" "\n" " :param position: The position to evaluate the cell noise at.\n" " :type position: :class:`mathutils.Vector`\n" " :return: The cell noise vector.\n" " :rtype: :class:`mathutils.Vector`\n") | |
| static PyObject * | blender::M_Noise_cell_vector (PyObject *, PyObject *args) |
| blender::PyDoc_STRVAR (M_Noise_doc, "The Blender noise module.") | |
| PyMODINIT_FUNC | blender::PyInit_mathutils_noise () |
Variables | |
| static ulong | blender::state [N] |
| static int | blender::left = 1 |
| static int | blender::initf = 0 |
| static ulong * | blender::next |
| static float | blender::state_offset_vector [3 *3] |
| static PyC_FlagSet | blender::bpy_noise_types [] |
| static PyC_FlagSet | blender::bpy_noise_metrics [] |
| static PyMethodDef | blender::M_Noise_methods [] |
| static PyModuleDef | blender::M_Noise_module_def |
This file defines the 'noise' module, a general purpose module to access blenders noise functions.
Definition in file mathutils_noise.cc.
| #define BPY_NOISE_BASIS_ENUM_DOC |
Definition at line 151 of file mathutils_noise.cc.
Referenced by blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), blender::PyDoc_STRVAR(), and blender::PyDoc_STRVAR().
| #define BPY_NOISE_METRIC_ENUM_DOC |
Definition at line 158 of file mathutils_noise.cc.
Referenced by blender::PyDoc_STRVAR().
| #define DEFAULT_METRIC_TYPE TEX_DISTANCE |
Definition at line 182 of file mathutils_noise.cc.
Referenced by blender::M_Noise_voronoi().
| #define DEFAULT_NOISE_TYPE TEX_STDPERLIN |
Definition at line 165 of file mathutils_noise.cc.
Referenced by blender::M_Noise_fractal(), blender::M_Noise_hetero_terrain(), blender::M_Noise_hybrid_multi_fractal(), blender::M_Noise_multi_fractal(), blender::M_Noise_noise(), blender::M_Noise_noise_vector(), blender::M_Noise_ridged_multi_fractal(), blender::M_Noise_turbulence(), blender::M_Noise_turbulence_vector(), and blender::M_Noise_variable_lacunarity().
| #define LMASK 0x7fffffffUL |
Definition at line 55 of file mathutils_noise.cc.
| #define M 397 |
Definition at line 52 of file mathutils_noise.cc.
Referenced by btDeformableNeoHookeanForce::addScaledCofactorMatrixDifferential(), iTaSC::Armature::addSegment(), blender::adjoint_m2_m2(), blender::adjoint_m3_m3(), blender::adjoint_m4_m4(), blender::BKE_ocean_is_valid(), bsdf_hair_huang_eval_residual(), SubPatch::calc_num_inner_verts(), SubPatch::calc_num_triangles(), Freestyle::SilhouetteGeomEngine::CameraToImage(), CreateMatrix(), blender::dot_m3_v3_row_x(), blender::dot_m3_v3_row_y(), blender::dot_m3_v3_row_z(), blender::dot_m4_v3_row_x(), blender::dot_m4_v3_row_y(), blender::dot_m4_v3_row_z(), EIG_invert_m4_m4(), EIG_linear_solver_solve(), libmv::euclidean_resection::EuclideanResectionAnsarDaniilidis(), libmv::euclidean_resection::EuclideanResectionEPnP(), blender::eulO_to_mat3(), draw::gsplat::get_covmat(), SubPatch::get_vert_along_grid_edge(), blender::IMB_colormanagement_working_space_convert(), blender::math::invert(), Freestyle::NodeTransform::isScaled(), blender::mat3_to_size(), blender::mat4_to_size(), blender::mat4_to_size_fix_shear(), blender::mat4_to_size_max_axis(), Freestyle::VecMat::Matrix< T, M, N >::Matrix(), blender::mul_m3_v3(), blender::mul_m3_v3_db(), blender::mul_m4_v3(), blender::mul_transposed_m3_v3(), blender::mul_transposed_mat3_m4_v3(), blender::mul_v2_m3v3(), blender::mul_v3_m3v3(), blender::mul_v3_m3v3_db(), blender::mul_v3m3_dq(), blender::mul_v4_m4v3(), blender::next_state(), blender::normalize_m2_m2(), blender::normalize_m3_m3(), Freestyle::VecMat::operator*(), Freestyle::VecMat::Matrix< T, M, N >::operator*=(), Freestyle::VecMat::Matrix< T, M, N >::operator+=(), Freestyle::VecMat::Matrix< T, M, N >::operator-=(), Freestyle::VecMat::Matrix< T, M, N >::operator/=(), Freestyle::VecMat::operator<<(), Freestyle::VecMat::Matrix< T, M, N >::operator=(), blender::geometry::p_chart_correct_degenerate_triangle_point(), blender::geometry::p_chart_correct_degenerate_triangles2(), projection_inverse(), projection_inverse_impl(), Freestyle::SilhouetteGeomEngine::ProjectSilhouette(), KDL::RotationVel::Rot2(), Freestyle::VecMat::Matrix< T, M, N >::rows(), blender::SIM_mass_spring_add_block(), iTaSC::WSDLSSolver::solve(), btLemkeSolver::solveMLCP(), Freestyle::SphericalGrid::Transform::sphericalProjection(), Freestyle::SphericalGrid::Transform::Transform(), transform_decompose(), blender::math::transform_point(), Freestyle::VecMat::Matrix< T, M, N >::transpose(), blender::transpose_m3_m3(), blender::transpose_m3_m4(), blender::transpose_m4_m4(), EdgeDice::tri_dice(), IK_QSphericalSegment::UpdateAngle(), IK_QSwingSegment::UpdateAngle(), Freestyle::SilhouetteGeomEngine::WorldToImage(), and Freestyle::VecMat::Matrix< T, M, N >::~Matrix().
| #define MATRIX_A 0x9908b0dfUL |
Definition at line 53 of file mathutils_noise.cc.
| #define MIXBITS | ( | u, | |
| v ) |
Definition at line 56 of file mathutils_noise.cc.
| #define N 624 |
Definition at line 51 of file mathutils_noise.cc.
| #define TWIST | ( | u, | |
| v ) |
| #define UMASK 0x80000000UL |
Definition at line 54 of file mathutils_noise.cc.