Blender V2.61 - r43446
Classes | Typedefs | Enumerations | Functions | Variables

mathutils_Matrix.c File Reference

#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
#include "BLI_dynstr.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

static PyObject * Matrix_copy (MatrixObject *self)
static int Matrix_ass_slice (MatrixObject *self, int begin, int end, PyObject *value)
static PyObject * matrix__apply_to_copy (PyNoArgsFunction matrix_func, MatrixObject *self)
static PyObject * MatrixAccess_CreatePyObject (MatrixObject *matrix, const eMatrixAccess_t type)
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 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)
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)
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)
static PyObject * Matrix_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
static void matrix_3x3_as_4x4 (float mat[16])
 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_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 corrasponding 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)
void matrix_as_3x3 (float mat[3][3], MatrixObject *self)
static float matrix_determinant_internal (MatrixObject *self)
 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)
 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)
 PyDoc_STRVAR (Matrix_resize_4x4_doc,".. method:: resize_4x4()\n""\n"" Resize the matrix to 4x4.\n")
static PyObject * Matrix_resize_4x4 (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)
 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_translation_doc,".. method:: to_translation()\n""\n"" Return a the translation part of a 4 row matrix.\n""\n"" :return: Return a 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 a the scale part of a 3x3 or 4x4 matrix.\n""\n"" :return: Return a the scale of a matrix.\n"" :rtype: :class:`Vector`\n""\n"" .. note:: This method does not return negative a 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)
 PyDoc_STRVAR (Matrix_invert_doc,".. method:: invert()\n""\n"" Set the matrix to its inverse.\n""\n"" .. note:: :exc:`ValueError` exception is raised.\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Inverse_matrix>\n")
static PyObject * Matrix_invert (MatrixObject *self)
 PyDoc_STRVAR (Matrix_inverted_doc,".. method:: inverted()\n""\n"" Return an inverted copy of the matrix.\n""\n"" :return: the inverted matrix.\n"" :rtype: :class:`Matrix`\n""\n"" .. note:: :exc:`ValueError` exception is raised.\n")
