Blender  V3.3
Classes | Typedefs | Enumerations
mathutils_Matrix.c File Reference
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#include "BLI_dynstr.h"
#include "BLI_string.h"

Go to the source code of this file.

Classes

struct  MatrixAccessObject
 

Typedefs

typedef enum eMatrixAccess_t eMatrixAccess_t
 

Enumerations

enum  eMatrixAccess_t { MAT_ACCESS_ROW , MAT_ACCESS_COL }
 

Functions

Matrix Methods: Copy
static PyObject * Matrix_copy_notest (MatrixObject *self, const float *matrix)
 
static PyObject * Matrix_copy (MatrixObject *self)
 
static PyObject * Matrix_deepcopy (MatrixObject *self, PyObject *args)
 
 PyDoc_STRVAR (Matrix_copy_doc, ".. method:: copy()\n" "\n" " Returns a copy of this matrix.\n" "\n" " :return: an instance of itself\n" " :rtype: :class:`Matrix`\n")
 
Matrix Type: Sequence & Mapping Protocol Implementation
static int Matrix_ass_slice (MatrixObject *self, int begin, int end, PyObject *value)
 
static int Matrix_len (MatrixObject *self)
 
static PyObject * Matrix_item_row (MatrixObject *self, int row)
 
static PyObject * Matrix_item_col (MatrixObject *self, int col)
 
static int Matrix_ass_item_row (MatrixObject *self, int row, PyObject *value)
 
static int Matrix_ass_item_col (MatrixObject *self, int col, PyObject *value)
 
static PyObject * Matrix_slice (MatrixObject *self, int begin, int end)
 
static PyObject * Matrix_subscript (MatrixObject *self, PyObject *item)
 
static int Matrix_ass_subscript (MatrixObject *self, PyObject *item, PyObject *value)
 
Utilities
static PyObject * matrix__apply_to_copy (PyObject *(*matrix_func)(MatrixObject *), MatrixObject *self)
 
static int matrix_row_vector_check (MatrixObject *mat, VectorObject *vec, int row)
 
static int matrix_col_vector_check (MatrixObject *mat, VectorObject *vec, int col)
 
static void matrix_3x3_as_4x4 (float mat[16])
 
void matrix_as_3x3 (float mat[3][3], MatrixObject *self)
 
static void matrix_copy (MatrixObject *mat_dst, const MatrixObject *mat_src)
 
static void matrix_unit_internal (MatrixObject *self)
 
static void matrix_transpose_internal (float mat_dst_fl[], const MatrixObject *mat_src)
 
static float matrix_determinant_internal (const MatrixObject *self)
 
static void adjoint_matrix_n (float *mat_dst, const float *mat_src, const ushort dim)
 
static void matrix_invert_with_det_n_internal (float *mat_dst, const float *mat_src, const float det, const ushort dim)
 
static bool matrix_invert_internal (const MatrixObject *self, float *r_mat)
 
static void matrix_invert_safe_internal (const MatrixObject *self, float *r_mat)
 
static bool matrix_is_identity (MatrixObject *self)
 
Matrix-Access Type: C/API Constructor
static PyObject * MatrixAccess_CreatePyObject (MatrixObject *matrix, const eMatrixAccess_t type)
 
