Blender V5.3
mathutils_Vector.cc File Reference
#include <algorithm>
#include <Python.h>
#include "mathutils.hh"
#include "BLI_math_base_safe.hh"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_utildefines.hh"
#include "../generic/py_capi_utils.hh"
#include "BLI_dynstr.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define MAX_DIMENSIONS   4
#define SWIZZLE_BITS_PER_AXIS   3
#define SWIZZLE_VALID_AXIS   0x4
#define SWIZZLE_AXIS   0x3

Functions

Vector Methods: Copy/Deep-Copy
static PyObject * blender::Vector_copy (VectorObject *self)
static PyObject * blender::Vector_deepcopy (VectorObject *self, PyObject *args)
 blender::PyDoc_STRVAR (Vector_copy_doc, ".. method:: 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")
Utilities
static int blender::row_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
static PyObject * blender::vec__apply_to_copy (PyObject *(*vec_func)(VectorObject *), VectorObject *self)
static PyObject * blender::Vector_to_tuple_ex (VectorObject *self, int ndigits)
Vector Type: <tt>__new__</tt> / <tt>mathutils.Vector()</tt>
static PyObject * blender::Vector_vectorcall (PyObject *type, PyObject *const *args, const size_t nargsf, PyObject *kwnames)
static PyObject * blender::Vector_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
Vector Class Methods
 blender::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" " :param size: The length of the vector to be created.\n" " :type size: int\n" " :param fill: The value used to fill the vector.\n" " :type fill: float\n" " :return: A new vector.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::C_Vector_Fill (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Vector_Range_doc, ".. classmethod:: Range(start, stop, step=1, /)\n" "\n" " Create a vector filled with a range of values.\n" "\n" " This method can also be called with a single argument, " "in which case the argument is interpreted as ``stop`` and ``start`` defaults to 0.\n" "\n" " :param start: The start of the range used to fill the vector.\n" " :type start: int\n" " :param stop: The end of the range used to fill the vector.\n" " :type stop: int\n" " :param step: The step between successive values in the vector.\n" " :type step: int\n" " :return: A new vector.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::C_Vector_Range (PyObject *cls, PyObject *args)
 blender::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" " :param start: The start of the range used to fill the vector.\n" " :type start: float\n" " :param stop: The end of the range used to fill the vector.\n" " :type stop: float\n" " :param size: The size of the vector to be created.\n" " :type size: int\n" " :return: A new vector.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::C_Vector_Linspace (PyObject *cls, PyObject *args)
 blender::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" " :param vector: The vector to draw values from.\n" " :type vector: :class:`Vector`\n" " :param size: The size of the vector to be created.\n" " :type size: int\n" " :return: A new vector.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::C_Vector_Repeat (PyObject *cls, PyObject *args)
Vector Methods: Zero
 blender::PyDoc_STRVAR (Vector_zero_doc, ".. method:: zero()\n" "\n" " Set all values to zero.\n")
static PyObject * blender::Vector_zero (VectorObject *self)
Vector Methods: Normalize
 blender::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:: For 4D vectors, only the x, y, z components are normalized;\n" " the w component is left untouched.\n" " The resulting 4D vector may not have unit length.\n")
static PyObject * blender::Vector_normalize (VectorObject *self)
 blender::PyDoc_STRVAR (Vector_normalized_doc, ".. method:: normalized()\n" "\n" " Return a new, normalized vector.\n" "\n" " .. note:: For 4D vectors, only the x, y, z components are normalized;\n" " the w component is left untouched.\n" " The resulting 4D vector may not have unit length.\n" "\n" " :return: a normalized copy of the vector\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::Vector_normalized (VectorObject *self)
Vector Methods: Resize
 blender::PyDoc_STRVAR (Vector_resize_doc, ".. method:: resize(size, /)\n" "\n" " Resize the vector to have size number of elements.\n" "\n" " :param size: The new size of the vector.\n" " :type size: int\n")
static PyObject * blender::Vector_resize (VectorObject *self, PyObject *value)
 blender::PyDoc_STRVAR (Vector_resized_doc, ".. method:: resized(size, /)\n" "\n" " Return a resized copy of the vector with size number of elements.\n" "\n" " :param size: The new size of the vector.\n" " :type size: int\n" " :return: A new vector.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::Vector_resized (VectorObject *self, PyObject *value)
 blender::PyDoc_STRVAR (Vector_resize_2d_doc, ".. method:: resize_2d()\n" "\n" " Resize the vector to 2D (x, y).\n")
static PyObject * blender::Vector_resize_2d (VectorObject *self)
 blender::PyDoc_STRVAR (Vector_resize_3d_doc, ".. method:: resize_3d()\n" "\n" " Resize the vector to 3D (x, y, z).\n")
static PyObject * blender::Vector_resize_3d (VectorObject *self)
 blender::PyDoc_STRVAR (Vector_resize_4d_doc, ".. method:: resize_4d()\n" "\n" " Resize the vector to 4D (x, y, z, w).\n")
static PyObject * blender::Vector_resize_4d (VectorObject *self)
Vector Methods: To N-dimensions
 blender::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 * blender::Vector_to_2d (VectorObject *self)
 blender::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 * blender::Vector_to_3d (VectorObject *self)
 blender::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 * blender::Vector_to_4d (VectorObject *self)
Vector Methods: To Tuple
 blender::PyDoc_STRVAR (Vector_to_tuple_doc, ".. method:: to_tuple(precision=-1, /)\n" "\n" " Return this vector as a tuple with a given precision.\n" "\n" " :param 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[float, ...]\n")
static PyObject * blender::Vector_to_tuple (VectorObject *self, PyObject *args)
Vector Methods: To Track Quaternion
 blender::PyDoc_STRVAR (Vector_to_track_quat_doc, ".. method:: to_track_quat(track='Z', up='Y', /)\n" "\n" " Return a quaternion rotation from the vector and the track and up axis.\n" "\n" " :param track: Track axis string.\n" " :type track: Literal['X', 'Y', 'Z', '-X', '-Y', '-Z']\n" " :param up: Up axis string.\n" " :type up: Literal['X', 'Y', 'Z']\n" " :return: rotation from the vector and the track and up axis.\n" " :rtype: :class:`Quaternion`\n")
static PyObject * blender::Vector_to_track_quat (VectorObject *self, PyObject *args)
Vector Methods: Orthogonal
 blender::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 * blender::Vector_orthogonal (VectorObject *self)
Vector Methods: Reflect

Vector.reflect(mirror): return a reflected vector on the mirror normal: vec - ((2 * dot(vec, mirror)) * mirror).

 blender::PyDoc_STRVAR (Vector_reflect_doc, ".. method:: reflect(mirror, /)\n" "\n" " Return the reflection vector from the *mirror* argument.\n" "\n" " :param 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 * blender::Vector_reflect (VectorObject *self, PyObject *value)
Vector Methods: Cross Product
 blender::PyDoc_STRVAR (Vector_cross_doc, ".. method:: cross(other, /)\n" "\n" " Return the cross product of this vector and another.\n" "\n" " :param other: The other vector to perform the cross product with.\n" " :type other: :class:`Vector`\n" " :return: The cross product as a vector or a float when 2D vectors are used.\n" " :rtype: :class:`Vector` | float\n" "\n" " .. note:: both vectors must be 2D or 3D\n")
static PyObject * blender::Vector_cross (VectorObject *self, PyObject *value)
Vector Methods: Dot Product
 blender::PyDoc_STRVAR (Vector_dot_doc, ".. method:: dot(other, /)\n" "\n" " Return the dot product of this vector and another.\n" "\n" " :param 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 * blender::Vector_dot (VectorObject *self, PyObject *value)
Vector Methods: Angle
 blender::PyDoc_STRVAR (Vector_angle_doc, ".. method:: angle(other, fallback=None, /)\n" "\n" " Return the angle between two vectors.\n" "\n" " .. note:: For 4D vectors, only the x, y, z components are used.\n" "\n" " :param other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :param 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 | Any\n")
static PyObject * blender::Vector_angle (VectorObject *self, PyObject *args)
Vector Methods: Angle Signed
 blender::PyDoc_STRVAR (Vector_angle_signed_doc, ".. method:: angle_signed(other, fallback=None, /)\n" "\n" " Return the signed angle between two 2D vectors (clockwise is positive).\n" "\n" " :param other: another vector to compare the angle with\n" " :type other: :class:`Vector`\n" " :param 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 | Any\n")
static PyObject * blender::Vector_angle_signed (VectorObject *self, PyObject *args)
Vector Methods: Rotation Difference
 blender::PyDoc_STRVAR (Vector_rotation_difference_doc, ".. method:: rotation_difference(other, /)\n" "\n" " Returns a quaternion representing the rotational difference between this\n" " vector and another.\n" "\n" " :param 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 * blender::Vector_rotation_difference (VectorObject *self, PyObject *value)
Vector Methods: Project
 blender::PyDoc_STRVAR (Vector_project_doc, ".. method:: project(other, /)\n" "\n" " Return the projection of this vector onto the *other*.\n" "\n" " :param other: second vector.\n" " :type other: :class:`Vector`\n" " :return: the parallel projection vector\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::Vector_project (VectorObject *self, PyObject *value)
Vector Methods: Linear Interpolation
 blender::PyDoc_STRVAR (Vector_lerp_doc, ".. method:: lerp(other, factor, /)\n" "\n" " Returns the interpolation of two vectors.\n" "\n" " :param other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :param 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 * blender::Vector_lerp (VectorObject *self, PyObject *args)
Vector Methods: Spherical Interpolation
 blender::PyDoc_STRVAR (Vector_slerp_doc, ".. method:: slerp(other, factor, fallback=None, /)\n" "\n" " Returns the interpolation of two non-zero vectors (spherical coordinates).\n" "\n" " :param other: value to interpolate with.\n" " :type other: :class:`Vector`\n" " :param factor: The interpolation value typically in [0.0, 1.0].\n" " :type factor: float\n" " :param 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 * blender::Vector_slerp (VectorObject *self, PyObject *args)
Vector Methods: Rotate
 blender::PyDoc_STRVAR (Vector_rotate_doc, ".. method:: 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" " :param other: rotation component of mathutils value\n" " :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n")
static PyObject * blender::Vector_rotate (VectorObject *self, PyObject *value)
Vector Methods: Negate
 blender::PyDoc_STRVAR (Vector_negate_doc, ".. method:: negate()\n" "\n" " Set all values to their negative.\n")
static PyObject * blender::Vector_negate (VectorObject *self)
Vector Type: <tt>__repr__</tt> & <tt>__str__</tt>
static PyObject * blender::Vector_repr (VectorObject *self)
static PyObject * blender::Vector_str (VectorObject *self)
Vector Type: Rich Compare
static PyObject * blender::Vector_richcmpr (PyObject *objectA, PyObject *objectB, int comparison_type)
Vector Type: Hash (<tt>__hash__</tt>)
static Py_hash_t blender::Vector_hash (VectorObject *self)
Vector Type: Sequence & Mapping Protocols Implementation
static Py_ssize_t blender::Vector_len (VectorObject *self)
static PyObject * blender::vector_item_internal (VectorObject *self, int i, const bool is_attr)
static PyObject * blender::Vector_item (VectorObject *self, Py_ssize_t i)
static int blender::vector_ass_item_internal (VectorObject *self, int i, PyObject *value, const bool is_attr)
static int blender::Vector_ass_item (VectorObject *self, Py_ssize_t i, PyObject *value)
static PyObject * blender::Vector_slice (VectorObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length)
static int blender::Vector_ass_slice (VectorObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length, PyObject *seq)
static PyObject * blender::Vector_subscript (VectorObject *self, PyObject *item)
static int blender::Vector_ass_subscript (VectorObject *self, PyObject *item, PyObject *value)
Vector Type: Numeric Protocol Implementation
static PyObject * blender::Vector_add (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_iadd (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_sub (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_isub (PyObject *v1, PyObject *v2)
int blender::column_vector_multiplication (float r_vec[MAX_DIMENSIONS], VectorObject *vec, MatrixObject *mat)
static PyObject * blender::vector_mul_float (VectorObject *vec, const float scalar)
static PyObject * blender::vector_mul_vec (VectorObject *vec1, VectorObject *vec2)
static PyObject * blender::Vector_mul (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_imul (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_matmul (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_imatmul (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_div (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_idiv (PyObject *v1, PyObject *v2)
static PyObject * blender::Vector_neg (VectorObject *self)
Vector Type: C/API Constructors
PyObject * blender::Vector_CreatePyObject (const float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * blender::Vector_CreatePyObject_wrap (float *vec, const int vec_num, PyTypeObject *base_type)
PyObject * blender::Vector_CreatePyObject_cb (PyObject *cb_user, int vec_num, uchar cb_type, uchar cb_subtype)
PyObject * blender::Vector_CreatePyObject_alloc (float *vec, const int vec_num, PyTypeObject *base_type)

Variables

Vector Type: Protocol Declarations
static PySequenceMethods blender::Vector_SeqMethods
static PyMappingMethods blender::Vector_AsMapping
static PyNumberMethods blender::Vector_NumMethods
Vector Type: Get/Set Item Definitions
static PyGetSetDef blender::Vector_getseters []
Vector Type: Method Definitions
static PyMethodDef blender::Vector_methods []

Vector Type: Get/Set Item Implementation

#define _SWIZZLE1(a)
#define _SWIZZLE2(a, b)
#define _SWIZZLE3(a, b, c)
#define _SWIZZLE4(a, b, c, d)
#define SWIZZLE2(a, b)
#define SWIZZLE3(a, b, c)
#define SWIZZLE4(a, b, c, d)
#define VECTOR_SWIZZLE2_RW_DEF(attr, a, b)
#define VECTOR_SWIZZLE2_RO_DEF(attr, a, b)
#define VECTOR_SWIZZLE3_RW_DEF(attr, a, b, c)
#define VECTOR_SWIZZLE3_RO_DEF(attr, a, b, c)
#define VECTOR_SWIZZLE4_RW_DEF(attr, a, b, c, d)
#define VECTOR_SWIZZLE4_RO_DEF(attr, a, b, c, d)
 blender::PyDoc_STRVAR (Vector_axis_x_doc, "Vector X axis.\n" "\n" ":type: float\n")
 blender::PyDoc_STRVAR (Vector_axis_y_doc, "Vector Y axis.\n" "\n" ":type: float\n")
 blender::PyDoc_STRVAR (Vector_axis_z_doc, "Vector Z axis (3D Vectors only).\n" "\n" ":type: float\n")
 blender::PyDoc_STRVAR (Vector_axis_w_doc, "Vector W axis (4D Vectors only).\n" "\n" ":type: float\n")
static PyObject * blender::Vector_axis_get (VectorObject *self, void *type)
static int blender::Vector_axis_set (VectorObject *self, PyObject *value, void *type)
 blender::PyDoc_STRVAR (Vector_length_doc, "Vector Length.\n" "\n" ":type: float\n")
static PyObject * blender::Vector_length_get (VectorObject *self, void *)
static int blender::Vector_length_set (VectorObject *self, PyObject *value)
 blender::PyDoc_STRVAR (Vector_length_squared_doc, "Vector length squared (v.dot(v)).\n" "\n" ":type: float\n")
static PyObject * blender::Vector_length_squared_get (VectorObject *self, void *)
 blender::PyDoc_STRVAR (Vector_swizzle_doc, ":type: :class:`Vector`")
static PyObject * blender::Vector_swizzle_get (VectorObject *self, void *closure)
static int blender::Vector_swizzle_set (VectorObject *self, PyObject *value, void *closure)

Vector Type: Buffer Protocol

static PyBufferProcs blender::Vector_as_buffer
static int blender::Vector_getbuffer (PyObject *obj, Py_buffer *view, int flags)
static void blender::Vector_releasebuffer (PyObject *, Py_buffer *view)

Vector Type: Python Object Definition

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
PyTypeObject blender::vector_Type
 blender::PyDoc_STRVAR (vector_doc, ".. class:: Vector(seq=(0.0, 0.0, 0.0), /)\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[float]\n")

Macro Definition Documentation

◆ _SWIZZLE1

#define _SWIZZLE1 ( a)
Value:
#define SWIZZLE_VALID_AXIS

Definition at line 3010 of file mathutils_Vector.cc.

◆ _SWIZZLE2

#define _SWIZZLE2 ( a,
b )
Value:

Definition at line 3011 of file mathutils_Vector.cc.

◆ _SWIZZLE3

#define _SWIZZLE3 ( a,
b,
c )
Value:
#define _SWIZZLE2(a, b)

Definition at line 3012 of file mathutils_Vector.cc.

◆ _SWIZZLE4

#define _SWIZZLE4 ( a,
b,
c,
d )
Value:
(_SWIZZLE3(a, b, c) | (((d) | SWIZZLE_VALID_AXIS) << (SWIZZLE_BITS_PER_AXIS * 3)))
#define _SWIZZLE3(a, b, c)

Definition at line 3014 of file mathutils_Vector.cc.

◆ MAX_DIMENSIONS

#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 34 of file mathutils_Vector.cc.

◆ SWIZZLE2

#define SWIZZLE2 ( a,
b )
Value:
#define POINTER_FROM_INT(i)

Definition at line 3017 of file mathutils_Vector.cc.

◆ SWIZZLE3

#define SWIZZLE3 ( a,
b,
c )
Value:

Definition at line 3018 of file mathutils_Vector.cc.

◆ SWIZZLE4

#define SWIZZLE4 ( a,
b,
c,
d )
Value:
#define _SWIZZLE4(a, b, c, d)

Definition at line 3019 of file mathutils_Vector.cc.

◆ SWIZZLE_AXIS

#define SWIZZLE_AXIS   0x3

Definition at line 43 of file mathutils_Vector.cc.

Referenced by blender::Vector_swizzle_get(), and blender::Vector_swizzle_set().

◆ SWIZZLE_BITS_PER_AXIS

#define SWIZZLE_BITS_PER_AXIS   3

Swizzle axes get packed into a single value that is used as a closure. Each axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is used as a sentinel: if it is unset, the axis is not valid.

Definition at line 41 of file mathutils_Vector.cc.

Referenced by blender::Vector_swizzle_get(), and blender::Vector_swizzle_set().

◆ SWIZZLE_VALID_AXIS

#define SWIZZLE_VALID_AXIS   0x4

Definition at line 42 of file mathutils_Vector.cc.

Referenced by blender::Vector_swizzle_get(), and blender::Vector_swizzle_set().

◆ VECTOR_SWIZZLE2_RO_DEF

#define VECTOR_SWIZZLE2_RO_DEF ( attr,
a,
b )
Value:
{ \
attr, \
(getter)Vector_swizzle_get, \
(setter) nullptr, \
Vector_swizzle_doc, \
SWIZZLE2(a, b), \
}

Definition at line 3029 of file mathutils_Vector.cc.

◆ VECTOR_SWIZZLE2_RW_DEF

#define VECTOR_SWIZZLE2_RW_DEF ( attr,
a,
b )
Value:
{ \
attr, \
(getter)Vector_swizzle_get, \
(setter)Vector_swizzle_set, \
Vector_swizzle_doc, \
SWIZZLE2(a, b), \
}

Definition at line 3021 of file mathutils_Vector.cc.

◆ VECTOR_SWIZZLE3_RO_DEF

#define VECTOR_SWIZZLE3_RO_DEF ( attr,
a,
b,
c )
Value:
{ \
attr, \
(getter)Vector_swizzle_get, \
(setter) nullptr, \
Vector_swizzle_doc, \
SWIZZLE3(a, b, c), \
}

Definition at line 3045 of file mathutils_Vector.cc.

◆ VECTOR_SWIZZLE3_RW_DEF

#define VECTOR_SWIZZLE3_RW_DEF ( attr,
a,
b,
c )
Value:
{ \
attr, \
(getter)Vector_swizzle_get, \
(setter)Vector_swizzle_set, \
Vector_swizzle_doc, \
SWIZZLE3(a, b, c), \
}

Definition at line 3037 of file mathutils_Vector.cc.

◆ VECTOR_SWIZZLE4_RO_DEF

#define VECTOR_SWIZZLE4_RO_DEF ( attr,
a,
b,
c,
d )
Value:
{attr, (getter)Vector_swizzle_get, (setter) nullptr, Vector_swizzle_doc, SWIZZLE4(a, b, c, d)}
#define SWIZZLE4(a, b, c, d)

Definition at line 3061 of file mathutils_Vector.cc.

◆ VECTOR_SWIZZLE4_RW_DEF

#define VECTOR_SWIZZLE4_RW_DEF ( attr,
a,
b,
c,
d )
Value:
{ \
attr, \
(getter)Vector_swizzle_get, \
(setter)Vector_swizzle_set, \
Vector_swizzle_doc, \
SWIZZLE4(a, b, c, d), \
}

Definition at line 3053 of file mathutils_Vector.cc.