static PyObject * Matrix_inverted (MatrixObject *self)
 PyDoc_STRVAR (Matrix_rotate_doc,".. method:: rotate(other)\n""\n"" Rotates the matrix a 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)
 PyDoc_STRVAR (Matrix_decompose_doc,".. method:: decompose()\n""\n"" Return the location, rotaion and scale components of this matrix.\n""\n"" :return: loc, rot, scale triple.\n"" :rtype: (:class:`Vector`, :class:`Quaternion`, :class:`Vector`)")
static PyObject * Matrix_decompose (MatrixObject *self)
 PyDoc_STRVAR (Matrix_lerp_doc,".. function:: lerp(other, factor)\n""\n"" Returns the interpolation of two matrices.\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 rotation.\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 a the determinant of a matrix.\n"" :rtype: float\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Determinant>\n")
static PyObject * Matrix_determinant (MatrixObject *self)
 PyDoc_STRVAR (Matrix_transpose_doc,".. method:: transpose()\n""\n"" Set the matrix to its transpose.\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Transpose>\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)
 PyDoc_STRVAR (Matrix_zero_doc,".. method:: zero()\n""\n"" Set all the matrix values to zero.\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Matrix`\n")
static PyObject * Matrix_zero (MatrixObject *self)
 PyDoc_STRVAR (Matrix_identity_doc,".. method:: identity()\n""\n"" Set the matrix to the identity matrix.\n""\n"" .. note:: An object with zero location and rotation, a scale of one,\n"" will have an identity matrix.\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Identity_matrix>\n")
static PyObject * Matrix_identity (MatrixObject *self)
 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")
static PyObject * Matrix_repr (MatrixObject *self)
static PyObject * Matrix_str (MatrixObject *self)
static PyObject * Matrix_richcmpr (PyObject *a, PyObject *b, int op)
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_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_subscript (MatrixObject *self, PyObject *item)
static int Matrix_ass_subscript (MatrixObject *self, PyObject *item, PyObject *value)
 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 matix by rows (default), (readonly).\n\n:type: Matrix Access")
static PyObject * Matrix_row_get (MatrixObject *self, void *UNUSED(closure))
 PyDoc_STRVAR (Matrix_col_doc,"Access the matix by colums, 3x3 and 4x4 only, (readonly).\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 (readonly).\n\n:type: float")
static PyObject * Matrix_median_scale_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, (readonly).\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, (readonly).\n\n:type: bool")
static PyObject * Matrix_is_orthogonal_get (MatrixObject *self, void *UNUSED(closure))
 PyDoc_STRVAR (matrix_doc,"This object gives access to Matrices in Blender.")
PyObject * Matrix_CreatePyObject (float *mat, const unsigned short num_col, const unsigned short num_row, int type, PyTypeObject *base_type)
PyObject * Matrix_CreatePyObject_cb (PyObject *cb_user, const unsigned short num_col, const unsigned short num_row, int cb_type, int cb_subtype)
static int MatrixAccess_traverse (MatrixAccessObject *self, visitproc visit, void *arg)
static int MatrixAccess_clear (MatrixAccessObject *self)
static void MatrixAccess_dealloc (MatrixAccessObject *self)
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)

Variables

int mathutils_matrix_row_cb_index = -1
Mathutils_Callback mathutils_matrix_row_cb
int mathutils_matrix_col_cb_index = -1
Mathutils_Callback mathutils_matrix_col_cb
int mathutils_matrix_translation_cb_index = -1
Mathutils_Callback mathutils_matrix_translation_cb
static PySequenceMethods Matrix_SeqMethods
static PyMappingMethods Matrix_AsMapping
static PyNumberMethods Matrix_NumMethods
static PyGetSetDef Matrix_getseters []
static struct PyMethodDef Matrix_methods []
PyTypeObject matrix_Type
static PyMappingMethods MatrixAccess_AsMapping
PyTypeObject matrix_access_Type

Detailed Description

Definition in file mathutils_Matrix.c.


Typedef Documentation


Enumeration Type Documentation

Enumerator:
MAT_ACCESS_ROW 
MAT_ACCESS_COL 

Definition at line 41 of file mathutils_Matrix.c.


Function Documentation

static PyObject* C_Matrix_OrthoProjection ( PyObject *  cls,
PyObject *  args 
) [static]
static PyObject* C_Matrix_Rotation ( PyObject *  cls,
PyObject *  args 
) [static]
static PyObject* C_Matrix_Scale ( PyObject *  cls,
PyObject *  args 
) [static]
static PyObject* C_Matrix_Shear ( PyObject *  cls,
PyObject *  args 
) [static]
static PyObject* C_Matrix_Translation ( PyObject *  cls,
PyObject *  value 
) [static]
static int mathutils_matrix_col_check ( BaseMathObject bmo) [static]

Definition at line 167 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

static int mathutils_matrix_col_get ( BaseMathObject bmo,
int  col 
) [static]
static int mathutils_matrix_col_get_index ( BaseMathObject bmo,
int  col,
int  row 
) [static]
static int mathutils_matrix_col_set ( BaseMathObject bmo,
int  col 
) [static]
static int mathutils_matrix_col_set_index ( BaseMathObject bmo,
int  col,
int  row 
) [static]
static int mathutils_matrix_row_check ( BaseMathObject bmo) [static]

Definition at line 83 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

static int mathutils_matrix_row_get ( BaseMathObject bmo,
int  row 
) [static]

Definition at line 89 of file mathutils_Matrix.c.

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

static int mathutils_matrix_row_get_index ( BaseMathObject bmo,
int  row,
int  col 
) [static]
static int mathutils_matrix_row_set ( BaseMathObject bmo,
int  row 
) [static]
static int mathutils_matrix_row_set_index ( BaseMathObject bmo,
int  row,
int  col 
) [static]
static int mathutils_matrix_translation_check ( BaseMathObject bmo) [static]

Definition at line 260 of file mathutils_Matrix.c.

References BaseMath_ReadCallback.

static int mathutils_matrix_translation_get ( BaseMathObject bmo,
int  col 
) [static]

Definition at line 266 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, if(), and MATRIX_ITEM.

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

Definition at line 297 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, if(), and MATRIX_ITEM.

static int mathutils_matrix_translation_set ( BaseMathObject bmo,
int  col 
) [static]

Definition at line 281 of file mathutils_Matrix.c.

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

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

Definition at line 308 of file mathutils_Matrix.c.

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

static void matrix_3x3_as_4x4 ( float  mat[16]) [static]
static PyObject * matrix__apply_to_copy ( PyNoArgsFunction  matrix_func,
MatrixObject self 
) [static]

Definition at line 384 of file mathutils_Matrix.c.

References Matrix_copy(), and NULL.

Referenced by Matrix_inverted(), and Matrix_transposed().

static PyObject* Matrix_add ( PyObject *  m1,
PyObject *  m2 
) [static]
void matrix_as_3x3 ( float  mat[3][3],
MatrixObject self 
)
static int Matrix_ass_item_col ( MatrixObject self,
int  col,
PyObject *  value 
) [static]
static int Matrix_ass_item_row ( MatrixObject self,
int  row,
PyObject *  value 
) [static]
static int Matrix_ass_slice ( MatrixObject self,
int  begin,
int  end,
PyObject *  value 
) [static]
static int Matrix_ass_subscript ( MatrixObject self,
PyObject *  item,
PyObject *  value 
) [static]

Definition at line 1995 of file mathutils_Matrix.c.

References i, Matrix_ass_item_row(), Matrix_ass_slice(), and step().

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

Definition at line 2131 of file mathutils_Matrix.c.

References MAT_ACCESS_COL, and MatrixAccess_CreatePyObject().

static int matrix_col_vector_check ( MatrixObject mat,
VectorObject vec,
int  col 
) [static]
static PyObject * Matrix_copy ( MatrixObject self) [static]

Definition at line 1488 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, Matrix_CreatePyObject(), NULL, and Py_NEW.

Referenced by matrix__apply_to_copy().

PyObject* Matrix_CreatePyObject ( float *  mat,
const unsigned short  num_col,
const unsigned short  num_row,
int  type,
PyTypeObject *  base_type 
)
PyObject* Matrix_CreatePyObject_cb ( PyObject *  cb_user,
const unsigned short  num_col,
const unsigned short  num_row,
int  cb_type,
int  cb_subtype 
)

Definition at line 2374 of file mathutils_Matrix.c.

References Matrix_CreatePyObject(), and Py_NEW.

Referenced by pyrna_math_object_from_array().

static PyObject* Matrix_decompose ( MatrixObject self) [static]
static PyObject* Matrix_determinant ( MatrixObject self) [static]

Definition at line 1356 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, matrix_determinant_internal(), and NULL.

static float matrix_determinant_internal ( MatrixObject self) [static]
static PyObject* Matrix_identity ( MatrixObject self) [static]
static PyObject* Matrix_invert ( MatrixObject self) [static]
static PyObject* Matrix_inverted ( MatrixObject self) [static]

Definition at line 1217 of file mathutils_Matrix.c.

References matrix__apply_to_copy(), and Matrix_invert().

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

Definition at line 2162 of file mathutils_Matrix.c.

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

static PyObject* Matrix_is_orthogonal_get ( MatrixObject self,
void *  UNUSEDclosure 
) [static]
static PyObject* Matrix_item_col ( MatrixObject self,
int  col 
) [static]
static PyObject* Matrix_item_row ( MatrixObject self,
int  row 
) [static]
static int Matrix_len ( MatrixObject self) [static]

Definition at line 1608 of file mathutils_Matrix.c.

static PyObject* Matrix_lerp ( MatrixObject self,
PyObject *  args 
) [static]
static PyObject* Matrix_median_scale_get ( MatrixObject self,
void *  UNUSEDclosure 
) [static]

Definition at line 2139 of file mathutils_Matrix.c.

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

static PyObject* Matrix_mul ( PyObject *  m1,
PyObject *  m2 
) [static]
static PyObject* matrix_mul_float ( MatrixObject mat,
const float  scalar 
) [static]
static PyObject* Matrix_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]