Matrix Type: <tt>__new__</tt> / <tt>mathutils.Matrix()</tt>
static PyObject * Matrix_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
Matrix Class Methods
 PyDoc_STRVAR (C_Matrix_Identity_doc, ".. classmethod:: Identity(size)\n" "\n" " Create an identity matrix.\n" "\n" " :arg 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 * C_Matrix_Identity (PyObject *cls, PyObject *args)
 
 PyDoc_STRVAR (C_Matrix_Rotation_doc, ".. classmethod:: Rotation(angle, size, axis)\n" "\n" " Create a matrix representing a rotation.\n" "\n" " :arg angle: The angle of rotation desired, in radians.\n" " :type angle: float\n" " :arg size: The size of the rotation matrix to construct [2, 4].\n" " :type size: int\n" " :arg axis: a string in ['X', 'Y', 'Z'] or a 3D Vector Object\n" " (optional when size is 2).\n" " :type axis: string or :class:`Vector`\n" " :return: A new rotation matrix.\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * C_Matrix_Rotation (PyObject *cls, PyObject *args)
 
 PyDoc_STRVAR (C_Matrix_Translation_doc, ".. classmethod:: Translation(vector)\n" "\n" " Create a matrix representing a translation.\n" "\n" " :arg vector: The translation vector.\n" " :type vector: :class:`Vector`\n" " :return: An identity matrix with a translation.\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * C_Matrix_Translation (PyObject *cls, PyObject *value)
 
 PyDoc_STRVAR (C_Matrix_Diagonal_doc, ".. classmethod:: Diagonal(vector)\n" "\n" " Create a diagonal (scaling) matrix using the values from the vector.\n" "\n" " :arg vector: The vector of values for the diagonal.\n" " :type vector: :class:`Vector`\n" " :return: A diagonal matrix.\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * C_Matrix_Diagonal (PyObject *cls, PyObject *value)
 
 PyDoc_STRVAR (C_Matrix_Scale_doc, ".. classmethod:: Scale(factor, size, axis)\n" "\n" " Create a matrix representing a scaling.\n" "\n" " :arg factor: The factor of scaling to apply.\n" " :type factor: float\n" " :arg size: The size of the scale matrix to construct [2, 4].\n" " :type size: int\n" " :arg axis: Direction to influence scale. (optional).\n" " :type axis: :class:`Vector`\n" " :return: A new scale matrix.\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * C_Matrix_Scale (PyObject *cls, PyObject *args)
 
 PyDoc_STRVAR (C_Matrix_OrthoProjection_doc, ".. classmethod:: OrthoProjection(axis, size)\n" "\n" " Create a matrix to represent an orthographic projection.\n" "\n" " :arg axis: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n" " where a single axis is for a 2D matrix.\n" " Or a vector for an arbitrary axis\n" " :type axis: string or :class:`Vector`\n" " :arg 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 * C_Matrix_OrthoProjection (PyObject *cls, PyObject *args)
 
 PyDoc_STRVAR (C_Matrix_Shear_doc, ".. classmethod:: Shear(plane, size, factor)\n" "\n" " Create a matrix to represent an shear transformation.\n" "\n" " :arg plane: Can be any of the following: ['X', 'Y', 'XY', 'XZ', 'YZ'],\n" " where a single axis is for a 2D matrix only.\n" " :type plane: string\n" " :arg size: The size of the shear matrix to construct [2, 4].\n" " :type size: int\n" " :arg factor: The factor of shear to apply. For a 3 or 4 *size* matrix\n" " pass a pair of floats corresponding with the *plane* axis.\n" " :type factor: float or float pair\n" " :return: A new shear matrix.\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * C_Matrix_Shear (PyObject *cls, PyObject *args)
 
 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" " :arg location: The translation component.\n" " :type location: :class:`Vector` or None\n" " :arg rotation: The rotation component.\n" " :type rotation: 3x3 :class:`Matrix`, :class:`Quaternion`, :class:`Euler` or None\n" " :arg scale: The scale component.\n" " :type scale: :class:`Vector` or None\n" " :return: Combined transformation matrix. \n" " :rtype: 4x4 :class:`Matrix`\n")
 
static PyObject * C_Matrix_LocRotScale (PyObject *cls, PyObject *args)
 
Matrix Methods: To Quaternion
 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 * Matrix_to_quaternion (MatrixObject *self)
 
Matrix Methods: To Euler
 PyDoc_STRVAR (Matrix_to_euler_doc, ".. method:: to_euler(order, euler_compat)\n" "\n" " Return an Euler representation of the rotation matrix\n" " (3x3 or 4x4 matrix only).\n" "\n" " :arg order: Optional rotation order argument in\n" " ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'].\n" " :type order: string\n" " :arg 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`\n" " :return: Euler representation of the matrix.\n" " :rtype: :class:`Euler`\n")
 
static PyObject * Matrix_to_euler (MatrixObject *self, PyObject *args)
 
Matrix Methods: Resize
 PyDoc_STRVAR (Matrix_resize_4x4_doc, ".. method:: resize_4x4()\n" "\n" " Resize the matrix to 4x4.\n")
 
static PyObject * Matrix_resize_4x4 (MatrixObject *self)
 
Matrix Methods: To NxN
static PyObject * Matrix_to_NxN (MatrixObject *self, const int col_num, const int row_num)
 
 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 * Matrix_to_2x2 (MatrixObject *self)
 
 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 * Matrix_to_3x3 (MatrixObject *self)
 
 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 * Matrix_to_4x4 (MatrixObject *self)
 
Matrix Methods: To Translation/Scale
 PyDoc_STRVAR (Matrix_to_translation_doc, ".. method:: to_translation()\n" "\n" " Return the translation part of a 4 row matrix.\n" "\n" " :return: Return the translation of a matrix.\n" " :rtype: :class:`Vector`\n")
 
static PyObject * Matrix_to_translation (MatrixObject *self)
 
 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 * Matrix_to_scale (MatrixObject *self)
 
Matrix Methods: Invert
static bool matrix_invert_is_compat (const MatrixObject *self)
 
static bool matrix_invert_args_check (const MatrixObject *self, PyObject *args, bool check_type)
 
static void matrix_invert_raise_degenerate (void)
 
 PyDoc_STRVAR (Matrix_invert_doc, ".. method:: invert(fallback=None)\n" "\n" " Set the matrix to its inverse.\n" "\n" " :arg 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`\n" "\n" " .. seealso:: `Inverse matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on " "Wikipedia.\n")
 
static PyObject * Matrix_invert (MatrixObject *self, PyObject *args)
 
 PyDoc_STRVAR (Matrix_inverted_doc, ".. method:: inverted(fallback=None)\n" "\n" " Return an inverted copy of the matrix.\n" "\n" " :arg 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`\n")
 
static PyObject * Matrix_inverted (MatrixObject *self, PyObject *args)
 
static PyObject * Matrix_inverted_noargs (MatrixObject *self)
 
 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 * Matrix_invert_safe (MatrixObject *self)
 
 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 * Matrix_inverted_safe (MatrixObject *self)
 
Matrix Methods: Adjugate
 PyDoc_STRVAR (Matrix_adjugate_doc, ".. method:: adjugate()\n" "\n" " Set the matrix to its adjugate.\n" "\n" " :raises ValueError: if the matrix cannot be adjugate.\n" "\n" " .. seealso:: `Adjugate matrix <https://en.wikipedia.org/wiki/Adjugate_matrix>`__ on " "Wikipedia.\n")
 
static PyObject * Matrix_adjugate (MatrixObject *self)
 
 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 * Matrix_adjugated (MatrixObject *self)
 
 PyDoc_STRVAR (Matrix_rotate_doc, ".. method:: rotate(other)\n" "\n" " Rotates the matrix by another mathutils value.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n" "\n" " .. note:: If any of the columns are not unit length this may not have desired results.\n")
 
static PyObject * Matrix_rotate (MatrixObject *self, PyObject *value)
 
Matrix Methods: Decompose
 PyDoc_STRVAR (Matrix_decompose_doc, ".. method:: decompose()\n" "\n" " Return the translation, rotation, and scale components of this matrix.\n" "\n" " :return: tuple of translation, rotation, and scale\n" " :rtype: (:class:`Vector`, :class:`Quaternion`, :class:`Vector`)")
 
static PyObject * Matrix_decompose (MatrixObject *self)
 
Matrix Methods: Linear Interpolate (lerp)
 PyDoc_STRVAR (Matrix_lerp_doc, ".. function:: 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" " :arg other: value to interpolate with.\n" " :type other: :class:`Matrix`\n" " :arg 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 * Matrix_lerp (MatrixObject *self, PyObject *args)
 
 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 * Matrix_determinant (MatrixObject *self)
 
Matrix Methods: Transpose
 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 * Matrix_transpose (MatrixObject *self)
 
 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 * Matrix_transposed (MatrixObject *self)
 
Matrix Methods: Normalize
 PyDoc_STRVAR (Matrix_normalize_doc, ".. method:: normalize()\n" "\n" " Normalize each of the matrix columns.\n")
 
static PyObject * Matrix_normalize (MatrixObject *self)
 
 PyDoc_STRVAR (Matrix_normalized_doc, ".. method:: normalized()\n" "\n" " Return a column normalized matrix\n" "\n" " :return: a column normalized matrix\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * Matrix_normalized (MatrixObject *self)
 
Matrix Methods: Zero
 PyDoc_STRVAR (Matrix_zero_doc, ".. method:: zero()\n" "\n" " Set all the matrix values to zero.\n" "\n" " :rtype: :class:`Matrix`\n")
 
static PyObject * Matrix_zero (MatrixObject *self)
 
Matrix Methods: Set Identity
static void matrix_identity_internal (MatrixObject *self)
 
 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 * Matrix_identity (MatrixObject *self)
 
Matrix Type: <tt>__repr__</tt> & <tt>__str__</tt>
static PyObject * Matrix_repr (MatrixObject *self)
 
static PyObject * Matrix_str (MatrixObject *self)
 
Matrix Type: Rich Compare
static PyObject * Matrix_richcmpr (PyObject *a, PyObject *b, int op)
 
Matrix Type: Hash (<tt>__hash__</tt>)
static Py_hash_t Matrix_hash (MatrixObject *self)
 
Matrix Type: Numeric Protocol Implementation
static PyObject * Matrix_add (PyObject *m1, PyObject *m2)
 
static PyObject * Matrix_sub (PyObject *m1, PyObject *m2)
 
static PyObject * matrix_mul_float (MatrixObject *mat, const float scalar)
 
static PyObject * Matrix_mul (PyObject *m1, PyObject *m2)
 
static PyObject * Matrix_imul (PyObject *m1, PyObject *m2)
 
static PyObject * Matrix_matmul (PyObject *m1, PyObject *m2)
 
static PyObject * Matrix_imatmul (PyObject *m1, PyObject *m2)
 
Matrix Type: Get/Set Item Implementation
 PyDoc_STRVAR (Matrix_translation_doc, "The translation component of the matrix.\n\n:type: Vector")
 
static PyObject * Matrix_translation_get (MatrixObject *self, void *UNUSED(closure))
 
static int Matrix_translation_set (MatrixObject *self, PyObject *value, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_row_doc, "Access the matrix by rows (default), (read-only).\n\n:type: Matrix Access")
 
static PyObject * Matrix_row_get (MatrixObject *self, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_col_doc, "Access the matrix by columns, 3x3 and 4x4 only, (read-only).\n\n:type: Matrix Access")
 
static PyObject * Matrix_col_get (MatrixObject *self, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_median_scale_doc, "The average scale applied to each axis (read-only).\n\n:type: float")
 
static PyObject * Matrix_median_scale_get (MatrixObject *self, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_is_identity_doc, "True if this is an identity matrix (read-only).\n\n:type: bool")
 
static PyObject * Matrix_is_identity_get (MatrixObject *self, void *UNUSED(closure))
 
 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")
 
static PyObject * Matrix_is_negative_get (MatrixObject *self, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_is_orthogonal_doc, "True if this matrix is orthogonal, 3x3 and 4x4 only, (read-only).\n\n:type: bool")
 
static PyObject * Matrix_is_orthogonal_get (MatrixObject *self, void *UNUSED(closure))
 
 PyDoc_STRVAR (Matrix_is_orthogonal_axis_vectors_doc, "True if this matrix has got orthogonal axis vectors, 3x3 and 4x4 only, " "(read-only).\n\n:type: bool")
 
static PyObject * Matrix_is_orthogonal_axis_vectors_get (MatrixObject *self, void *UNUSED(closure))
 
Matrix Type: C/API Constructors
PyObject * Matrix_CreatePyObject (const float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
 
PyObject * Matrix_CreatePyObject_wrap (float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
 
PyObject * Matrix_CreatePyObject_cb (PyObject *cb_user, const ushort col_num, const ushort row_num, uchar cb_type, uchar cb_subtype)
 
PyObject * Matrix_CreatePyObject_alloc (float *mat, const ushort col_num, const ushort row_num, PyTypeObject *base_type)
 
Matrix Type: C/API Parse Utilities
static bool Matrix_ParseCheck (MatrixObject *pymat)
 
int Matrix_ParseAny (PyObject *o, void *p)
 
int Matrix_Parse2x2 (PyObject *o, void *p)
 
int Matrix_Parse3x3 (PyObject *o, void *p)
 
int Matrix_Parse4x4 (PyObject *o, void *p)
 
Matrix-Access Type: Struct & Internal Functions
static int MatrixAccess_traverse (MatrixAccessObject *self, visitproc visit, void *arg)
 
static int MatrixAccess_clear (MatrixAccessObject *self)
 
static void MatrixAccess_dealloc (MatrixAccessObject *self)
 

Variables

Matrix Type: Protocol Declarations
static PySequenceMethods Matrix_SeqMethods
 
static PyMappingMethods Matrix_AsMapping
 
static PyNumberMethods Matrix_NumMethods
 
Matrix Type: Get/Set Item Definitions
static PyGetSetDef Matrix_getseters []
 
Matrix Type: Method Definitions
static struct PyMethodDef Matrix_methods []
 
Matrix-Access Type: Python Object Definition
PyTypeObject matrix_access_Type
 

Matrix Row Callbacks

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

uchar mathutils_matrix_row_cb_index = -1
 
Mathutils_Callback mathutils_matrix_row_cb
 
static int mathutils_matrix_row_check (BaseMathObject *bmo)
 
static int mathutils_matrix_row_get (BaseMathObject *bmo, int row)
 
static int mathutils_matrix_row_set (BaseMathObject *bmo, int row)
 
static int mathutils_matrix_row_get_index (BaseMathObject *bmo, int row, int col)
 
static int 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 mathutils_matrix_col_cb_index = -1
 
Mathutils_Callback mathutils_matrix_col_cb
 
static int mathutils_matrix_col_check (BaseMathObject *bmo)
 
static int mathutils_matrix_col_get (BaseMathObject *bmo, int col)
 
static int mathutils_matrix_col_set (BaseMathObject *bmo, int col)
 
static int mathutils_matrix_col_get_index (BaseMathObject *bmo, int col, int row)
 
static int 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 mathutils_matrix_translation_cb_index = -1
 
Mathutils_Callback mathutils_matrix_translation_cb
 
static int mathutils_matrix_translation_check (BaseMathObject *bmo)
 
static int mathutils_matrix_translation_get (BaseMathObject *bmo, int col)
 
static int mathutils_matrix_translation_set (BaseMathObject *bmo, int col)
 
static int mathutils_matrix_translation_get_index (BaseMathObject *bmo, int col, int row)
 
static int mathutils_matrix_translation_set_index (BaseMathObject *bmo, int col, int row)
 

Matrix Type: Python Object Definition

PyTypeObject matrix_Type
 
 PyDoc_STRVAR (matrix_doc, ".. class:: Matrix([rows])\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" " When omitted, a 4x4 identity matrix is constructed.\n" " :type rows: 2d number sequence\n")
 

Matrix-Access Type: Sequence Protocol

static PyMappingMethods MatrixAccess_AsMapping
 
static int MatrixAccess_len (MatrixAccessObject *self)
 
static PyObject * MatrixAccess_slice (MatrixAccessObject *self, int begin, int end)
 
static PyObject * MatrixAccess_subscript (MatrixAccessObject *self, PyObject *item)
 
static int MatrixAccess_ass_subscript (MatrixAccessObject *self, PyObject *item, PyObject *value)
 
static PyObject * MatrixAccess_iter (MatrixAccessObject *self)
 

Typedef Documentation

◆ eMatrixAccess_t

Enumeration Type Documentation

◆ eMatrixAccess_t

Enumerator
MAT_ACCESS_ROW 
MAT_ACCESS_COL 

Definition at line 22 of file mathutils_Matrix.c.

Function Documentation

◆ adjoint_matrix_n()

static void adjoint_matrix_n ( float mat_dst,
const float mat_src,
const ushort  dim 
)
static

◆ C_Matrix_Diagonal()

static PyObject* C_Matrix_Diagonal ( PyObject *  cls,
PyObject *  value 
)
static

Diagonal constructor: mathutils.Matrix.Diagonal().

Definition at line 795 of file mathutils_Matrix.c.

References mathutils_array_parse(), Matrix_CreatePyObject(), NULL, and size().

◆ C_Matrix_Identity()

static PyObject* C_Matrix_Identity ( PyObject *  cls,
PyObject *  args 
)
static

Definition at line 655 of file mathutils_Matrix.c.

References Matrix_CreatePyObject(), and NULL.

◆ C_Matrix_LocRotScale()

static PyObject* C_Matrix_LocRotScale ( PyObject *  cls,
PyObject *  args 
)
static

◆ C_Matrix_OrthoProjection()

static PyObject* C_Matrix_OrthoProjection ( PyObject *  cls,
PyObject *  args 
)
static

◆ C_Matrix_Rotation()

static PyObject* C_Matrix_Rotation ( PyObject *  cls,
PyObject *  args 
)
static

◆ C_Matrix_Scale()

static PyObject* C_Matrix_Scale ( PyObject *  cls,
PyObject *  args 
)
static

◆ C_Matrix_Shear()

static PyObject* C_Matrix_Shear ( PyObject *  cls,
PyObject *  args 
)
static

◆ C_Matrix_Translation()

static PyObject* C_Matrix_Translation ( PyObject *  cls,
PyObject *  value 
)
static

Definition at line 771 of file mathutils_Matrix.c.

References mathutils_array_parse(), Matrix_CreatePyObject(), NULL, and unit_m4().

◆ mathutils_matrix_col_check()

static int mathutils_matrix_col_check ( BaseMathObject bmo)
static

Definition at line 408 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

◆ mathutils_matrix_col_get()

static int mathutils_matrix_col_get ( BaseMathObject bmo,
int  col 
)
static

◆ mathutils_matrix_col_get_index()

static int mathutils_matrix_col_get_index ( BaseMathObject bmo,
int  col,
int  row 
)
static

◆ mathutils_matrix_col_set()

static int mathutils_matrix_col_set ( BaseMathObject bmo,
int  col 
)
static

◆ mathutils_matrix_col_set_index()

static int mathutils_matrix_col_set_index ( BaseMathObject bmo,
int  col,
int  row 
)
static

◆ mathutils_matrix_row_check()

static int mathutils_matrix_row_check ( BaseMathObject bmo)
static

Definition at line 314 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

◆ mathutils_matrix_row_get()

static int mathutils_matrix_row_get ( BaseMathObject bmo,
int  row 
)
static

◆ mathutils_matrix_row_get_index()

static int mathutils_matrix_row_get_index ( BaseMathObject bmo,
int  row,
int  col 
)
static

◆ mathutils_matrix_row_set()

static int mathutils_matrix_row_set ( BaseMathObject bmo,
int  row 
)
static

◆ mathutils_matrix_row_set_index()

static int mathutils_matrix_row_set_index ( BaseMathObject bmo,
int  row,
int  col 
)
static

◆ mathutils_matrix_translation_check()

static int mathutils_matrix_translation_check ( BaseMathObject bmo)
static

Definition at line 512 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

◆ mathutils_matrix_translation_get()

static int mathutils_matrix_translation_get ( BaseMathObject bmo,
int  col 
)
static

Definition at line 518 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, col, if(), and MATRIX_ITEM.

◆ mathutils_matrix_translation_get_index()

static int mathutils_matrix_translation_get_index ( BaseMathObject bmo,
int  col,
int  row 
)
static

Definition at line 551 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, col, if(), and MATRIX_ITEM.

◆ mathutils_matrix_translation_set()

static int mathutils_matrix_translation_set ( BaseMathObject bmo,
int  col 
)
static

◆ mathutils_matrix_translation_set_index()

static int mathutils_matrix_translation_set_index ( BaseMathObject bmo,
int  col,
int  row 
)
static

◆ matrix_3x3_as_4x4()

static void matrix_3x3_as_4x4 ( float  mat[16])
static

When a matrix is 4x4 size but initialized as a 3x3, re-assign values for 4x4.

Definition at line 64 of file mathutils_Matrix.c.

Referenced by C_Matrix_OrthoProjection(), C_Matrix_Rotation(), C_Matrix_Scale(), and C_Matrix_Shear().

◆ matrix__apply_to_copy()

static PyObject * matrix__apply_to_copy ( PyObject *(*)(MatrixObject *)  matrix_func,
MatrixObject self 
)
static

Definition at line 274 of file mathutils_Matrix.c.

References Matrix_copy(), NULL, and ret.

Referenced by Matrix_adjugated(), Matrix_normalized(), and Matrix_transposed().

◆ Matrix_add()

static PyObject* Matrix_add ( PyObject *  m1,
PyObject *  m2 
)
static

◆ Matrix_adjugate()

static PyObject* Matrix_adjugate ( MatrixObject self)
static

◆ Matrix_adjugated()

static PyObject* Matrix_adjugated ( MatrixObject self)
static

Definition at line 1821 of file mathutils_Matrix.c.

References matrix__apply_to_copy(), and Matrix_adjugate().

◆ matrix_as_3x3()

void matrix_as_3x3 ( float  mat[3][3],
MatrixObject self 
)

◆ Matrix_ass_item_col()

static int Matrix_ass_item_col ( MatrixObject self,
int  col,
PyObject *  value 
)
static

Sequence accessor (set): object.col[i] = x.

Definition at line 2462 of file mathutils_Matrix.c.

References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, col, mathutils_array_parse(), MATRIX_ITEM, MATRIX_MAX_DIM, self, and void.

Referenced by MatrixAccess_ass_subscript().

◆ Matrix_ass_item_row()

static int Matrix_ass_item_row ( MatrixObject self,
int  row,
PyObject *  value 
)
static

◆ Matrix_ass_slice()

static int Matrix_ass_slice ( MatrixObject self,
int  begin,
int  end,
PyObject *  value 
)
static

Sequence slice accessor (set): object[i:j] = x.

Definition at line 2516 of file mathutils_Matrix.c.

References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, col, mathutils_array_parse(), MATRIX_MAX_DIM, MIN2, self, size(), and void.

Referenced by Matrix_ass_subscript(), and Matrix_new().

◆ Matrix_ass_subscript()

static int Matrix_ass_subscript ( MatrixObject self,
PyObject *  item,
PyObject *  value 
)
static

Sequence generic subscript (set): object[...] = x.

Definition at line 2614 of file mathutils_Matrix.c.

References Matrix_ass_item_row(), Matrix_ass_slice(), and self.

◆ Matrix_col_get()

static PyObject* Matrix_col_get ( MatrixObject self,
void UNUSEDclosure 
)
static

Definition at line 3097 of file mathutils_Matrix.c.

References MAT_ACCESS_COL, and MatrixAccess_CreatePyObject().

◆ matrix_col_vector_check()

static int matrix_col_vector_check ( MatrixObject mat,
VectorObject vec,
int  col 
)
static

◆ matrix_copy()

static void matrix_copy ( MatrixObject mat_dst,
const MatrixObject mat_src 
)
static

Definition at line 83 of file mathutils_Matrix.c.

References BLI_assert, MatrixObject::col_num, and MatrixObject::row_num.

Referenced by Matrix_invert().

◆ Matrix_copy()

static PyObject * Matrix_copy ( MatrixObject self)
static

Definition at line 2200 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, Matrix_copy_notest(), NULL, and self.

Referenced by matrix__apply_to_copy(), and Matrix_deepcopy().

◆ Matrix_copy_notest()

static PyObject * Matrix_copy_notest ( MatrixObject self,
const float matrix 
)
static

Copy Matrix.copy()

Definition at line 2188 of file mathutils_Matrix.c.

References Matrix_CreatePyObject(), and self.

Referenced by Matrix_copy(), Matrix_inverted(), and Matrix_inverted_safe().

◆ Matrix_CreatePyObject()

PyObject* Matrix_CreatePyObject ( const float mat,
const ushort  col_num,
const ushort  row_num,
PyTypeObject *  base_type 
)

◆ Matrix_CreatePyObject_alloc()

PyObject* Matrix_CreatePyObject_alloc ( float mat,
ushort  col_num,
ushort  row_num,
PyTypeObject *  base_type 
)
Parameters
matInitialized matrix value to use in-place, allocated with #PyMem_Malloc

Definition at line 3490 of file mathutils_Matrix.c.

References BASE_MATH_FLAG_IS_WRAP, and Matrix_CreatePyObject_wrap().

Referenced by Matrix_to_NxN().

◆ Matrix_CreatePyObject_cb()

PyObject* Matrix_CreatePyObject_cb ( PyObject *  cb_user,
const ushort  col_num,
const ushort  row_num,
uchar  cb_type,
uchar  cb_subtype 
)

Definition at line 3476 of file mathutils_Matrix.c.

References Matrix_CreatePyObject(), and NULL.

Referenced by pyrna_math_object_from_array().

◆ Matrix_CreatePyObject_wrap()

PyObject* Matrix_CreatePyObject_wrap ( float mat,
const ushort  col_num,
const ushort  row_num,
PyTypeObject *  base_type 
)

◆ Matrix_decompose()

static PyObject* Matrix_decompose ( MatrixObject self)
static

◆ Matrix_deepcopy()

static PyObject * Matrix_deepcopy ( MatrixObject self,
PyObject *  args 
)
static

Deep-copy Matrix.deepcopy()

Definition at line 2210 of file mathutils_Matrix.c.

References Matrix_copy(), NULL, and PyC_CheckArgs_DeepCopy().

◆ Matrix_determinant()

static PyObject* Matrix_determinant ( MatrixObject self)
static

Definition at line 1980 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, matrix_determinant_internal(), NULL, and self.

◆ matrix_determinant_internal()

static float matrix_determinant_internal ( const MatrixObject self)
static

Assumes rowsize == colsize is checked and the read callback has run.

Definition at line 116 of file mathutils_Matrix.c.

References determinant_m2(), determinant_m3(), determinant_m4(), MATRIX_ITEM, and self.

Referenced by Matrix_determinant(), matrix_invert_internal(), and matrix_invert_safe_internal().

◆ Matrix_hash()

static Py_hash_t Matrix_hash ( MatrixObject self)
static

◆ Matrix_identity()

static PyObject* Matrix_identity ( MatrixObject self)
static

◆ matrix_identity_internal()

static void matrix_identity_internal ( MatrixObject self)
static

Definition at line 2134 of file mathutils_Matrix.c.

References BLI_assert, self, unit_m2(), unit_m3(), and unit_m4().

Referenced by Matrix_CreatePyObject(), and Matrix_identity().

◆ Matrix_imatmul()

static PyObject* Matrix_imatmul ( PyObject *  m1,
PyObject *  m2 
)
static

Multiplication in-place (matrix multiply): object @= object.

Definition at line 2909 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, BaseMath_WriteCallback, col, MatrixObject::col_num, blender::math::dot(), double(), MATRIX_ITEM, MATRIX_MAX_DIM, MatrixObject_Check, NULL, MatrixObject::row_num, and void.

◆ Matrix_imul()

static PyObject* Matrix_imul ( PyObject *  m1,
PyObject *  m2 
)
static

Multiplication in-place (element-wise): object *= object.

Definition at line 2784 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, BaseMath_WriteCallback, MatrixObject::col_num, MatrixObject_Check, mul_vn_fl(), mul_vn_vn(), NULL, MatrixObject::row_num, and void.

◆ Matrix_invert()

static PyObject* Matrix_invert ( MatrixObject self,
PyObject *  args 
)
static

◆ matrix_invert_args_check()

static bool matrix_invert_args_check ( const MatrixObject self,
PyObject *  args,
bool  check_type 
)
static

◆ matrix_invert_internal()

static bool matrix_invert_internal ( const MatrixObject self,
float r_mat 
)
static
Parameters
r_matcan be from self->matrix or not.

Definition at line 185 of file mathutils_Matrix.c.

References BLI_assert, matrix_determinant_internal(), matrix_invert_with_det_n_internal(), and self.

Referenced by Matrix_invert(), Matrix_inverted(), and Matrix_inverted_noargs().

◆ matrix_invert_is_compat()

static bool matrix_invert_is_compat ( const MatrixObject self)
static

Re-usable checks for invert.

Definition at line 1549 of file mathutils_Matrix.c.

References self.

Referenced by Matrix_invert(), Matrix_invert_safe(), Matrix_inverted(), Matrix_inverted_noargs(), and Matrix_inverted_safe().

◆ matrix_invert_raise_degenerate()

static void matrix_invert_raise_degenerate ( void  )
static

Definition at line 1593 of file mathutils_Matrix.c.

Referenced by Matrix_invert(), Matrix_inverted(), and Matrix_inverted_noargs().

◆ Matrix_invert_safe()

static PyObject* Matrix_invert_safe ( MatrixObject self)
static

◆ matrix_invert_safe_internal()

static void matrix_invert_safe_internal ( const MatrixObject self,
float r_mat 
)
static

◆ matrix_invert_with_det_n_internal()

static void matrix_invert_with_det_n_internal ( float mat_dst,
const float mat_src,
const float  det,
const ushort  dim 
)
static

◆ Matrix_inverted()

static PyObject* Matrix_inverted ( MatrixObject self,
PyObject *  args 
)
static

◆ Matrix_inverted_noargs()

static PyObject* Matrix_inverted_noargs ( MatrixObject self)
static

◆ Matrix_inverted_safe()

static PyObject* Matrix_inverted_safe ( MatrixObject self)
static

◆ matrix_is_identity()

static bool matrix_is_identity ( MatrixObject self)
static

Definition at line 293 of file mathutils_Matrix.c.

References col, and MATRIX_ITEM.

Referenced by Matrix_is_identity_get().

◆ Matrix_is_identity_get()

static PyObject* Matrix_is_identity_get ( MatrixObject self,
void UNUSEDclosure 
)
static

Definition at line 3127 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, matrix_is_identity(), and NULL.

◆ Matrix_is_negative_get()

static PyObject* Matrix_is_negative_get ( MatrixObject self,
void UNUSEDclosure 
)
static

Definition at line 3138 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, is_negative_m3(), is_negative_m4(), NULL, and self.

◆ Matrix_is_orthogonal_axis_vectors_get()

static PyObject* Matrix_is_orthogonal_axis_vectors_get ( MatrixObject self,
void UNUSEDclosure 
)
static

◆ Matrix_is_orthogonal_get()

static PyObject* Matrix_is_orthogonal_get ( MatrixObject self,
void UNUSEDclosure 
)
static

◆ Matrix_item_col()

static PyObject* Matrix_item_col ( MatrixObject self,
int  col 
)
static

Sequence accessor (get): x = object.col[i].

Note
the wrapped vector gives direct access to the matrix data.

Definition at line 2417 of file mathutils_Matrix.c.

References BaseMath_ReadCallback_ForWrite, col, mathutils_matrix_col_cb_index, NULL, self, and Vector_CreatePyObject_cb().

Referenced by MatrixAccess_slice(), and MatrixAccess_subscript().

◆ Matrix_item_row()

static PyObject* Matrix_item_row ( MatrixObject self,
int  row 
)
static

Sequence accessor (get): x = object[i].

Note
the wrapped vector gives direct access to the matrix data.

Definition at line 2398 of file mathutils_Matrix.c.

References BaseMath_ReadCallback_ForWrite, mathutils_matrix_row_cb_index, NULL, self, and Vector_CreatePyObject_cb().

Referenced by Matrix_subscript(), MatrixAccess_slice(), and MatrixAccess_subscript().

◆ Matrix_len()

static int Matrix_len ( MatrixObject self)
static

Sequence length: len(object).

Definition at line 2389 of file mathutils_Matrix.c.

◆ Matrix_lerp()

static PyObject* Matrix_lerp ( MatrixObject self,
PyObject *  args 
)
static

◆ Matrix_matmul()

static PyObject* Matrix_matmul ( PyObject *  m1,
PyObject *  m2 
)
static

◆ Matrix_median_scale_get()

static PyObject* Matrix_median_scale_get ( MatrixObject self,
void UNUSEDclosure 
)
static

Definition at line 3104 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, mat3_to_scale(), matrix_as_3x3(), NULL, and self.

◆ Matrix_mul()

static PyObject* Matrix_mul ( PyObject *  m1,
PyObject *  m2 
)
static

◆ matrix_mul_float()

static PyObject* matrix_mul_float ( MatrixObject mat,
const float  scalar 
)
static

Multiplication (element-wise): object * object.

Definition at line 2721 of file mathutils_Matrix.c.

References MatrixObject::col_num, Matrix_CreatePyObject(), MATRIX_MAX_DIM, mul_vn_vn_fl(), and MatrixObject::row_num.

Referenced by Matrix_mul().

◆ Matrix_new()

static PyObject* Matrix_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 591 of file mathutils_Matrix.c.

References Matrix_ass_slice(), Matrix_CreatePyObject(), NULL, and type.

◆ Matrix_normalize()

static PyObject* Matrix_normalize ( MatrixObject self)
static

◆ Matrix_normalized()

static PyObject* Matrix_normalized ( MatrixObject self)
static

Definition at line 2096 of file mathutils_Matrix.c.

References matrix__apply_to_copy(), and Matrix_normalize().

◆ Matrix_Parse2x2()

int Matrix_Parse2x2 ( PyObject *  o,
void p 
)

Definition at line 3539 of file mathutils_Matrix.c.

References MatrixObject::col_num, Matrix_ParseCheck(), and MatrixObject::row_num.

Referenced by Vector_rotate().

◆ Matrix_Parse3x3()

int Matrix_Parse3x3 ( PyObject *  o,
void p 
)

◆ Matrix_Parse4x4()

int Matrix_Parse4x4 ( PyObject *  o,
void p 
)

◆ Matrix_ParseAny()

int Matrix_ParseAny ( PyObject *  o,
void p 
)

Definition at line 3527 of file mathutils_Matrix.c.

References Matrix_ParseCheck().

Referenced by bpy_slot_from_py().

◆ Matrix_ParseCheck()

static bool Matrix_ParseCheck ( MatrixObject pymat)
static

Use with PyArg_ParseTuple's "O&" formatting.

Definition at line 3513 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, and MatrixObject_Check.

Referenced by Matrix_Parse2x2(), Matrix_Parse3x3(), Matrix_Parse4x4(), and Matrix_ParseAny().

◆ Matrix_repr()

static PyObject* Matrix_repr ( MatrixObject self)
static

Definition at line 2224 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, col, MATRIX_ITEM, MATRIX_MAX_DIM, NULL, and self.

◆ Matrix_resize_4x4()

static PyObject* Matrix_resize_4x4 ( MatrixObject self)
static

◆ Matrix_richcmpr()

static PyObject* Matrix_richcmpr ( PyObject *  a,
PyObject *  b,
int  op 
)
static

◆ Matrix_rotate()

static PyObject* Matrix_rotate ( MatrixObject self,
PyObject *  value 
)
static

◆ Matrix_row_get()

static PyObject* Matrix_row_get ( MatrixObject self,
void UNUSEDclosure 
)
static

Definition at line 3089 of file mathutils_Matrix.c.

References MAT_ACCESS_ROW, and MatrixAccess_CreatePyObject().

◆ matrix_row_vector_check()

static int matrix_row_vector_check ( MatrixObject mat,
VectorObject vec,
int  row 
)
static

◆ Matrix_slice()

static PyObject* Matrix_slice ( MatrixObject self,
int  begin,
int  end 
)
static

Sequence slice accessor (get): x = object[i:j].

Definition at line 2490 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, CLAMP, count, mathutils_matrix_row_cb_index, MIN2, NULL, self, and Vector_CreatePyObject_cb().

Referenced by Matrix_subscript().

◆ Matrix_str()

static PyObject* Matrix_str ( MatrixObject self)
static

◆ Matrix_sub()

static PyObject* Matrix_sub ( PyObject *  m1,
PyObject *  m2 
)
static

◆ Matrix_subscript()

static PyObject* Matrix_subscript ( MatrixObject self,
PyObject *  item 
)
static

Sequence generic subscript (get): x = object[...].

Definition at line 2577 of file mathutils_Matrix.c.

References Matrix_item_row(), Matrix_slice(), NULL, and self.

◆ Matrix_to_2x2()

static PyObject* Matrix_to_2x2 ( MatrixObject self)
static

Definition at line 1438 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, Matrix_to_NxN(), and NULL.

◆ Matrix_to_3x3()

static PyObject* Matrix_to_3x3 ( MatrixObject self)
static

Definition at line 1453 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, Matrix_to_NxN(), and NULL.

◆ Matrix_to_4x4()

static PyObject* Matrix_to_4x4 ( MatrixObject self)
static

Definition at line 1468 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, Matrix_to_NxN(), and NULL.

◆ Matrix_to_euler()

static PyObject* Matrix_to_euler ( MatrixObject self,
PyObject *  args 
)
static

◆ Matrix_to_NxN()

static PyObject* Matrix_to_NxN ( MatrixObject self,
const int  col_num,
const int  row_num 
)
static

◆ Matrix_to_quaternion()

static PyObject* Matrix_to_quaternion ( MatrixObject self)
static

◆ Matrix_to_scale()

static PyObject* Matrix_to_scale ( MatrixObject self)
static

◆ Matrix_to_translation()

static PyObject* Matrix_to_translation ( MatrixObject self)
static

◆ Matrix_translation_get()

static PyObject* Matrix_translation_get ( MatrixObject self,
void UNUSEDclosure 
)
static

◆ Matrix_translation_set()

static int Matrix_translation_set ( MatrixObject self,
PyObject *  value,
void UNUSEDclosure 
)
static

◆ Matrix_transpose()

static PyObject* Matrix_transpose ( MatrixObject self)
static

◆ matrix_transpose_internal()

static void matrix_transpose_internal ( float  mat_dst_fl[],
const MatrixObject mat_src 
)
static

Transposes memory layout, row/columns don't have to match.

Definition at line 103 of file mathutils_Matrix.c.

References col, MatrixObject::col_num, MATRIX_ITEM, and MatrixObject::row_num.

Referenced by Matrix_hash().

◆ Matrix_transposed()

static PyObject* Matrix_transposed ( MatrixObject self)
static

Definition at line 2045 of file mathutils_Matrix.c.

References matrix__apply_to_copy(), and Matrix_transpose().

◆ matrix_unit_internal()

static void matrix_unit_internal ( MatrixObject self)
static

Definition at line 91 of file mathutils_Matrix.c.

References col, float(), min_ii(), and self.

Referenced by Matrix_to_NxN().

◆ Matrix_zero()

static PyObject* Matrix_zero ( MatrixObject self)
static

◆ MatrixAccess_ass_subscript()

static int MatrixAccess_ass_subscript ( MatrixAccessObject self,
PyObject *  item,
PyObject *  value 
)
static

◆ MatrixAccess_clear()

static int MatrixAccess_clear ( MatrixAccessObject self)
static

Definition at line 3608 of file mathutils_Matrix.c.

References self.

Referenced by MatrixAccess_dealloc().

◆ MatrixAccess_CreatePyObject()

static PyObject * MatrixAccess_CreatePyObject ( MatrixObject matrix,
const eMatrixAccess_t  type 
)
static

◆ MatrixAccess_dealloc()

static void MatrixAccess_dealloc ( MatrixAccessObject self)
static

Definition at line 3614 of file mathutils_Matrix.c.

References MatrixAccess_clear(), and self.

◆ MatrixAccess_iter()

static PyObject* MatrixAccess_iter ( MatrixAccessObject self)
static

Definition at line 3744 of file mathutils_Matrix.c.

References MATRIX_MAX_DIM, MatrixAccess_slice(), NULL, and ret.

◆ MatrixAccess_len()

static int MatrixAccess_len ( MatrixAccessObject self)
static

Definition at line 3630 of file mathutils_Matrix.c.

References MAT_ACCESS_ROW, and self.

Referenced by MatrixAccess_subscript().

◆ MatrixAccess_slice()

static PyObject* MatrixAccess_slice ( MatrixAccessObject self,
int  begin,
int  end 
)
static

◆ MatrixAccess_subscript()

static PyObject* MatrixAccess_subscript ( MatrixAccessObject self,
PyObject *  item 
)
static

◆ MatrixAccess_traverse()

static int MatrixAccess_traverse ( MatrixAccessObject self,
visitproc  visit,
void arg 
)
static

Definition at line 3602 of file mathutils_Matrix.c.

References self.

◆ PyDoc_STRVAR() [1/42]

PyDoc_STRVAR ( C_Matrix_Diagonal_doc  ,
".. classmethod:: Diagonal(vector)\n" "\n" " Create a diagonal (scaling) matrix using the values from the vector.\n" "\n" " :arg vector: The vector of values for the diagonal.\n" " :type vector: :class:`Vector`\n" " :return: A diagonal matrix.\n" " :rtype: :class:`Matrix`\n"   
)

◆ PyDoc_STRVAR() [2/42]

PyDoc_STRVAR ( C_Matrix_Identity_doc  ,
".. classmethod:: Identity(size)\n" "\n" " Create an identity matrix.\n" "\n" " :arg size: The size of the identity matrix to construct .\n" " :type size: int\n" " :return: A new identity matrix.\n" " :rtype: :class:`Matrix`\n"  [2, 4] 
)

Identity constructor: mathutils.Matrix.Identity().

◆ PyDoc_STRVAR() [3/42]

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" " :arg location:The translation component.\n" " :type location::class:`Vector` or None\n" " :arg rotation:The rotation component.\n" " :type rotation:3x3 :class:`Matrix`  ,
:class:`Quaternion`  ,
:class:`Euler` or None\n" " :arg scale:The scale component.\n" " :type scale::class:`Vector` or None\n" " :return:Combined transformation matrix. \n" " :rtype:4x4 :class:`Matrix`\n"   
)

◆ PyDoc_STRVAR() [4/42]

PyDoc_STRVAR ( C_Matrix_OrthoProjection_doc  ,
".. classmethod:: OrthoProjection(axis, size)\n" "\n" " Create a matrix to represent an orthographic projection.\n" "\n" " :arg axis: Can be any of the following:   [ 'X', 'Y', 'XY', 'XZ', 'YZ'],
\n" " where a single axis is for a 2D matrix.\n" " Or a vector for an arbitrary axis\n" " :type axis:string or :class:`Vector`\n" " :arg size:The size of the projection matrix to construct .\n" " :type size:int\n" " :return:A new projection matrix.\n" " :rtype::class:`Matrix`\n"  [2, 4] 
)

Orthographic projection constructor: mathutils.Matrix.OrthoProjection().

◆ PyDoc_STRVAR() [5/42]

PyDoc_STRVAR ( C_Matrix_Rotation_doc  ,
".. classmethod:: Rotation(angle, size, axis)\n" "\n" " Create a matrix representing a rotation.\n" "\n" " :arg angle: The angle of rotation  desired,
in radians.\n" " :type angle:float\n" " :arg size:The size of the rotation matrix to construct .\n" " :type size:int\n" " :arg axis:a string in or a 3D Vector Object\n" "(optional when size is 2).\n" " :type axis:string or :class:`Vector`\n" " :return:A new rotation matrix.\n" " :rtype::class:`Matrix`\n"  [2, 4][ 'X', 'Y', 'Z'] 
)

Rotation constructor: mathutils.Matrix.Rotation().

◆ PyDoc_STRVAR() [6/42]

PyDoc_STRVAR ( C_Matrix_Scale_doc  ,
".. classmethod:: Scale(factor, size, axis)\n" "\n" " Create a matrix representing a scaling.\n" "\n" " :arg factor: The factor of scaling to apply.\n" " :type factor: float\n" " :arg size: The size of the scale matrix to construct .\n" " :type size: int\n" " :arg axis: Direction to influence scale. (optional).\n" " :type axis: :class:`Vector`\n" " :return: A new scale matrix.\n" " :rtype: :class:`Matrix`\n"  [2, 4] 
)

Scale constructor: mathutils.Matrix.Scale().

◆ PyDoc_STRVAR() [7/42]

PyDoc_STRVAR ( C_Matrix_Shear_doc  ,
".. classmethod:: Shear(plane, size, factor)\n" "\n" " Create a matrix to represent an shear transformation.\n" "\n" " :arg plane: Can be any of the following:   [ 'X', 'Y', 'XY', 'XZ', 'YZ'],
\n" " where a single axis is for a 2D matrix only.\n" " :type plane:string\n" " :arg size:The size of the shear matrix to construct .\n" " :type size:int\n" " :arg factor:The factor of shear to apply. For a 3 or 4 *size *matrix\n" " pass a pair of floats corresponding with the *plane *axis.\n" " :type factor:float or float pair\n" " :return:A new shear matrix.\n" " :rtype::class:`Matrix`\n"  [2, 4] 
)

Shear constructor: mathutils.Matrix.Shear().

◆ PyDoc_STRVAR() [8/42]

PyDoc_STRVAR ( C_Matrix_Translation_doc  ,
".. classmethod:: Translation(vector)\n" "\n" " Create a matrix representing a translation.\n" "\n" " :arg vector: The translation vector.\n" " :type vector: :class:`Vector`\n" " :return: An identity matrix with a translation.\n" " :rtype: :class:`Matrix`\n"   
)

Translation constructor: mathutils.Matrix.Translation().

◆ PyDoc_STRVAR() [9/42]

PyDoc_STRVAR ( Matrix_adjugate_doc  ,
".. method:: adjugate()\n" "\n" " Set the matrix to its adjugate.\n" "\n" " :raises ValueError: if the matrix cannot be adjugate.\n" "\n" " .. seealso:: `Adjugate matrix <https://en.wikipedia.org/wiki/Adjugate_matrix>`__ on " "Wikipedia.\n"   
)

◆ PyDoc_STRVAR() [10/42]

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"   
)

◆ PyDoc_STRVAR() [11/42]

PyDoc_STRVAR ( Matrix_col_doc  ,
"Access the matrix by  columns,
3x3 and 4x4  only,
(read-only).\n\n:type:Matrix Access"   
)

◆ PyDoc_STRVAR() [12/42]

PyDoc_STRVAR ( Matrix_copy_doc  ,
".. method:: copy()\n" "\n" " Returns a copy of this matrix.\n" "\n" " :return: an instance of itself\n" " :rtype: :class:`Matrix`\n"   
)

◆ PyDoc_STRVAR() [13/42]

PyDoc_STRVAR ( Matrix_decompose_doc  ,
".. method:: decompose()\n" "\n" " Return the  translation,
rotation  ,
and scale components of this matrix.\n" "\n" " :return:tuple of  translation,
rotation  ,
and scale\n" " :rtype:(:class:`Vector`, :class:`Quaternion`, :class:`Vector`)"   
)

◆ PyDoc_STRVAR() [14/42]

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"   
)

◆ PyDoc_STRVAR() [15/42]

PyDoc_STRVAR ( matrix_doc  ,
".. class:: Matrix([rows])\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" " When  omitted,
a 4x4 identity matrix is constructed.\n" " :type rows:2d number sequence\n"   
)

◆ PyDoc_STRVAR() [16/42]

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"   
)

◆ PyDoc_STRVAR() [17/42]

PyDoc_STRVAR ( Matrix_invert_doc  ,
".. method:: invert(fallback=None)\n" "\n" " Set the matrix to its inverse.\n" "\n" " :arg 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`\n" "\n" " .. seealso:: `Inverse matrix <https://en.wikipedia.org/wiki/Inverse_matrix>`__ on " "Wikipedia.\n"   
)

◆ PyDoc_STRVAR() [18/42]

PyDoc_STRVAR ( Matrix_invert_safe_doc  ,
".. method:: invert_safe()\n" "\n" " Set the matrix to its  inverse,
will never error.\n" " If   degeneratede.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"   
)

◆ PyDoc_STRVAR() [19/42]

PyDoc_STRVAR ( Matrix_inverted_doc  ,
".. method:: inverted(fallback=None)\n" "\n" " Return an inverted copy of the matrix.\n" "\n" " :arg 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`\n"   
)

◆ PyDoc_STRVAR() [20/42]

PyDoc_STRVAR ( Matrix_inverted_safe_doc  ,
".. method:: inverted_safe()\n" "\n" " Return an inverted copy of the  matrix,
will never error.\n" " If   degeneratede.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"   
)

◆ PyDoc_STRVAR() [21/42]

PyDoc_STRVAR ( Matrix_is_identity_doc  ,
"True if this is an identity matrix (read-only).\n\n:type: bool  
)

◆ PyDoc_STRVAR() [22/42]

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"   
)

◆ PyDoc_STRVAR() [23/42]

PyDoc_STRVAR ( Matrix_is_orthogonal_axis_vectors_doc  ,
"True if this matrix has got orthogonal axis  vectors,
3x3 and 4x4  only,
" "(read-only).\n\n:type:bool"   
)

◆ PyDoc_STRVAR() [24/42]

PyDoc_STRVAR ( Matrix_is_orthogonal_doc  ,
"True if this matrix is  orthogonal,
3x3 and 4x4  only,
(read-only).\n\n:type:bool"   
)

◆ PyDoc_STRVAR() [25/42]

PyDoc_STRVAR ( Matrix_lerp_doc  ,
".. function:: 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" " :arg other:value to interpolate with.\n" " :type other::class:`Matrix`\n" " :arg factor:The interpolation value in .\n" " :type factor:float\n" " :return:The interpolated matrix.\n" " :rtype::class:`Matrix`\n"  [0.0, 1.0] 
)

◆ PyDoc_STRVAR() [26/42]

PyDoc_STRVAR ( Matrix_median_scale_doc  ,
"The average scale applied to each axis (read-only).\n\n:type: float  
)

◆ PyDoc_STRVAR() [27/42]

PyDoc_STRVAR ( Matrix_normalize_doc  ,
".. method:: normalize()\n" "\n" " Normalize each of the matrix columns.\n"   
)

◆ PyDoc_STRVAR() [28/42]

PyDoc_STRVAR ( Matrix_normalized_doc  ,
".. method:: normalized()\n" "\n" " Return a column normalized matrix\n" "\n" " :return: a column normalized matrix\n" " :rtype: :class:`Matrix`\n"   
)

◆ PyDoc_STRVAR() [29/42]

PyDoc_STRVAR ( Matrix_resize_4x4_doc  ,
".. method:: resize_4x4()\n" "\n" " Resize the matrix to 4x4.\n"   
)

◆ PyDoc_STRVAR() [30/42]

PyDoc_STRVAR ( Matrix_rotate_doc  ,
".. method:: rotate(other)\n" "\n" " Rotates the matrix by another mathutils value.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler`  ,
:class:`Quaternion` or :class:`Matrix`\n" "\n" " .. note::If any of the columns are not unit length this may not have desired results.\n"   
)

◆ PyDoc_STRVAR() [31/42]

PyDoc_STRVAR ( Matrix_row_doc  ,
"Access the matrix by rows   default,
(read-only).\n\n:type:Matrix Access"   
)

◆ PyDoc_STRVAR() [32/42]

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"   
)

◆ PyDoc_STRVAR() [33/42]

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"   
)

◆ PyDoc_STRVAR() [34/42]

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"   
)

◆ PyDoc_STRVAR() [35/42]

PyDoc_STRVAR ( Matrix_to_euler_doc  ,
".. method:: to_euler(order, euler_compat)\n" "\n" " Return an Euler representation of the rotation matrix\n" " (3x3 or 4x4 matrix only).\n" "\n" " :arg order: Optional rotation order argument in\n" " .\n" " :type order: string\n" " :arg 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`\n" " :return: Euler representation of the matrix.\n" " :rtype: :class:`Euler`\n"  [ 'XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'] 
)

◆ PyDoc_STRVAR() [36/42]

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"   
)

◆ PyDoc_STRVAR() [37/42]

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"   
)

◆ PyDoc_STRVAR() [38/42]

PyDoc_STRVAR ( Matrix_to_translation_doc  ,
".. method:: to_translation()\n" "\n" " Return the translation part of a 4 row matrix.\n" "\n" " :return: Return the translation of a matrix.\n" " :rtype: :class:`Vector`\n"   
)

◆ PyDoc_STRVAR() [39/42]

PyDoc_STRVAR ( Matrix_translation_doc  ,
"The translation component of the matrix.\n\n:type: Vector"   
)

◆ PyDoc_STRVAR() [40/42]

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"   
)

