Blender V5.3
mathutils_Matrix.cc File Reference
#include <algorithm>
#include <Python.h>
#include "mathutils.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 "../generic/python_utildefines.hh"
#include "BLI_dynstr.hh"
#include "BLI_string_utf8.hh"

Go to the source code of this file.

Classes

struct  blender::MatrixAccessObject

Namespaces

namespace  blender
 BMesh Iterators.

Enumerations

enum  blender::eMatrixAccess_t { blender::MAT_ACCESS_ROW , blender::MAT_ACCESS_COL }

Functions

static PyObject * blender::Matrix_copy_notest (MatrixObject *self, const float *matrix)
static PyObject * blender::Matrix_deepcopy (MatrixObject *self, PyObject *args)
static int blender::Matrix_ass_slice (MatrixObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length, PyObject *value)
Matrix Methods: Copy
static PyObject * blender::Matrix_copy (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_copy_doc, ".. method:: copy()\n" "\n" " Returns a copy of this matrix.\n" "\n" " :return: A copy of the matrix.\n" " :rtype: :class:`Matrix`\n")
Utilities
static PyObject * blender::matrix__apply_to_copy (PyObject *(*matrix_func)(MatrixObject *), MatrixObject *self)
static int blender::matrix_row_vector_check (MatrixObject *mat, VectorObject *vec, int row)
static int blender::matrix_col_vector_check (MatrixObject *mat, VectorObject *vec, int col)
static void blender::matrix_3x3_as_4x4 (float mat[16])
void blender::matrix_as_3x3 (float mat[3][3], MatrixObject *self)
static void blender::matrix_copy (MatrixObject *mat_dst, const MatrixObject *mat_src)
static void blender::matrix_unit_internal (MatrixObject *self)
static void blender::matrix_transpose_internal (float mat_dst_fl[], const MatrixObject *mat_src)
static float blender::matrix_determinant_internal (const MatrixObject *self)
static void blender::adjoint_matrix_n (float *mat_dst, const float *mat_src, const ushort dim)
static void blender::matrix_invert_with_det_n_internal (float *mat_dst, const float *mat_src, const float det, const ushort dim)
static bool blender::matrix_invert_internal (const MatrixObject *self, float *r_mat)
static void blender::matrix_invert_safe_internal (const MatrixObject *self, float *r_mat)
static bool blender::matrix_is_identity (MatrixObject *self)
Matrix-Access Type: C/API Constructor
static PyObject * blender::MatrixAccess_CreatePyObject (MatrixObject *matrix, const eMatrixAccess_t type)
Matrix Type: <tt>__new__</tt> / <tt>mathutils.Matrix()</tt>
static PyObject * blender::Matrix_vectorcall (PyObject *type, PyObject *const *args, const size_t nargsf, PyObject *kwnames)
static PyObject * blender::Matrix_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
Matrix Class Methods
 blender::PyDoc_STRVAR (C_Matrix_Identity_doc, ".. classmethod:: Identity(size, /)\n" "\n" " Create an identity matrix.\n" "\n" " :param size: The size of the identity matrix to construct [2, 4].\n" " :type size: int\n" " :return: A new identity matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Identity (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Matrix_Rotation_doc, ".. classmethod:: Rotation(angle, size, axis=None, /)\n" "\n" " Create a matrix representing a rotation.\n" "\n" " :param angle: The angle of rotation desired, in radians.\n" " :type angle: float\n" " :param size: The size of the rotation matrix to construct [2, 4].\n" " :type size: int\n" " :param axis: Axis of rotation: a single-character string ('X', 'Y' or 'Z')\n" " or a 3D vector. Required for ``size`` 3 or 4. Must be None (or omitted)\n" " when ``size`` is 2 - 2D rotation has no axis.\n" " :type axis: Literal['X', 'Y', 'Z'] | Sequence[float] | None\n" " :return: A new rotation matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Rotation (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Matrix_Translation_doc, ".. classmethod:: Translation(vector, /)\n" "\n" " Create a matrix representing a translation.\n" "\n" " :param vector: The translation vector.\n" " :type vector: Sequence[float]\n" " :return: An identity matrix with a translation.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Translation (PyObject *cls, PyObject *value)
 blender::PyDoc_STRVAR (C_Matrix_Diagonal_doc, ".. classmethod:: Diagonal(vector, /)\n" "\n" " Create a diagonal (scaling) matrix using the values from the vector.\n" "\n" " :param vector: The vector of values for the diagonal.\n" " :type vector: Sequence[float]\n" " :return: A diagonal matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Diagonal (PyObject *cls, PyObject *value)
 blender::PyDoc_STRVAR (C_Matrix_Scale_doc, ".. classmethod:: Scale(factor, size, axis=None, /)\n" "\n" " Create a matrix representing a scaling.\n" "\n" " :param factor: The factor of scaling to apply.\n" " :type factor: float\n" " :param size: The size of the scale matrix to construct [2, 4].\n" " :type size: int\n" " :param axis: Direction along which to scale. When None (or omitted),\n" " ``factor`` is applied uniformly along all axes.\n" " :type axis: Sequence[float] | None\n" " :return: A new scale matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Scale (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Matrix_OrthoProjection_doc, ".. classmethod:: OrthoProjection(axis, size, /)\n" "\n" " Create a matrix to represent an orthographic projection.\n" "\n" " :param axis: An axis string,\n" " where a single axis is for a 2D matrix.\n" " Or a vector for an arbitrary axis\n" " :type axis: Literal['X', 'Y', 'XY', 'XZ', 'YZ'] | Sequence[float]\n" " :param size: The size of the projection matrix to construct [2, 4].\n" " :type size: int\n" " :return: A new projection matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_OrthoProjection (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Matrix_Shear_doc, ".. classmethod:: Shear(plane, size, factor, /)\n" "\n" " Create a matrix to represent a shear transformation.\n" "\n" " :param plane: An axis string,\n" " where a single axis is for a 2D matrix only.\n" " :type plane: Literal['X', 'Y', 'XY', 'XZ', 'YZ']\n" " :param size: The size of the shear matrix to construct [2, 4].\n" " :type size: int\n" " :param factor: The factor of shear to apply. " "For a 2 *size* matrix use a single float. " "For a 3 or 4 *size* matrix pass a pair of floats corresponding with the *plane* axis.\n" " :type factor: float | Sequence[float]\n" " :return: A new shear matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_Shear (PyObject *cls, PyObject *args)
 blender::PyDoc_STRVAR (C_Matrix_LocRotScale_doc, ".. classmethod:: LocRotScale(location, rotation, scale, /)\n" "\n" " Create a matrix combining translation, rotation and scale,\n" " acting as the inverse of the decompose() method.\n" "\n" " Any of the inputs may be replaced with None if not needed.\n" "\n" " :param location: The translation component.\n" " :type location: Sequence[float] | None\n" " :param rotation: The rotation component as a " "3x3 matrix, quaternion, euler or None for no rotation.\n" " :type rotation: :class:`Matrix` | :class:`Quaternion` | :class:`Euler` | None\n" " :param scale: The scale component.\n" " :type scale: Sequence[float] | None\n" " :return: Combined transformation as a 4x4 matrix. \n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::C_Matrix_LocRotScale (PyObject *cls, PyObject *args)
Matrix Methods: To Quaternion
 blender::PyDoc_STRVAR (Matrix_to_quaternion_doc, ".. method:: to_quaternion()\n" "\n" " Return a quaternion representation of the rotation matrix.\n" "\n" " :return: Quaternion representation of the rotation matrix.\n" " :rtype: :class:`Quaternion`\n")
static PyObject * blender::Matrix_to_quaternion (MatrixObject *self)
Matrix Methods: To Euler
 blender::PyDoc_STRVAR (Matrix_to_euler_doc, ".. method:: to_euler(order='XYZ', euler_compat=None, /)\n" "\n" " Return an Euler representation of the rotation matrix\n" " (3x3 or 4x4 matrix only).\n" "\n" " :param order: A rotation order string.\n" " :type order: Literal['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']\n" " :param euler_compat: Optional euler argument the new euler will be made\n" " compatible with (no axis flipping between them).\n" " Useful for converting a series of matrices to animation curves.\n" " :type euler_compat: :class:`Euler` | None\n" " :return: Euler representation of the matrix.\n" " :rtype: :class:`Euler`\n")
static PyObject * blender::Matrix_to_euler (MatrixObject *self, PyObject *args)
Matrix Methods: Resize
 blender::PyDoc_STRVAR (Matrix_resize_4x4_doc, ".. method:: resize_4x4()\n" "\n" " Resize the matrix to 4x4.\n")
static PyObject * blender::Matrix_resize_4x4 (MatrixObject *self)
Matrix Methods: To NxN
static PyObject * blender::Matrix_to_NxN (MatrixObject *self, const int col_num, const int row_num)
 blender::PyDoc_STRVAR (Matrix_to_2x2_doc, ".. method:: to_2x2()\n" "\n" " Return a 2x2 copy of this matrix.\n" "\n" " :return: a new matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_to_2x2 (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_to_3x3_doc, ".. method:: to_3x3()\n" "\n" " Return a 3x3 copy of this matrix.\n" "\n" " :return: a new matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_to_3x3 (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_to_4x4_doc, ".. method:: to_4x4()\n" "\n" " Return a 4x4 copy of this matrix.\n" "\n" " :return: a new matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_to_4x4 (MatrixObject *self)
Matrix Methods: To Translation/Scale
 blender::PyDoc_STRVAR (Matrix_to_translation_doc, ".. method:: to_translation()\n" "\n" " Return the translation part of a 4x4 matrix.\n" "\n" " :return: Return the translation of a matrix.\n" " :rtype: :class:`Vector`\n")
static PyObject * blender::Matrix_to_translation (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_to_scale_doc, ".. method:: to_scale()\n" "\n" " Return the scale part of a 3x3 or 4x4 matrix.\n" "\n" " :return: Return the scale of a matrix.\n" " :rtype: :class:`Vector`\n" "\n" " .. note:: This method does not return a negative scale on any axis because it is " "not possible to obtain this data from the matrix alone.\n")
static PyObject * blender::Matrix_to_scale (MatrixObject *self)
Matrix Methods: Invert
static bool blender::matrix_invert_is_compat (const MatrixObject *self)
static bool blender::matrix_invert_args_check (const MatrixObject *self, PyObject *args, bool check_type)
static void blender::matrix_invert_raise_degenerate ()
 blender::PyDoc_STRVAR (Matrix_invert_doc, ".. method:: invert(fallback=None, /)\n" "\n" " Set the matrix to its inverse.\n" "\n" " :param fallback: Set the matrix to this value when the inverse cannot be calculated\n" " (instead of raising a :exc:`ValueError` exception).\n" " :type fallback: :class:`Matrix` | None\n" "\n" " .. seealso:: `Inverse matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on " "Wikipedia.\n")
static PyObject * blender::Matrix_invert (MatrixObject *self, PyObject *args)
 blender::PyDoc_STRVAR (Matrix_inverted_doc, ".. method:: inverted(fallback=None, /)\n" "\n" " Return an inverted copy of the matrix.\n" "\n" " :param fallback: return this when the inverse can't be calculated\n" " (instead of raising a :exc:`ValueError`).\n" " :type fallback: Any\n" " :return: The inverted matrix or fallback when given.\n" " :rtype: :class:`Matrix` | Any\n")
static PyObject * blender::Matrix_inverted (MatrixObject *self, PyObject *args)
static PyObject * blender::Matrix_inverted_noargs (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_invert_safe_doc, ".. method:: invert_safe()\n" "\n" " Set the matrix to its inverse, will never error.\n" " If degenerated (e.g. zero scale on an axis), add some epsilon to its diagonal, " "to get an invertible one.\n" " If tweaked matrix is still degenerated, set to the identity matrix instead.\n" "\n" " .. seealso:: `Inverse Matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on " "Wikipedia.\n")
static PyObject * blender::Matrix_invert_safe (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_inverted_safe_doc, ".. method:: inverted_safe()\n" "\n" " Return an inverted copy of the matrix, will never error.\n" " If degenerated (e.g. zero scale on an axis), add some epsilon to its diagonal, " "to get an invertible one.\n" " If tweaked matrix is still degenerated, return the identity matrix instead.\n" "\n" " :return: the inverted matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_inverted_safe (MatrixObject *self)
Matrix Methods: Adjugate
 blender::PyDoc_STRVAR (Matrix_adjugate_doc, ".. method:: adjugate()\n" "\n" " Set the matrix to its adjugate.\n" "\n" " :raises ValueError: if the matrix cannot be adjugated.\n" "\n" " .. seealso:: `Adjugate matrix <https://en.wikipedia.org/wiki/Adjugate_matrix>`__ on " "Wikipedia.\n")
static PyObject * blender::Matrix_adjugate (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_adjugated_doc, ".. method:: adjugated()\n" "\n" " Return an adjugated copy of the matrix.\n" "\n" " :return: the adjugated matrix.\n" " :rtype: :class:`Matrix`\n" " :raises ValueError: if the matrix cannot be adjugated\n")
static PyObject * blender::Matrix_adjugated (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_rotate_doc, ".. method:: rotate(other, /)\n" "\n" " Rotates the matrix by another mathutils value.\n" "\n" " .. note:: The matrix must be 3x3.\n" "\n" " .. note:: If any of the columns are not unit length this may not have desired results.\n" "\n" " :param other: rotation component of mathutils value\n" " :type other: :class:`Euler` | :class:`Quaternion` | :class:`Matrix`\n")
static PyObject * blender::Matrix_rotate (MatrixObject *self, PyObject *value)
Matrix Methods: Decompose
 blender::PyDoc_STRVAR (Matrix_decompose_doc, ".. method:: decompose()\n" "\n" " Return the translation, rotation, and scale components of this 4x4 matrix.\n" "\n" " :return: Tuple of translation, rotation, and scale.\n" " :rtype: tuple[:class:`Vector`, :class:`Quaternion`, :class:`Vector`]\n")
static PyObject * blender::Matrix_decompose (MatrixObject *self)
Matrix Methods: Linear Interpolate (lerp)
 blender::PyDoc_STRVAR (Matrix_lerp_doc, ".. method:: lerp(other, factor, /)\n" "\n" " Returns the interpolation of two matrices. Uses polar decomposition, see " "\"Matrix Animation and Polar Decomposition\", Shoemake and Duff, 1992.\n" "\n" " :param other: value to interpolate with.\n" " :type other: :class:`Matrix`\n" " :param factor: The interpolation value in [0.0, 1.0].\n" " :type factor: float\n" " :return: The interpolated matrix.\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_lerp (MatrixObject *self, PyObject *args)
 blender::PyDoc_STRVAR (Matrix_determinant_doc, ".. method:: determinant()\n" "\n" " Return the determinant of a matrix.\n" "\n" " :return: Return the determinant of a matrix.\n" " :rtype: float\n" "\n" " .. seealso:: `Determinant <https://en.wikipedia.org/wiki/Determinant>`__ on Wikipedia.\n")
static PyObject * blender::Matrix_determinant (MatrixObject *self)
Matrix Methods: Transpose
 blender::PyDoc_STRVAR (Matrix_transpose_doc, ".. method:: transpose()\n" "\n" " Set the matrix to its transpose.\n" "\n" " .. seealso:: `Transpose <https://en.wikipedia.org/wiki/Transpose>`__ on Wikipedia.\n")
static PyObject * blender::Matrix_transpose (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_transposed_doc, ".. method:: transposed()\n" "\n" " Return a new, transposed matrix.\n" "\n" " :return: a transposed matrix\n" " :rtype: :class:`Matrix`\n")
static PyObject * blender::Matrix_transposed (MatrixObject *self)
Matrix Methods: Normalize
 blender::PyDoc_STRVAR (Matrix_normalize_doc, ".. method:: normalize()\n" "\n" " Normalize each of the matrix columns (3x3 and 4x4 only).\n" "\n" " .. note:: for 4x4 matrices, the 4th column (translation) is left untouched.\n")
static PyObject * blender::Matrix_normalize (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_normalized_doc, ".. method:: normalized()\n" "\n" " Return a column normalized matrix (3x3 and 4x4 only).\n" "\n" " :return: a column normalized matrix\n" " :rtype: :class:`Matrix`\n" "\n" " .. note:: for 4x4 matrices, the 4th column (translation) is left untouched.\n")
static PyObject * blender::Matrix_normalized (MatrixObject *self)
Matrix Methods: Zero
 blender::PyDoc_STRVAR (Matrix_zero_doc, ".. method:: zero()\n" "\n" " Set all the matrix values to zero.\n")
static PyObject * blender::Matrix_zero (MatrixObject *self)
Matrix Methods: Set Identity
static void blender::matrix_identity_internal (MatrixObject *self)
 blender::PyDoc_STRVAR (Matrix_identity_doc, ".. method:: identity()\n" "\n" " Set the matrix to the identity matrix.\n" "\n" " .. note:: An object with a location and rotation of zero, and a scale of one\n" " will have an identity matrix.\n" "\n" " .. seealso:: `Identity matrix <https://en.wikipedia.org/wiki/Identity_matrix>`__ " "on Wikipedia.\n")
static PyObject * blender::Matrix_identity (MatrixObject *self)
Matrix Type: <tt>__repr__</tt> & <tt>__str__</tt>
static PyObject * blender::Matrix_repr (MatrixObject *self)
static PyObject * blender::Matrix_str (MatrixObject *self)
Matrix Type: Rich Compare
static PyObject * blender::Matrix_richcmpr (PyObject *a, PyObject *b, int op)
Matrix Type: Hash (<tt>__hash__</tt>)
static Py_hash_t blender::Matrix_hash (MatrixObject *self)
Matrix Type: Sequence & Mapping Protocol Implementation
static Py_ssize_t blender::Matrix_len (MatrixObject *self)
static PyObject * blender::Matrix_item_row (MatrixObject *self, Py_ssize_t row)
static PyObject * blender::Matrix_item_col (MatrixObject *self, Py_ssize_t col)
static int blender::Matrix_ass_item_row (MatrixObject *self, Py_ssize_t row, PyObject *value)
static int blender::Matrix_ass_item_col (MatrixObject *self, int col, PyObject *value)
static PyObject * blender::Matrix_slice (MatrixObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length)
static PyObject * blender::Matrix_subscript (MatrixObject *self, PyObject *item)
static int blender::Matrix_ass_subscript (MatrixObject *self, PyObject *item, PyObject *value)
Matrix Type: Numeric Protocol Implementation
static PyObject * blender::Matrix_add (PyObject *m1, PyObject *m2)
static PyObject * blender::Matrix_sub (PyObject *m1, PyObject *m2)
static PyObject * blender::matrix_mul_float (MatrixObject *mat, const float scalar)
static PyObject * blender::Matrix_mul (PyObject *m1, PyObject *m2)
static PyObject * blender::Matrix_imul (PyObject *m1, PyObject *m2)
static PyObject * blender::Matrix_matmul (PyObject *m1, PyObject *m2)
static PyObject * blender::Matrix_imatmul (PyObject *m1, PyObject *m2)
Matrix Type: Get/Set Item Implementation
 blender::PyDoc_STRVAR (Matrix_translation_doc, "The translation component of the matrix.\n" "\n" ":type: :class:`Vector`\n")
static PyObject * blender::Matrix_translation_get (MatrixObject *self, void *)
static int blender::Matrix_translation_set (MatrixObject *self, PyObject *value, void *)
 blender::PyDoc_STRVAR (Matrix_row_doc, "Access the matrix by rows (default), (read-only).\n" "\n" ":type: :class:`MatrixAccess`\n")
static PyObject * blender::Matrix_row_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_col_doc, "Access the matrix by columns (read-only).\n" "\n" ":type: :class:`MatrixAccess`\n")
static PyObject * blender::Matrix_col_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_median_scale_doc, "The average scale applied to each axis (read-only).\n" "\n" ":type: float\n")
static PyObject * blender::Matrix_median_scale_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_is_identity_doc, "True if this is an identity matrix (read-only).\n" "\n" ":type: bool\n")
static PyObject * blender::Matrix_is_identity_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_is_negative_doc, "True if this matrix results in a negative scale, 3x3 and 4x4 only, " "(read-only).\n" "\n" ":type: bool\n")
static PyObject * blender::Matrix_is_negative_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_is_orthogonal_doc, "True if this matrix is orthogonal, 3x3 and 4x4 only, (read-only).\n" "\n" ":type: bool\n")
static PyObject * blender::Matrix_is_orthogonal_get (MatrixObject *self, void *)
 blender::PyDoc_STRVAR (Matrix_is_orthogonal_axis_vectors_doc, "True if this matrix has orthogonal axis vectors, 3x3 and 4x4 only, " "(read-only).\n" "\n" ":type: bool\n")
static PyObject * blender::Matrix_is_orthogonal_axis_vectors_get (MatrixObject *self, void *)
Matrix Type: C/API Constructors
PyObject * blender::Matrix_CreatePyObject (const float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
PyObject * blender::Matrix_CreatePyObject_wrap (float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
PyObject * blender::Matrix_CreatePyObject_cb (PyObject *cb_user, const ushort col_num, const ushort row_num, uchar cb_type, uchar cb_subtype)
PyObject * blender::Matrix_CreatePyObject_alloc (float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
Matrix Type: C/API Parse Utilities
static bool blender::Matrix_ParseCheck (MatrixObject *pymat)
int blender::Matrix_ParseAny (PyObject *o, void *p)
int blender::Matrix_Parse2x2 (PyObject *o, void *p)
int blender::Matrix_Parse3x3 (PyObject *o, void *p)
int blender::Matrix_Parse4x4 (PyObject *o, void *p)
Matrix-Access Type: Struct & Internal Functions
static int blender::MatrixAccess_traverse (MatrixAccessObject *self, visitproc visit, void *arg)
static int blender::MatrixAccess_clear (MatrixAccessObject *self)
static void blender::MatrixAccess_dealloc (MatrixAccessObject *self)

Variables

Matrix Type: Protocol Declarations
static PySequenceMethods blender::Matrix_SeqMethods
static PyMappingMethods blender::Matrix_AsMapping
static PyNumberMethods blender::Matrix_NumMethods
Matrix Type: Get/Set Item Definitions
static PyGetSetDef blender::Matrix_getseters []
Matrix Type: Method Definitions
static PyMethodDef blender::Matrix_methods []

Matrix Row Callbacks

This is so you can do matrix[i][j] = val or matrix.row[i][j] = val.

uchar blender::mathutils_matrix_row_cb_index = -1
Mathutils_Callback blender::mathutils_matrix_row_cb
static int blender::mathutils_matrix_row_check (BaseMathObject *bmo)
static int blender::mathutils_matrix_row_get (BaseMathObject *bmo, int row)
static int blender::mathutils_matrix_row_set (BaseMathObject *bmo, int row)
static int blender::mathutils_matrix_row_get_index (BaseMathObject *bmo, int row, int col)
static int blender::mathutils_matrix_row_set_index (BaseMathObject *bmo, int row, int col)

Matrix Column Callbacks

This is so you can do matrix.col[i][j] = val.

uchar blender::mathutils_matrix_col_cb_index = -1
Mathutils_Callback blender::mathutils_matrix_col_cb
static int blender::mathutils_matrix_col_check (BaseMathObject *bmo)
static int blender::mathutils_matrix_col_get (BaseMathObject *bmo, int col)
static int blender::mathutils_matrix_col_set (BaseMathObject *bmo, int col)
static int blender::mathutils_matrix_col_get_index (BaseMathObject *bmo, int col, int row)
static int blender::mathutils_matrix_col_set_index (BaseMathObject *bmo, int col, int row)

Matrix Translation Callbacks

This is so you can do matrix.translation = val.

Note
this is _exactly like matrix.col except the 4th component is always omitted.
uchar blender::mathutils_matrix_translation_cb_index = -1
Mathutils_Callback blender::mathutils_matrix_translation_cb
static int blender::mathutils_matrix_translation_check (BaseMathObject *bmo)
static int blender::mathutils_matrix_translation_get (BaseMathObject *bmo, int col)
static int blender::mathutils_matrix_translation_set (BaseMathObject *bmo, int col)
static int blender::mathutils_matrix_translation_get_index (BaseMathObject *bmo, int col, int row)
static int blender::mathutils_matrix_translation_set_index (BaseMathObject *bmo, int col, int row)

Matrix Type: Buffer Protocol

static PyBufferProcs blender::Matrix_as_buffer
static int blender::Matrix_getbuffer (PyObject *obj, Py_buffer *view, int flags)
static void blender::Matrix_releasebuffer (PyObject *, Py_buffer *view)

Matrix Type: Python Object Definition

PyTypeObject blender::matrix_Type
 blender::PyDoc_STRVAR (matrix_doc, ".. class:: Matrix(rows=((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)), /)\n" "\n" " This object gives access to Matrices in Blender, supporting square and rectangular\n" " matrices from 2x2 up to 4x4.\n" "\n" " :param rows: Sequence of rows.\n" " :type rows: Sequence[Sequence[float]]\n")

Matrix-Access Type: Sequence Protocol

static PyMappingMethods blender::MatrixAccess_AsMapping
static Py_ssize_t blender::MatrixAccess_len (MatrixAccessObject *self)
static PyObject * blender::MatrixAccess_slice (MatrixAccessObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length)
static int blender::MatrixAccess_ass_slice (MatrixAccessObject *self, Py_ssize_t start, Py_ssize_t step, Py_ssize_t slice_length, PyObject *value)
static PyObject * blender::MatrixAccess_subscript (MatrixAccessObject *self, PyObject *item)
static int blender::MatrixAccess_ass_subscript (MatrixAccessObject *self, PyObject *item, PyObject *value)
static PyObject * blender::MatrixAccess_iter (MatrixAccessObject *self)

Matrix-Access Type: Python Object Definition

PyTypeObject blender::matrix_access_Type
 blender::PyDoc_STRVAR (matrix_access_doc, "An indexable type for accessing matrix rows or columns as :class:`Vector` types.\n")