Definition at line 335 of file mathutils_Matrix.c.

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

static PyObject* Matrix_repr ( MatrixObject self) [static]

Definition at line 1498 of file mathutils_Matrix.c.

References BaseMath_ReadCallback, MATRIX_ITEM, MATRIX_MAX_DIM, and NULL.

static PyObject* Matrix_resize_4x4 ( MatrixObject self) [static]

Definition at line 984 of file mathutils_Matrix.c.

References copy_m4_m4(), MAT4_UNITY, MATRIX_COL_PTR, NULL, and Py_WRAP.

static PyObject* Matrix_richcmpr ( PyObject *  a,
PyObject *  b,
int  op 
) [static]
static PyObject* Matrix_rotate ( MatrixObject self,
PyObject *  value 
) [static]
static PyObject* Matrix_row_get ( MatrixObject self,
void *  UNUSEDclosure 
) [static]

Definition at line 2123 of file mathutils_Matrix.c.

References MAT_ACCESS_ROW, and MatrixAccess_CreatePyObject().

static int matrix_row_vector_check ( MatrixObject mat,
VectorObject vec,
int  row 
) [static]
static PyObject* Matrix_slice ( MatrixObject self,
int  begin,
int  end 
) [static]
static PyObject* Matrix_str ( MatrixObject self) [static]
static PyObject* Matrix_sub ( PyObject *  m1,
PyObject *  m2 
) [static]
static PyObject* Matrix_subscript ( MatrixObject self,
PyObject *  item 
) [static]