◆ PyDoc_STRVAR() [41/42]

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"   
)

◆ PyDoc_STRVAR() [42/42]

PyDoc_STRVAR ( Matrix_zero_doc  ,
".. method:: zero()\n" "\n" " Set all the matrix values to zero.\n" "\n" " :rtype: :class:`Matrix`\n"   
)

Variable Documentation

◆ mathutils_matrix_col_cb

Mathutils_Callback mathutils_matrix_col_cb
Initial value:
= {
}
static int mathutils_matrix_col_set(BaseMathObject *bmo, int col)
static int mathutils_matrix_col_get(BaseMathObject *bmo, int col)
static int mathutils_matrix_col_get_index(BaseMathObject *bmo, int col, int row)
static int mathutils_matrix_col_check(BaseMathObject *bmo)
static int mathutils_matrix_col_set_index(BaseMathObject *bmo, int col, int row)

Definition at line 493 of file mathutils_Matrix.c.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_col_cb_index

uchar mathutils_matrix_col_cb_index = -1

Definition at line 406 of file mathutils_Matrix.c.

Referenced by Matrix_item_col(), and PyInit_mathutils().

◆ mathutils_matrix_row_cb

Mathutils_Callback mathutils_matrix_row_cb
Initial value:
= {
}
static int mathutils_matrix_row_set(BaseMathObject *bmo, int row)
static int mathutils_matrix_row_get_index(BaseMathObject *bmo, int row, int col)
static int mathutils_matrix_row_set_index(BaseMathObject *bmo, int row, int col)
static int mathutils_matrix_row_check(BaseMathObject *bmo)
static int mathutils_matrix_row_get(BaseMathObject *bmo, int row)

