|
Blender
V2.93
|
#include <Python.h>#include "mathutils.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "../generic/py_capi_utils.h"#include "BLI_dynstr.h"Go to the source code of this file.
Macros | |
| #define | MAX_DIMENSIONS 4 |
| #define | SWIZZLE_BITS_PER_AXIS 3 |
| #define | SWIZZLE_VALID_AXIS 0x4 |
| #define | SWIZZLE_AXIS 0x3 |
| #define | _SWIZZLE1(a) ((a) | SWIZZLE_VALID_AXIS) |
| #define | _SWIZZLE2(a, b) (_SWIZZLE1(a) | (((b) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS))) |
| #define | _SWIZZLE3(a, b, c) (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))) |
| #define | _SWIZZLE4(a, b, c, d) (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) |
| #define | SWIZZLE2(a, b) POINTER_FROM_INT(_SWIZZLE2(a, b)) |
| #define | SWIZZLE3(a, b, c) POINTER_FROM_INT(_SWIZZLE3(a, b, c)) |
| #define | SWIZZLE4(a, b, c, d) POINTER_FROM_INT(_SWIZZLE4(a, b, c, d)) |
Functions | |
| static PyObject * | Vector_copy (VectorObject *self) |
| static PyObject * | Vector_deepcopy (VectorObject *self, PyObject *args) |
| static PyObject * | Vector_to_tuple_ex (VectorObject *self, int ndigits) |
| static int | row_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) |
| static PyObject * | Vector_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
| static PyObject * | vec__apply_to_copy (PyObject *(*vec_func)(VectorObject *), VectorObject *self) |
| PyDoc_STRVAR (C_Vector_Fill_doc, ".. classmethod:: Fill(size, fill=0.0)\n" "\n" " Create a vector of length size with all values set to fill.\n" "\n" " :arg size: The length of the vector to be created.\n" " :type size: int\n" " :arg fill: The value used to fill the vector.\n" " :type fill: float\n") | |
| static PyObject * | C_Vector_Fill (PyObject *cls, PyObject *args) |
| PyDoc_STRVAR (C_Vector_Range_doc, ".. classmethod:: Range(start=0, stop, step=1)\n" "\n" " Create a filled with a range of values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg step: The step between successive values in the vector.\n" " :type step: int\n") | |
| static PyObject * | C_Vector_Range (PyObject *cls, PyObject *args) |
| PyDoc_STRVAR (C_Vector_Linspace_doc, ".. classmethod:: Linspace(start, stop, size)\n" "\n" " Create a vector of the specified size which is filled with linearly spaced " "values between start and stop values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n") | |
| static PyObject * | C_Vector_Linspace (PyObject *cls, PyObject *args) |
| PyDoc_STRVAR (C_Vector_Repeat_doc, ".. classmethod:: Repeat(vector, size)\n" "\n" " Create a vector by repeating the values in vector until the required size is reached.\n" "\n" " :arg tuple: The vector to draw values from.\n" " :type tuple: :class:`mathutils.Vector`\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n") | |
| static PyObject * | C_Vector_Repeat (PyObject *cls, PyObject *args) |
| PyDoc_STRVAR (Vector_zero_doc, ".. method:: zero()\n" "\n" " Set all values to zero.\n") | |
| static PyObject * | Vector_zero (VectorObject *self) |
| PyDoc_STRVAR (Vector_normalize_doc, ".. method:: normalize()\n" "\n" " Normalize the vector, making the length of the vector always 1.0.\n" "\n" " .. warning:: Normalizing a vector where all values are zero has no effect.\n" "\n" " .. note:: Normalize works for vectors of all sizes,\n" " however 4D Vectors w axis is left untouched.\n") | |
| static PyObject * | Vector_normalize (VectorObject *self) |
| PyDoc_STRVAR (Vector_normalized_doc, ".. method:: normalized()\n" "\n" " Return a new, normalized vector.\n" "\n" " :return: a normalized copy of the vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_normalized (VectorObject *self) |
| PyDoc_STRVAR (Vector_resize_doc, ".. method:: resize(size=3)\n" "\n" " Resize the vector to have size number of elements.\n") | |
| static PyObject * | Vector_resize (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_resized_doc, ".. method:: resized(size=3)\n" "\n" " Return a resized copy of the vector with size number of elements.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_resized (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_resize_2d_doc, ".. method:: resize_2d()\n" "\n" " Resize the vector to 2D (x, y).\n") | |
| static PyObject * | Vector_resize_2d (VectorObject *self) |
| PyDoc_STRVAR (Vector_resize_3d_doc, ".. method:: resize_3d()\n" "\n" " Resize the vector to 3D (x, y, z).\n") | |
| static PyObject * | Vector_resize_3d (VectorObject *self) |
| PyDoc_STRVAR (Vector_resize_4d_doc, ".. method:: resize_4d()\n" "\n" " Resize the vector to 4D (x, y, z, w).\n") | |
| static PyObject * | Vector_resize_4d (VectorObject *self) |
| PyDoc_STRVAR (Vector_to_2d_doc, ".. method:: to_2d()\n" "\n" " Return a 2d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_to_2d (VectorObject *self) |
| PyDoc_STRVAR (Vector_to_3d_doc, ".. method:: to_3d()\n" "\n" " Return a 3d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_to_3d (VectorObject *self) |
| PyDoc_STRVAR (Vector_to_4d_doc, ".. method:: to_4d()\n" "\n" " Return a 4d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_to_4d (VectorObject *self) |
| PyDoc_STRVAR (Vector_to_tuple_doc, ".. method:: to_tuple(precision=-1)\n" "\n" " Return this vector as a tuple with.\n" "\n" " :arg precision: The number to round the value to in [-1, 21].\n" " :type precision: int\n" " :return: the values of the vector rounded by *precision*\n" " :rtype: tuple\n") | |
| static PyObject * | Vector_to_tuple (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_to_track_quat_doc, ".. method:: to_track_quat(track, up)\n" "\n" " Return a quaternion rotation from the vector and the track and up axis.\n" "\n" " :arg track: Track axis in ['X', 'Y', 'Z', '-X', '-Y', '-Z'].\n" " :type track: string\n" " :arg up: Up axis in ['X', 'Y', 'Z'].\n" " :type up: string\n" " :return: rotation from the vector and the track and up axis.\n" " :rtype: :class:`Quaternion`\n") | |
| static PyObject * | Vector_to_track_quat (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_orthogonal_doc, ".. method:: orthogonal()\n" "\n" " Return a perpendicular vector.\n" "\n" " :return: a new vector 90 degrees from this vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: the axis is undefined, only use when any orthogonal vector is acceptable.\n") | |
| static PyObject * | Vector_orthogonal (VectorObject *self) |
| PyDoc_STRVAR (Vector_reflect_doc, ".. method:: reflect(mirror)\n" "\n" " Return the reflection vector from the *mirror* argument.\n" "\n" " :arg mirror: This vector could be a normal from the reflecting surface.\n" " :type mirror: :class:`Vector`\n" " :return: The reflected vector matching the size of this vector.\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_reflect (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_cross_doc, ".. method:: cross(other)\n" "\n" " Return the cross product of this vector and another.\n" "\n" " :arg other: The other vector to perform the cross product with.\n" " :type other: :class:`Vector`\n" " :return: The cross product.\n" " :rtype: :class:`Vector` or float when 2D vectors are used\n" "\n" " .. note:: both vectors must be 2D or 3D\n") | |
| static PyObject * | Vector_cross (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_dot_doc, ".. method:: dot(other)\n" "\n" " Return the dot product of this vector and another.\n" "\n" " :arg other: The other vector to perform the dot product with.\n" " :type other: :class:`Vector`\n" " :return: The dot product.\n" " :rtype: float\n") | |
| static PyObject * | Vector_dot (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_angle_doc, ".. function:: angle(other, fallback=None)\n" "\n" " Return the angle between two vectors.\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: angle in radians or fallback when given\n" " :rtype: float\n") | |
| static PyObject * | Vector_angle (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_angle_signed_doc, ".. function:: angle_signed(other, fallback)\n" "\n" " Return the signed angle between two 2D vectors (clockwise is positive).\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: angle in radians or fallback when given\n" " :rtype: float\n") | |
| static PyObject * | Vector_angle_signed (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_rotation_difference_doc, ".. function:: rotation_difference(other)\n" "\n" " Returns a quaternion representing the rotational difference between this\n" " vector and another.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the rotational difference between the two vectors.\n" " :rtype: :class:`Quaternion`\n" "\n" " .. note:: 2D vectors raise an :exc:`AttributeError`.\n") | |
| static PyObject * | Vector_rotation_difference (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_project_doc, ".. function:: project(other)\n" "\n" " Return the projection of this vector onto the *other*.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the parallel projection vector\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_project (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_lerp_doc, ".. function:: lerp(other, factor)\n" "\n" " Returns the interpolation of two vectors.\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value in [0.0, 1.0].\n" " :type factor: float\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_lerp (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_slerp_doc, ".. function:: slerp(other, factor, fallback=None)\n" "\n" " Returns the interpolation of two non-zero vectors (spherical coordinates).\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value typically in [0.0, 1.0].\n" " :type factor: float\n" " :arg fallback: return this when the vector can't be calculated (zero length " "vector or direct opposites),\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: any\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n") | |
| static PyObject * | Vector_slerp (VectorObject *self, PyObject *args) |
| PyDoc_STRVAR (Vector_rotate_doc, ".. function:: rotate(other)\n" "\n" " Rotate the vector by a rotation value.\n" "\n" " .. note:: 2D vectors are a special case that can only be rotated by a 2x2 matrix.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n") | |
| static PyObject * | Vector_rotate (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_copy_doc, ".. function:: copy()\n" "\n" " Returns a copy of this vector.\n" "\n" " :return: A copy of the vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: use this to get a copy of a wrapped vector with\n" " no reference to the original data.\n") | |
| static PyObject * | Vector_repr (VectorObject *self) |
| static PyObject * | Vector_str (VectorObject *self) |
| static int | Vector_len (VectorObject *self) |
| static PyObject * | vector_item_internal (VectorObject *self, int i, const bool is_attr) |
| static PyObject * | Vector_item (VectorObject *self, int i) |
| static int | vector_ass_item_internal (VectorObject *self, int i, PyObject *value, const bool is_attr) |
| static int | Vector_ass_item (VectorObject *self, int i, PyObject *value) |
| static PyObject * | Vector_slice (VectorObject *self, int begin, int end) |
| static int | Vector_ass_slice (VectorObject *self, int begin, int end, PyObject *seq) |
| static PyObject * | Vector_add (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_iadd (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_sub (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_isub (PyObject *v1, PyObject *v2) |
| int | column_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat) |
| static PyObject * | vector_mul_float (VectorObject *vec, const float scalar) |
| static PyObject * | vector_mul_vec (VectorObject *vec1, VectorObject *vec2) |
| static PyObject * | Vector_mul (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_imul (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_matmul (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_imatmul (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_div (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_idiv (PyObject *v1, PyObject *v2) |
| static PyObject * | Vector_neg (VectorObject *self) |
| static PyObject * | Vector_richcmpr (PyObject *objectA, PyObject *objectB, int comparison_type) |
| static Py_hash_t | Vector_hash (VectorObject *self) |
| static PyObject * | Vector_subscript (VectorObject *self, PyObject *item) |
| static int | Vector_ass_subscript (VectorObject *self, PyObject *item, PyObject *value) |
| PyDoc_STRVAR (Vector_axis_x_doc, "Vector X axis.\n\n:type: float") | |
| PyDoc_STRVAR (Vector_axis_y_doc, "Vector Y axis.\n\n:type: float") | |
| PyDoc_STRVAR (Vector_axis_z_doc, "Vector Z axis (3D Vectors only).\n\n:type: float") | |
| PyDoc_STRVAR (Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n\n:type: float") | |
| static PyObject * | Vector_axis_get (VectorObject *self, void *type) |
| static int | Vector_axis_set (VectorObject *self, PyObject *value, void *type) |
| PyDoc_STRVAR (Vector_length_doc, "Vector Length.\n\n:type: float") | |
| static PyObject * | Vector_length_get (VectorObject *self, void *UNUSED(closure)) |
| static int | Vector_length_set (VectorObject *self, PyObject *value) |
| PyDoc_STRVAR (Vector_length_squared_doc, "Vector length squared (v.dot(v)).\n\n:type: float") | |
| static PyObject * | Vector_length_squared_get (VectorObject *self, void *UNUSED(closure)) |
| static PyObject * | Vector_swizzle_get (VectorObject *self, void *closure) |
| static int | Vector_swizzle_set (VectorObject *self, PyObject *value, void *closure) |
| PyDoc_STRVAR (Vector_negate_doc, ".. method:: negate()\n" "\n" " Set all values to their negative.\n") | |
| static PyObject * | Vector_negate (VectorObject *self) |
| PyDoc_STRVAR (vector_doc, ".. class:: Vector(seq)\n" "\n" " This object gives access to Vectors in Blender.\n" "\n" " :param seq: Components of the vector, must be a sequence of at least two\n" " :type seq: sequence of numbers\n") | |
| PyObject * | Vector_CreatePyObject (const float *vec, const int size, PyTypeObject *base_type) |
| PyObject * | Vector_CreatePyObject_wrap (float *vec, const int size, PyTypeObject *base_type) |
| PyObject * | Vector_CreatePyObject_cb (PyObject *cb_user, int size, uchar cb_type, uchar cb_subtype) |
| PyObject * | Vector_CreatePyObject_alloc (float *vec, const int size, PyTypeObject *base_type) |
Variables | |
| static PySequenceMethods | Vector_SeqMethods |
| static PyMappingMethods | Vector_AsMapping |
| static PyNumberMethods | Vector_NumMethods |
| static PyGetSetDef | Vector_getseters [] |
| static struct PyMethodDef | Vector_methods [] |
| PyTypeObject | vector_Type |
| #define _SWIZZLE1 | ( | a | ) | ((a) | SWIZZLE_VALID_AXIS) |
Definition at line 2518 of file mathutils_Vector.c.
| #define _SWIZZLE2 | ( | a, | |
| b | |||
| ) | (_SWIZZLE1(a) | (((b) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS))) |
Definition at line 2519 of file mathutils_Vector.c.
| #define _SWIZZLE3 | ( | a, | |
| b, | |||
| c | |||
| ) | (_SWIZZLE2(a, b) | (((c) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 2))) |
Definition at line 2520 of file mathutils_Vector.c.
| #define _SWIZZLE4 | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | (_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3))) |
Definition at line 2522 of file mathutils_Vector.c.
| #define MAX_DIMENSIONS 4 |
Higher dimensions are supported, for many common operations (dealing with vector/matrix multiply or handling as 3D locations) stack memory is used with a fixed size - defined here.
Definition at line 39 of file mathutils_Vector.c.
| #define SWIZZLE2 | ( | a, | |
| b | |||
| ) | POINTER_FROM_INT(_SWIZZLE2(a, b)) |
Definition at line 2525 of file mathutils_Vector.c.
| #define SWIZZLE3 | ( | a, | |
| b, | |||
| c | |||
| ) | POINTER_FROM_INT(_SWIZZLE3(a, b, c)) |
Definition at line 2526 of file mathutils_Vector.c.
| #define SWIZZLE4 | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | POINTER_FROM_INT(_SWIZZLE4(a, b, c, d)) |
Definition at line 2527 of file mathutils_Vector.c.
| #define SWIZZLE_AXIS 0x3 |
Definition at line 46 of file mathutils_Vector.c.
| #define SWIZZLE_BITS_PER_AXIS 3 |
Definition at line 44 of file mathutils_Vector.c.
| #define SWIZZLE_VALID_AXIS 0x4 |
Definition at line 45 of file mathutils_Vector.c.
|
static |
Definition at line 122 of file mathutils_Vector.c.
References copy_vn_fl(), NULL, size(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 238 of file mathutils_Vector.c.
References NULL, range_vn_fl(), size(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 162 of file mathutils_Vector.c.
References NULL, range_vn_fl(), size(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 279 of file mathutils_Vector.c.
References mathutils_array_parse_alloc(), NULL, size(), and Vector_CreatePyObject_alloc().
| int column_vector_multiplication | ( | float | r_vec[MAX_DIMENSIONS], |
| VectorObject * | vec, | ||
| MatrixObject * | mat | ||
| ) |
Column vector multiplication (Matrix * Vector).
[1][4][7] [a] [2][5][8] * [b] [3][6][9] [c]
Definition at line 1690 of file mathutils_Vector.c.
References col, double(), float(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::num_col, MatrixObject::num_row, VectorObject::size, and z.
| PyDoc_STRVAR | ( | C_Vector_Fill_doc | , |
| ".. classmethod:: Fill(size, fill=0.0)\n" "\n" " Create a vector of length size with all values set to fill.\n" "\n" " :arg size: The length of the vector to be created.\n" " :type size: int\n" " :arg fill: The value used to fill the vector.\n" " :type fill: float\n" | |||
| ) |
| PyDoc_STRVAR | ( | C_Vector_Linspace_doc | , |
| ".. classmethod:: Linspace(start, stop, size)\n" "\n" " Create a vector of the specified size which is filled with linearly spaced " "values between start and stop values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n" | |||
| ) |
| PyDoc_STRVAR | ( | C_Vector_Range_doc | , |
| ".. classmethod:: Range(start=0, stop, step=1)\n" "\n" " Create a filled with a range of values.\n" "\n" " :arg start: The start of the range used to fill the vector.\n" " :type start: int\n" " :arg stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :arg step: The step between successive values in the vector.\n" " :type step: int\n" | |||
| ) |
| PyDoc_STRVAR | ( | C_Vector_Repeat_doc | , |
| ".. classmethod:: Repeat(vector, size)\n" "\n" " Create a vector by repeating the values in vector until the required size is reached.\n" "\n" " :arg tuple: The vector to draw values from.\n" " :type tuple: :class:`mathutils.Vector`\n" " :arg size: The size of the vector to be created.\n" " :type size: int\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_angle_doc | , |
| ".. function:: | angleother, fallback=None)\n" "\n" " Return the angle between two vectors.\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector, | ||
| \n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:angle in radians or fallback when given\n" " :rtype:float\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_angle_signed_doc | , |
| ".. function:: | angle_signedother, fallback)\n" "\n" " Return the signed angle between two 2D vectors (clockwise is positive).\n" "\n" " :arg other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :arg fallback: return this when the angle can't be calculated (zero length vector, | ||
| \n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:angle in radians or fallback when given\n" " :rtype:float\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_copy_doc | , |
| ".. function:: copy()\n" "\n" " Returns a copy of this vector.\n" "\n" " :return: A copy of the vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: use this to get a copy of a wrapped vector with\n" " no reference to the original data.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_cross_doc | , |
| ".. method:: cross(other)\n" "\n" " Return the cross product of this vector and another.\n" "\n" " :arg other: The other vector to perform the cross product with.\n" " :type other: :class:`Vector`\n" " :return: The cross product.\n" " :rtype: :class:`Vector` or float when 2D vectors are used\n" "\n" " .. note:: both vectors must be 2D or 3D\n" | |||
| ) |
| PyDoc_STRVAR | ( | vector_doc | , |
| ".. class:: Vector(seq)\n" "\n" " This object gives access to Vectors in Blender.\n" "\n" " :param seq: Components of the | vector, | ||
| must be a sequence of at least two\n" " :type seq:sequence of numbers\n" | |||
| ) |
Note: #Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing but this means for eg that (vec * mat) and (mat * vec) both get sent to Vector_mul and it needs to sort out the order
| PyDoc_STRVAR | ( | Vector_dot_doc | , |
| ".. method:: dot(other)\n" "\n" " Return the dot product of this vector and another.\n" "\n" " :arg other: The other vector to perform the dot product with.\n" " :type other: :class:`Vector`\n" " :return: The dot product.\n" " :rtype: float\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_length_doc | , |
| "Vector Length.\n\n:type: float" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_lerp_doc | , |
| ".. function:: lerp(other, factor)\n" "\n" " Returns the interpolation of two vectors.\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value in .\n" " :type factor: float\n" " :return: The interpolated vector.\n" " :rtype: :class:`Vector`\n" | [0.0, 1.0] | ||
| ) |
| PyDoc_STRVAR | ( | Vector_negate_doc | , |
| ".. method:: negate()\n" "\n" " Set all values to their negative.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_normalize_doc | , |
| ".. method:: normalize()\n" "\n" " Normalize the | vector, | ||
| making the length of the vector always 1.0.\n" "\n" " .. warning::Normalizing a vector where all values are zero has no effect.\n" "\n" " .. note::Normalize works for vectors of all | sizes, | ||
| \n" " however 4D Vectors w axis is left untouched.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_normalized_doc | , |
| ".. method:: normalized()\n" "\n" " Return a | new, | ||
| normalized vector.\n" "\n" " :return:a normalized copy of the vector\n" " :rtype::class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_orthogonal_doc | , |
| ".. method:: orthogonal()\n" "\n" " Return a perpendicular vector.\n" "\n" " :return: a new vector 90 degrees from this vector.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: the axis is | undefined, | ||
| only use when any orthogonal vector is acceptable.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_project_doc | , |
| ".. function:: project(other)\n" "\n" " Return the projection of this vector onto the *other*.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the parallel projection vector\n" " :rtype: :class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_reflect_doc | , |
| ".. method:: reflect(mirror)\n" "\n" " Return the reflection vector from the *mirror* argument.\n" "\n" " :arg mirror: This vector could be a normal from the reflecting surface.\n" " :type mirror: :class:`Vector`\n" " :return: The reflected vector matching the size of this vector.\n" " :rtype: :class:`Vector`\n" | |||
| ) |
Vector.reflect(mirror): return a reflected vector on the mirror normal.
vec - ((2 * dot(vec, mirror)) * mirror)
| PyDoc_STRVAR | ( | Vector_resize_2d_doc | , |
| ".. method:: resize_2d()\n" "\n" " Resize the vector to 2D (x, y).\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_resize_3d_doc | , |
| ".. method:: resize_3d()\n" "\n" " Resize the vector to 3D (x, y, z).\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_resize_4d_doc | , |
| ".. method:: resize_4d()\n" "\n" " Resize the vector to 4D (x, y, z, w).\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_resize_doc | , |
| ".. method:: resize(size=3)\n" "\n" " Resize the vector to have size number of elements.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_resized_doc | , |
| ".. method:: resized(size=3)\n" "\n" " Return a resized copy of the vector with size number of elements.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_rotate_doc | , |
| ".. function:: rotate(other)\n" "\n" " Rotate the vector by a rotation value.\n" "\n" " .. note:: 2D vectors are a special case that can only be rotated by a 2x2 matrix.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler` | , | ||
| :class:`Quaternion` or :class:`Matrix`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_rotation_difference_doc | , |
| ".. function:: rotation_difference(other)\n" "\n" " Returns a quaternion representing the rotational difference between this\n" " vector and another.\n" "\n" " :arg other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the rotational difference between the two vectors.\n" " :rtype: :class:`Quaternion`\n" "\n" " .. note:: 2D vectors raise an :exc:`AttributeError`.\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_slerp_doc | , |
| ".. function:: | slerp(other, factor, fallback=None)\n" "\n" " Returns the interpolation of two non-zero vectors (spherical coordinates).\n" "\n" " :arg other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :arg factor: The interpolation value typically in .\n" " :type factor: float\n" " :arg fallback: return this when the vector can't be calculated (zero length " "vector or direct opposites)[0.0, 1.0], | ||
| \n" "(instead of raising a :exc:`ValueError`).\n" " :type fallback:any\n" " :return:The interpolated vector.\n" " :rtype::class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_to_2d_doc | , |
| ".. method:: to_2d()\n" "\n" " Return a 2d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_to_3d_doc | , |
| ".. method:: to_3d()\n" "\n" " Return a 3d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_to_4d_doc | , |
| ".. method:: to_4d()\n" "\n" " Return a 4d copy of the vector.\n" "\n" " :return: a new vector\n" " :rtype: :class:`Vector`\n" | |||
| ) |
| PyDoc_STRVAR | ( | Vector_to_track_quat_doc | , |
| ".. method:: to_track_quat(track, up)\n" "\n" " Return a quaternion rotation from the vector and the track and up axis.\n" "\n" " :arg track: Track axis in .\n" " :type track: string\n" " :arg up: Up axis in .\n" " :type up: string\n" " :return: rotation from the vector and the track and up axis.\n" " :rtype: :class:`Quaternion`\n" | [ 'X', 'Y', 'Z', '-X', '-Y', '-Z'][ 'X', 'Y', 'Z'] | ||
| ) |
| PyDoc_STRVAR | ( | Vector_to_tuple_doc | , |
| ".. method:: to_tuple(precision=-1)\n" "\n" " Return this vector as a tuple with.\n" "\n" " :arg precision: The number to round the value to in .\n" " :type precision: int\n" " :return: the values of the vector rounded by *precision*\n" " :rtype: tuple\n" | [-1, 21] | ||
| ) |
| PyDoc_STRVAR | ( | Vector_zero_doc | , |
| ".. method:: zero()\n" "\n" " Set all values to zero.\n" | |||
| ) |
|
static |
Row vector multiplication - (Vector * Matrix)
[x][y][z] * [1][4][7]
[2][5][8]
[3][6][9]
Definition at line 2916 of file mathutils_Vector.c.
References BaseMath_ReadCallback, col, double(), float(), MATRIX_ITEM, MAX_DIMENSIONS, MatrixObject::num_col, MatrixObject::num_row, VectorObject::size, and z.
Referenced by Vector_matmul().
|
static |
Definition at line 99 of file mathutils_Vector.c.
References NULL, ret, and Vector_copy().
Referenced by Vector_normalized().
|
static |
Definition at line 1526 of file mathutils_Vector.c.
References add_vn_vnvn(), BaseMath_ReadCallback, NULL, VectorObject::size, v1, v2, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 965 of file mathutils_Vector.c.
References BaseMath_ReadCallback, double(), mathutils_array_parse(), MAX_DIMENSIONS, MIN2, NULL, saacos(), self, size(), sqrt(), and x.
|
static |
Definition at line 1029 of file mathutils_Vector.c.
References angle_signed_v2v2(), BaseMath_ReadCallback, is_zero_v2(), mathutils_array_parse(), NULL, and self.
|
static |
Definition at line 1457 of file mathutils_Vector.c.
References vector_ass_item_internal().
Referenced by Vector_ass_subscript().
|
static |
Definition at line 1415 of file mathutils_Vector.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, and self.
Referenced by Vector_ass_item(), and Vector_axis_set().
|
static |
Definition at line 1487 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, mathutils_array_parse_alloc(), MIN2, NULL, self, and size().
Referenced by Vector_ass_subscript().
|
static |
Definition at line 2170 of file mathutils_Vector.c.
References self, Vector_ass_item(), and Vector_ass_slice().
|
static |
Definition at line 2256 of file mathutils_Vector.c.
References POINTER_AS_INT, type, and vector_item_internal().
|
static |
Definition at line 2261 of file mathutils_Vector.c.
References POINTER_AS_INT, type, and vector_ass_item_internal().
|
static |
Definition at line 1322 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, self, and Vector_CreatePyObject().
Referenced by vec__apply_to_copy(), and Vector_deepcopy().
| PyObject* Vector_CreatePyObject | ( | const float * | vec, |
| const int | size, | ||
| PyTypeObject * | base_type | ||
| ) |
Definition at line 3120 of file mathutils_Vector.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, copy_vn_fl(), NULL, self, size(), UNLIKELY, and vector_Type.
Referenced by bpy_bmedge_calc_tangent(), bpy_bmface_calc_center_bounds(), bpy_bmface_calc_center_mean(), bpy_bmface_calc_center_median_weighted(), bpy_bmface_calc_tangent_edge(), bpy_bmface_calc_tangent_edge_diagonal(), bpy_bmface_calc_tangent_edge_pair(), bpy_bmface_calc_tangent_vert_diagonal(), bpy_bmloop_calc_normal(), bpy_bmloop_calc_tangent(), bpy_slot_to_py(), Freestyle_blendRamp(), Freestyle_evaluateColorRamp(), kdtree_nearest_to_py_tuple(), M_Geometry_barycentric_transform(), M_Geometry_closest_point_on_tri(), M_Geometry_interpolate_bezier(), M_Geometry_intersect_line_line(), M_Geometry_intersect_line_line_2d(), M_Geometry_intersect_line_plane(), M_Geometry_intersect_line_sphere(), M_Geometry_intersect_line_sphere_2d(), M_Geometry_intersect_plane_plane(), M_Geometry_intersect_point_line(), M_Geometry_intersect_point_tri(), M_Geometry_intersect_ray_tri(), M_Geometry_intersect_sphere_sphere_2d(), M_Geometry_normal(), M_Noise_noise_vector(), M_Noise_random_unit_vector(), M_Noise_turbulence_vector(), M_Noise_voronoi(), Matrix_decompose(), Matrix_matmul(), Matrix_to_scale(), Matrix_to_translation(), points_in_planes_fn(), py_bvhtree_nearest_to_py_tuple(), py_bvhtree_raycast_to_py_tuple(), pyrna_math_object_from_array(), pyrna_param_to_py(), Quaternion_axis_vector_get(), Quaternion_matmul(), Quaternion_to_axis_angle(), Quaternion_to_exponential_map(), Vector_copy(), Vector_CreatePyObject_cb(), Vector_cross(), Vector_from_Vec2f(), Vector_from_Vec3f(), Vector_from_Vec3r(), Vector_matmul(), Vector_orthogonal(), Vector_reflect(), Vector_slerp(), Vector_swizzle_get(), Vector_to_2d(), Vector_to_3d(), and Vector_to_4d().
| PyObject* Vector_CreatePyObject_alloc | ( | float * | vec, |
| const int | size, | ||
| PyTypeObject * | base_type | ||
| ) |
| vec | Initialized vector value to use in-place, allocated with #PyMem_Malloc |
Definition at line 3214 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, size(), and Vector_CreatePyObject_wrap().
Referenced by C_Vector_Fill(), C_Vector_Linspace(), C_Vector_Range(), C_Vector_Repeat(), M_Noise_random_vector(), Vector_add(), Vector_div(), Vector_lerp(), vector_mul_float(), vector_mul_vec(), Vector_neg(), Vector_new(), Vector_project(), Vector_resized(), and Vector_sub().
| PyObject* Vector_CreatePyObject_cb | ( | PyObject * | cb_user, |
| int | size, | ||
| uchar | cb_type, | ||
| uchar | cb_subtype | ||
| ) |
Create a vector where the value is defined by registered callbacks, see: Mathutils_RegisterCallback
Definition at line 3197 of file mathutils_Vector.c.
References NULL, size(), and Vector_CreatePyObject().
Referenced by BPy_BMLoopColor_CreatePyObject(), FEdgeSharp_normal_left_get(), FEdgeSharp_normal_right_get(), FEdgeSmooth_normal_get(), FrsMaterial_ambient_get(), FrsMaterial_diffuse_get(), FrsMaterial_emission_get(), FrsMaterial_line_get(), FrsMaterial_specular_get(), Matrix_item_col(), Matrix_item_row(), Matrix_slice(), Matrix_translation_get(), pyrna_math_object_from_array(), StrokeAttribute_thickness_get(), StrokeVertex_point_get(), SVertex_point_2d_get(), and SVertex_point_3d_get().
| PyObject* Vector_CreatePyObject_wrap | ( | float * | vec, |
| const int | size, | ||
| PyTypeObject * | base_type | ||
| ) |
Create a vector that wraps existing memory.
| vec | Use this vector in-place. |
Definition at line 3170 of file mathutils_Vector.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, NULL, size(), and vector_Type.
Referenced by bpy_bmface_normal_get(), BPy_BMLayerItem_GetItem(), bpy_bmloopuv_uv_get(), bpy_bmvert_co_get(), bpy_bmvert_normal_get(), bpy_bmvertskin_radius_get(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 894 of file mathutils_Vector.c.
References BaseMath_ReadCallback, cross_v2v2(), cross_v3_v3v3(), mathutils_array_parse(), NULL, ret, self, and Vector_CreatePyObject().
|
static |
Definition at line 1330 of file mathutils_Vector.c.
References NULL, PyC_CheckArgs_DeepCopy(), and Vector_copy().
|
static |
Definition at line 1930 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mul_vn_vn_fl(), NULL, VectorObject::size, v1, v2, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 933 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), mathutils_array_parse_alloc(), NULL, ret, and self.
|
static |
Definition at line 2107 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, mathutils_array_hash(), and self.
|
static |
Definition at line 1568 of file mathutils_Vector.c.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, NULL, VectorObject::size, v1, v2, and VectorObject_Check.
|
static |
Definition at line 1977 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), NULL, VectorObject::size, v1, and v2.
|
static |
Definition at line 1919 of file mathutils_Vector.c.
|
static |
Definition at line 1803 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mul_vn_fl(), mul_vn_vn(), NULL, VectorObject::size, v1, v2, and VectorObject_Check.
|
static |
Definition at line 1643 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, NULL, VectorObject::size, sub_vn_vn(), v1, v2, and VectorObject_Check.
|
static |
Definition at line 1410 of file mathutils_Vector.c.
References vector_item_internal().
Referenced by Vector_subscript().
|
static |
Definition at line 1384 of file mathutils_Vector.c.
References BaseMath_ReadIndexCallback, NULL, and self.
Referenced by Vector_axis_get(), and Vector_item().
|
static |
Definition at line 1379 of file mathutils_Vector.c.
|
static |
Definition at line 2269 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), NULL, self, and sqrt().
|
static |
Definition at line 2278 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), dot_vn_vn(), mul_vn_fl(), self, and sqrt().
|
static |
Definition at line 2324 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), NULL, and self.
|
static |
Definition at line 1160 of file mathutils_Vector.c.
References BaseMath_ReadCallback, interp_vn_vn(), mathutils_array_parse_alloc(), NULL, self, size(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 1856 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), MatrixObject_Check, MAX_DIMENSIONS, NULL, row_vector_multiplication(), VectorObject::size, v1, v2, Vector_CreatePyObject(), and VectorObject_Check.
|
static |
Definition at line 1751 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, VectorObject::size, v1, v2, vector_mul_float(), vector_mul_vec(), and VectorObject_Check.
|
static |
Definition at line 1723 of file mathutils_Vector.c.
References mul_vn_vn_fl(), NULL, VectorObject::size, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Definition at line 1737 of file mathutils_Vector.c.
References mul_vn_vnvn(), NULL, VectorObject::size, and Vector_CreatePyObject_alloc().
Referenced by Vector_mul().
|
static |
Definition at line 2011 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_vn_vn(), NULL, self, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 2958 of file mathutils_Vector.c.
|
static |
Supports 2D, 3D, and 4D vector objects both int and float values accepted. Mixed float and int values accepted. Ints are parsed to float
Definition at line 59 of file mathutils_Vector.c.
References copy_vn_fl(), mathutils_array_parse_alloc(), NULL, size(), type, and Vector_CreatePyObject_alloc().
|
static |
Definition at line 357 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, normalize_vn(), NULL, self, and size().
Referenced by Vector_normalized().
|
static |
Definition at line 376 of file mathutils_Vector.c.
References vec__apply_to_copy(), and Vector_normalize().
|
static |
Definition at line 808 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, ortho_v2_v2(), ortho_v3_v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1120 of file mathutils_Vector.c.
References BaseMath_ReadCallback, double(), float(), mathutils_array_parse_alloc(), NULL, self, size(), Vector_CreatePyObject_alloc(), and x.
|
static |
Definition at line 848 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), NULL, reflect(), reflect_v3_v3v3(), self, and Vector_CreatePyObject().
|
static |
Definition at line 1338 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, ret, and Vector_to_tuple_ex().
|
static |
Definition at line 385 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, copy_vn_fl(), NULL, self, and size().
|
static |
Definition at line 471 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 502 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 537 of file mathutils_Vector.c.
References BASE_MATH_FLAG_IS_WRAP, NULL, and self.
|
static |
Definition at line 438 of file mathutils_Vector.c.
References copy_vn_fl(), NULL, self, size(), and Vector_CreatePyObject_alloc().
|
static |
Definition at line 2026 of file mathutils_Vector.c.
References BaseMath_ReadCallback, blender::robust_pred::epsilon, EXPP_VectorsAreEqual(), len_squared_vn(), NULL, result, VectorObject::size, and VectorObject_Check.
|
static |
Definition at line 1281 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mathutils_any_to_rotmat(), Matrix_Parse2x2(), mul_m2_v2(), mul_m3_v3(), normalize_m2_m2(), NULL, and self.
|
static |
Definition at line 1082 of file mathutils_Vector.c.
References BaseMath_ReadCallback, mathutils_array_parse(), MAX_DIMENSIONS, normalize_v3(), normalize_v3_v3(), NULL, Quaternion_CreatePyObject(), rotation_between_vecs_to_quat(), and self.
|
static |
Definition at line 1200 of file mathutils_Vector.c.
References BaseMath_ReadCallback, dot_vn_vn(), float(), interp_dot_slerp(), mathutils_array_parse(), normalize_vn(), normalize_vn_vn(), NULL, self, size(), UNLIKELY, Vector_CreatePyObject(), w(), and x.
|
static |
Definition at line 1463 of file mathutils_Vector.c.
References BaseMath_ReadCallback, CLAMP, count, MIN2, NULL, and self.
Referenced by Vector_subscript().
|
static |
Definition at line 1353 of file mathutils_Vector.c.
References BaseMath_ReadCallback, BLI_dynstr_append(), BLI_dynstr_appendf(), BLI_dynstr_new(), mathutils_dynstr_to_py(), NULL, and self.
|
static |
Definition at line 1602 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, VectorObject::size, sub_vn_vnvn(), v1, v2, Vector_CreatePyObject_alloc(), and VectorObject_Check.
|
static |
Definition at line 2134 of file mathutils_Vector.c.
References NULL, self, Vector_item(), and Vector_slice().
|
static |
Python script used to make swizzle array:
Get a new Vector according to the provided swizzle bits.
Definition at line 2394 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MAX_DIMENSIONS, NULL, POINTER_AS_INT, self, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, SWIZZLE_VALID_AXIS, and Vector_CreatePyObject().
|
static |
Set the items of this vector using a swizzle.
Definition at line 2436 of file mathutils_Vector.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, mathutils_array_parse(), MAX_DIMENSIONS, POINTER_AS_INT, self, SWIZZLE_AXIS, SWIZZLE_BITS_PER_AXIS, and SWIZZLE_VALID_AXIS.
|
static |
Definition at line 577 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 592 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 610 of file mathutils_Vector.c.
References BaseMath_ReadCallback, MIN2, NULL, self, and Vector_CreatePyObject().
|
static |
Definition at line 690 of file mathutils_Vector.c.
References BaseMath_ReadCallback, negate_v3_v3(), NULL, Quaternion_CreatePyObject(), self, and vec_to_quat().
|
static |
Definition at line 653 of file mathutils_Vector.c.
References BaseMath_ReadCallback, NULL, and Vector_to_tuple_ex().
|
static |
Definition at line 632 of file mathutils_Vector.c.
References double_round(), ret, and self.
Referenced by Vector_repr(), and Vector_to_tuple().
|
static |
Definition at line 333 of file mathutils_Vector.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, copy_vn_fl(), NULL, and self.
|
static |
Definition at line 2202 of file mathutils_Vector.c.
|
static |
Definition at line 2532 of file mathutils_Vector.c.
|
static |
Definition at line 2958 of file mathutils_Vector.c.
|
static |
Definition at line 2208 of file mathutils_Vector.c.
|
static |
Definition at line 2121 of file mathutils_Vector.c.
| PyTypeObject vector_Type |
Definition at line 3035 of file mathutils_Vector.c.
Referenced by M_Interpolate_poly_3d_calc(), PyInit_mathutils(), Vector_CreatePyObject(), and Vector_CreatePyObject_wrap().