Definition at line 1958 of file mathutils_Matrix.c.

References i, Matrix_item_row(), Matrix_slice(), NULL, and step().

static PyObject* Matrix_to_3x3 ( MatrixObject self) [static]
static PyObject* Matrix_to_4x4 ( MatrixObject self) [static]
static PyObject* Matrix_to_euler ( MatrixObject self,
PyObject *  args 
) [static]
static PyObject* Matrix_to_quaternion ( MatrixObject self) [static]
static PyObject* Matrix_to_scale ( MatrixObject self) [static]
static PyObject* Matrix_to_translation ( MatrixObject self) [static]
static PyObject* Matrix_translation_get ( MatrixObject self,
void *  UNUSEDclosure 
) [static]
static int Matrix_translation_set ( MatrixObject self,
PyObject *  value,
void *  UNUSEDclosure 
) [static]
static PyObject* Matrix_transpose ( MatrixObject self) [static]
static PyObject* Matrix_transposed ( MatrixObject self) [static]

Definition at line 1414 of file mathutils_Matrix.c.

References matrix__apply_to_copy(), and Matrix_transpose().

static PyObject* Matrix_zero ( MatrixObject self) [static]

Definition at line 1428 of file mathutils_Matrix.c.

References BaseMath_WriteCallback, fill_vn_fl(), and NULL.

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

Definition at line 2405 of file mathutils_Matrix.c.

Referenced by MatrixAccess_dealloc().

static PyObject * MatrixAccess_CreatePyObject ( MatrixObject matrix,
const eMatrixAccess_t  type 
) [static]
static void MatrixAccess_dealloc ( MatrixAccessObject self) [static]

Definition at line 2411 of file mathutils_Matrix.c.

References MatrixAccess_clear().

static PyObject* MatrixAccess_iter ( MatrixAccessObject self) [static]

Definition at line 2538 of file mathutils_Matrix.c.

References MATRIX_MAX_DIM, MatrixAccess_slice(), and NULL.

static int MatrixAccess_len ( MatrixAccessObject self) [static]

Definition at line 2423 of file mathutils_Matrix.c.

References MAT_ACCESS_ROW.

Referenced by MatrixAccess_subscript().