Definition at line 391 of file mathutils_Matrix.c.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_row_cb_index

uchar mathutils_matrix_row_cb_index = -1

Definition at line 312 of file mathutils_Matrix.c.

Referenced by Matrix_item_row(), Matrix_slice(), and PyInit_mathutils().

◆ mathutils_matrix_translation_cb

Mathutils_Callback mathutils_matrix_translation_cb
Initial value:
= {
}
static int mathutils_matrix_translation_set_index(BaseMathObject *bmo, int col, int row)
static int mathutils_matrix_translation_get_index(BaseMathObject *bmo, int col, int row)
static int mathutils_matrix_translation_get(BaseMathObject *bmo, int col)
static int mathutils_matrix_translation_check(BaseMathObject *bmo)
static int mathutils_matrix_translation_set(BaseMathObject *bmo, int col)

Definition at line 577 of file mathutils_Matrix.c.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_translation_cb_index

uchar mathutils_matrix_translation_cb_index = -1

Definition at line 510 of file mathutils_Matrix.c.

Referenced by Matrix_translation_get(), and PyInit_mathutils().

◆ matrix_access_Type

PyTypeObject matrix_access_Type
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0) "MatrixAccess",
0,
(destructor)MatrixAccess_dealloc,
(printfunc)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL ,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
NULL,
(traverseproc)MatrixAccess_traverse,
(inquiry)MatrixAccess_clear,
NULL ,
0,
(getiterfunc)MatrixAccess_iter,
}
static PyMappingMethods MatrixAccess_AsMapping
static int MatrixAccess_clear(MatrixAccessObject *self)
static PyObject * MatrixAccess_iter(MatrixAccessObject *self)
static int MatrixAccess_traverse(MatrixAccessObject *self, visitproc visit, void *arg)
static void MatrixAccess_dealloc(MatrixAccessObject *self)