static PyObject* MatrixAccess_slice ( MatrixAccessObject self,
int  begin,
int  end 
) [static]
static PyObject* MatrixAccess_subscript ( MatrixAccessObject self,
PyObject *  item 
) [static]
static int MatrixAccess_traverse ( MatrixAccessObject self,
visitproc  visit,
void *  arg 
) [static]

Definition at line 2399 of file mathutils_Matrix.c.

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 ( Matrix_inverted_doc  ,
".. method:: inverted()\n""\n"" Return an inverted copy of the matrix.\n""\n"" :return: the inverted matrix.\n"" :rtype: :class:`Matrix`\n""\n"" .. note:: :exc:`ValueError` exception is raised.\n"   
)
PyDoc_STRVAR ( Matrix_row_doc  ,
"Access the matix by rows   default,
(readonly).\n\n:type:Matrix Access"   
)
PyDoc_STRVAR ( Matrix_is_negative_doc  ,
"True if this matrix results in a negative  scale,
3x3 and 4x4  only,
(readonly).\n\n:type:bool"   
)
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 inor 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'] 
)
PyDoc_STRVAR ( Matrix_to_translation_doc  ,
".. method:: to_translation()\n""\n"" Return a the translation part of a 4 row matrix.\n""\n"" :return: Return a the translation of a matrix.\n"" :rtype: :class:`Vector`\n"   
)
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 ( Matrix_lerp_doc  ,
".. function:: lerp(other, factor)\n""\n"" Returns the interpolation of two matrices.\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 rotation.\n"" :rtype: :class:`Matrix`\n"  [0.0, 1.0] 
)
PyDoc_STRVAR ( Matrix_is_orthogonal_doc  ,
"True if this matrix is  orthogonal,
3x3 and 4x4  only,
(readonly).\n\n:type:bool"   
)
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 ( 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] 
)
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 ( Matrix_decompose_doc  ,
".. method:: decompose()\n""\n"" Return the  location,
rotaion and scale components of this matrix.\n""\n"":return:loc  ,
rot  ,
scale triple.\n"":rtype:(:class:`Vector`,:class:`Quaternion`,:class:`Vector`)"   
)
PyDoc_STRVAR ( Matrix_invert_doc  ,
".. method:: invert()\n""\n"" Set the matrix to its inverse.\n""\n"" .. note:: :exc:`ValueError` exception is raised.\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Inverse_matrix>\n"   
)
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] 
)
PyDoc_STRVAR ( Matrix_col_doc  ,
"Access the matix by  colums,
3x3 and 4x4  only,
(readonly).\n\n:type:Matrix Access"   
)
PyDoc_STRVAR ( Matrix_translation_doc  ,
"The translation component of the matrix.\n\n:type: Vector"   
)
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 ( Matrix_rotate_doc  ,
".. method:: rotate(other)\n""\n"" Rotates the matrix a 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 ( Matrix_transpose_doc  ,
".. method:: transpose()\n""\n"" Set the matrix to its transpose.\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Transpose>\n"   
)
PyDoc_STRVAR ( Matrix_zero_doc  ,
".. method:: zero()\n""\n"" Set all the matrix values to zero.\n""\n"" :return: an instance of itself\n"" :rtype: :class:`Matrix`\n"   
)
PyDoc_STRVAR ( matrix_doc  ,
"This object gives access to Matrices in Blender."   
)
PyDoc_STRVAR ( Matrix_resize_4x4_doc  ,
".. method:: resize_4x4()\n""\n"" Resize the matrix to 4x4.\n"   
)
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 ( Matrix_determinant_doc  ,
".. method:: determinant()\n""\n"" Return the determinant of a matrix.\n""\n"" :return: Return a the determinant of a matrix.\n"" :rtype: float\n""\n"" .. seealso:: <http://en.wikipedia.org/wiki/Determinant>\n"   
)
PyDoc_STRVAR ( Matrix_median_scale_doc  ,
"The average scale applied to each axis (readonly).\n\n:type: float"   
)
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 corrasponding with the *plane *axis.\n"":type factor:float or float pair\n"":return:A new shear matrix.\n"":rtype::class:`Matrix`\n"  [2, 4] 
)
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"   
)
PyDoc_STRVAR ( Matrix_identity_doc  ,
".. method:: identity()\n""\n"" Set the matrix to the identity matrix.\n""\n"" .. note:: An object with zero location and  rotation,
a scale of  one,
\n""will have an identity matrix.\n""\n""..seealso::< http://en.wikipedia.org/wiki/Identity_matrix >\n"   
)
PyDoc_STRVAR ( Matrix_to_scale_doc  ,
".. method:: to_scale()\n""\n"" Return a the scale part of a 3x3 or 4x4 matrix.\n""\n"" :return: Return a the scale of a matrix.\n"" :rtype: :class:`Vector`\n""\n"" .. note:: This method does not return negative a scale on any axis because it is not possible to obtain this data from the matrix alone.\n"   
)

Variable Documentation

Definition at line 165 of file mathutils_Matrix.c.

Referenced by Matrix_item_col(), and PyInit_mathutils().

Definition at line 81 of file mathutils_Matrix.c.

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

Definition at line 258 of file mathutils_Matrix.c.

Referenced by Matrix_translation_get(), and PyInit_mathutils().

PyTypeObject matrix_access_Type
Initial value:
 {
    PyVarObject_HEAD_INIT(NULL, 0)
    "MatrixAccess",                     
    sizeof(MatrixAccessObject),         
    0,                                  
    (destructor)MatrixAccess_dealloc,   
    NULL,                               
    NULL,                               
    NULL,                               
    NULL,                               
    NULL,                               
    NULL,                               
    NULL  ,         
    &MatrixAccess_AsMapping,            
    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, 
}

Definition at line 2561 of file mathutils_Matrix.c.

Referenced by PyInit_mathutils().

PyMappingMethods Matrix_AsMapping [static]
Initial value:
 {
    (lenfunc)Matrix_len,
    (binaryfunc)Matrix_subscript,
    (objobjargproc)Matrix_ass_subscript
}

Definition at line 2027 of file mathutils_Matrix.c.

PyGetSetDef Matrix_getseters[] [static]
Initial value:
 {
    {(char *)"median_scale", (getter)Matrix_median_scale_get, (setter)NULL, Matrix_median_scale_doc, NULL},
    {(char *)"translation", (getter)Matrix_translation_get, (setter)Matrix_translation_set, Matrix_translation_doc, NULL},
    {(char *)"row", (getter)Matrix_row_get, (setter)NULL, Matrix_row_doc, NULL},
    {(char *)"col", (getter)Matrix_col_get, (setter)NULL, Matrix_col_doc, NULL},
    {(char *)"is_negative", (getter)Matrix_is_negative_get, (setter)NULL, Matrix_is_negative_doc, NULL},
    {(char *)"is_orthogonal", (getter)Matrix_is_orthogonal_get, (setter)NULL, Matrix_is_orthogonal_doc, NULL},
    {(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
    {(char *)"owner",(getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
    {NULL, NULL, NULL, NULL, NULL}  
}

Definition at line 2204 of file mathutils_Matrix.c.

struct PyMethodDef Matrix_methods[] [static]

Definition at line 2217 of file mathutils_Matrix.c.

PyNumberMethods Matrix_NumMethods [static]

Definition at line 2034 of file mathutils_Matrix.c.

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,                        
}

Definition at line 1944 of file mathutils_Matrix.c.

PyTypeObject matrix_Type

Definition at line 2261 of file mathutils_Matrix.c.

Referenced by Matrix_lerp(), and PyInit_mathutils().

PyMappingMethods MatrixAccess_AsMapping [static]
Initial value:
 {
    (lenfunc)MatrixAccess_len,
    (binaryfunc)MatrixAccess_subscript,
    (objobjargproc) MatrixAccess_ass_subscript
}

Definition at line 2555 of file mathutils_Matrix.c.