Definition at line 3773 of file mathutils_Matrix.c.

Referenced by MatrixAccess_CreatePyObject(), and PyInit_mathutils().

◆ Matrix_AsMapping

PyMappingMethods Matrix_AsMapping
static
Initial value:
= {
(lenfunc)Matrix_len,
(binaryfunc)Matrix_subscript,
(objobjargproc)Matrix_ass_subscript,
}
static int Matrix_len(MatrixObject *self)
static int Matrix_ass_subscript(MatrixObject *self, PyObject *item, PyObject *value)
static PyObject * Matrix_subscript(MatrixObject *self, PyObject *item)

Definition at line 2986 of file mathutils_Matrix.c.

◆ Matrix_getseters

PyGetSetDef Matrix_getseters[]
static

Definition at line 3209 of file mathutils_Matrix.c.

◆ Matrix_methods

struct PyMethodDef Matrix_methods[]
static

Definition at line 3209 of file mathutils_Matrix.c.

◆ Matrix_NumMethods

PyNumberMethods Matrix_NumMethods
static

Definition at line 2992 of file mathutils_Matrix.c.

◆ Matrix_SeqMethods

PySequenceMethods Matrix_SeqMethods
static
Initial value:
= {
(lenfunc)Matrix_len,
(binaryfunc)NULL,
(ssizeargfunc)NULL,
(ssizeargfunc)Matrix_item_row,
(ssizessizeargfunc)NULL,
(ssizeobjargproc)Matrix_ass_item_row,
(ssizessizeobjargproc)NULL,
(objobjproc)NULL,
(binaryfunc)NULL,
(ssizeargfunc)NULL,
}
static PyObject * Matrix_item_row(MatrixObject *self, int row)
static int Matrix_ass_item_row(MatrixObject *self, int row, PyObject *value)

Definition at line 2973 of file mathutils_Matrix.c.

◆ matrix_Type

PyTypeObject matrix_Type

◆ MatrixAccess_AsMapping

PyMappingMethods MatrixAccess_AsMapping
static
Initial value:
= {
(lenfunc)MatrixAccess_len,
}
static int MatrixAccess_len(MatrixAccessObject *self)
static int MatrixAccess_ass_subscript(MatrixAccessObject *self, PyObject *item, PyObject *value)
static PyObject * MatrixAccess_subscript(MatrixAccessObject *self, PyObject *item)

Definition at line 3761 of file mathutils_Matrix.c.