Blender
V3.3
|
#include <Python.h>
#include "mathutils.h"
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_dynstr.h"
Go to the source code of this file.
Macros | |
#define | EULER_SIZE 3 |
#define | MAKE_ID3(a, b, c) (((a) << 24) | ((b) << 16) | ((c) << 8)) |
Functions | |
Utilities | |
static const char * | euler_order_str (EulerObject *self) |
short | euler_order_from_string (const char *str, const char *error_prefix) |
static PyObject * | Euler_to_tuple_ex (EulerObject *self, int ndigits) |
Euler Type: <tt>__new__</tt> / <tt>mathutils.Euler()</tt> | |
static PyObject * | Euler_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
Euler Methods | |
PyDoc_STRVAR (Euler_to_quaternion_doc, ".. method:: to_quaternion()\n" "\n" " Return a quaternion representation of the euler.\n" "\n" " :return: Quaternion representation of the euler.\n" " :rtype: :class:`Quaternion`\n") | |
static PyObject * | Euler_to_quaternion (EulerObject *self) |
PyDoc_STRVAR (Euler_to_matrix_doc, ".. method:: to_matrix()\n" "\n" " Return a matrix representation of the euler.\n" "\n" " :return: A 3x3 rotation matrix representation of the euler.\n" " :rtype: :class:`Matrix`\n") | |
static PyObject * | Euler_to_matrix (EulerObject *self) |
PyDoc_STRVAR (Euler_zero_doc, ".. method:: zero()\n" "\n" " Set all values to zero.\n") | |
static PyObject * | Euler_zero (EulerObject *self) |
PyDoc_STRVAR (Euler_rotate_axis_doc, ".. method:: rotate_axis(axis, angle)\n" "\n" " Rotates the euler a certain amount and returning a unique euler rotation\n" " (no 720 degree pitches).\n" "\n" " :arg axis: single character in ['X, 'Y', 'Z'].\n" " :type axis: string\n" " :arg angle: angle in radians.\n" " :type angle: float\n") | |
static PyObject * | Euler_rotate_axis (EulerObject *self, PyObject *args) |
PyDoc_STRVAR (Euler_rotate_doc, ".. method:: rotate(other)\n" "\n" " Rotates the euler by another mathutils value.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n") | |
static PyObject * | Euler_rotate (EulerObject *self, PyObject *value) |
PyDoc_STRVAR (Euler_make_compatible_doc, ".. method:: make_compatible(other)\n" "\n" " Make this euler compatible with another,\n" " so interpolating between them works as intended.\n" "\n" " .. note:: the rotation order is not taken into account for this function.\n") | |
static PyObject * | Euler_make_compatible (EulerObject *self, PyObject *value) |
PyDoc_STRVAR (Euler_copy_doc, ".. function:: copy()\n" "\n" " Returns a copy of this euler.\n" "\n" " :return: A copy of the euler.\n" " :rtype: :class:`Euler`\n" "\n" " .. note:: use this to get a copy of a wrapped euler with\n" " no reference to the original data.\n") | |
static PyObject * | Euler_copy (EulerObject *self) |
static PyObject * | Euler_deepcopy (EulerObject *self, PyObject *args) |
Euler Type: <tt>__repr__</tt> & <tt>__str__</tt> | |
static PyObject * | Euler_repr (EulerObject *self) |
static PyObject * | Euler_str (EulerObject *self) |
Euler Type: Rich Compare | |
static PyObject * | Euler_richcmpr (PyObject *a, PyObject *b, int op) |
Euler Type: Hash (<tt>__hash__</tt>) | |
static Py_hash_t | Euler_hash (EulerObject *self) |
Euler Type: Sequence Protocol | |
static int | Euler_len (EulerObject *UNUSED(self)) |
static PyObject * | Euler_item (EulerObject *self, int i) |
static int | Euler_ass_item (EulerObject *self, int i, PyObject *value) |
static PyObject * | Euler_slice (EulerObject *self, int begin, int end) |
static int | Euler_ass_slice (EulerObject *self, int begin, int end, PyObject *seq) |
static PyObject * | Euler_subscript (EulerObject *self, PyObject *item) |
static int | Euler_ass_subscript (EulerObject *self, PyObject *item, PyObject *value) |
Euler Type: Get/Set Item Implementation | |
PyDoc_STRVAR (Euler_axis_doc, "Euler axis angle in radians.\n\n:type: float") | |
static PyObject * | Euler_axis_get (EulerObject *self, void *type) |
static int | Euler_axis_set (EulerObject *self, PyObject *value, void *type) |
PyDoc_STRVAR (Euler_order_doc, "Euler rotation order.\n\n:type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']") | |
static PyObject * | Euler_order_get (EulerObject *self, void *UNUSED(closure)) |
static int | Euler_order_set (EulerObject *self, PyObject *value, void *UNUSED(closure)) |
Euler Type: C/API Constructors | |
PyObject * | Euler_CreatePyObject (const float eul[3], const short order, PyTypeObject *base_type) |
PyObject * | Euler_CreatePyObject_wrap (float eul[3], const short order, PyTypeObject *base_type) |
PyObject * | Euler_CreatePyObject_cb (PyObject *cb_user, const short order, uchar cb_type, uchar cb_subtype) |
Variables | |
Euler Type: Sequence & Mapping Protocol Declarations | |
static PySequenceMethods | Euler_SeqMethods |
static PyMappingMethods | Euler_AsMapping |
Euler Type: Get/Set Item Definitions | |
static PyGetSetDef | Euler_getseters [] |
Euler Type: Method Definitions | |
static struct PyMethodDef | Euler_methods [] |
Euler Type: Python Object Definition | |
PyTypeObject | euler_Type |
PyDoc_STRVAR (euler_doc, ".. class:: Euler(angles, order='XYZ')\n" "\n" " This object gives access to Eulers in Blender.\n" "\n" " .. seealso:: `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__ on Wikipedia.\n" "\n" " :param angles: Three angles, in radians.\n" " :type angles: 3d vector\n" " :param order: Optional order of the angles, a permutation of ``XYZ``.\n" " :type order: str\n") | |
#define EULER_SIZE 3 |
Definition at line 20 of file mathutils_Euler.c.
#define MAKE_ID3 | ( | a, | |
b, | |||
c | |||
) | (((a) << 24) | ((b) << 16) | ((c) << 8)) |
|
static |
Sequence accessor (set): object[i] = x
.
Definition at line 464 of file mathutils_Euler.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, and EULER_SIZE.
Referenced by Euler_ass_subscript(), and Euler_axis_set().
|
static |
Sequence slice accessor (set): object[i:j] = x
.
Definition at line 526 of file mathutils_Euler.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, EULER_SIZE, mathutils_array_parse(), MIN2, size(), and void.
Referenced by Euler_ass_subscript().
|
static |
Sequence generic subscript (set): object[...] = x
.
Definition at line 600 of file mathutils_Euler.c.
References Euler_ass_item(), Euler_ass_slice(), and EULER_SIZE.
|
static |
Definition at line 666 of file mathutils_Euler.c.
References Euler_item(), POINTER_AS_INT, and type.
|
static |
Definition at line 671 of file mathutils_Euler.c.
References Euler_ass_item(), POINTER_AS_INT, and type.
|
static |
Definition at line 304 of file mathutils_Euler.c.
References BaseMath_ReadCallback, Euler_CreatePyObject(), NULL, and self.
Referenced by Euler_deepcopy().
PyObject* Euler_CreatePyObject | ( | const float | eul[3], |
const short | order, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 839 of file mathutils_Euler.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, copy_v3_v3(), EULER_SIZE, euler_Type, NULL, order, self, UNLIKELY, and zero_v3().
Referenced by Euler_copy(), Euler_CreatePyObject_cb(), Euler_new(), Matrix_to_euler(), pyrna_math_object_from_array(), and Quaternion_to_euler().
PyObject* Euler_CreatePyObject_cb | ( | PyObject * | cb_user, |
const short | order, | ||
uchar | cb_type, | ||
uchar | cb_subtype | ||
) |
Definition at line 896 of file mathutils_Euler.c.
References Euler_CreatePyObject(), NULL, and order.
Referenced by pyrna_math_object_from_array().
PyObject* Euler_CreatePyObject_wrap | ( | float | eul[3], |
const short | order, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 877 of file mathutils_Euler.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, euler_Type, NULL, and order.
|
static |
Definition at line 312 of file mathutils_Euler.c.
References Euler_copy(), NULL, and PyC_CheckArgs_DeepCopy().
|
static |
Definition at line 417 of file mathutils_Euler.c.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, EULER_SIZE, mathutils_array_hash(), and self.
|
static |
Sequence accessor (get): x = object[i]
.
Definition at line 443 of file mathutils_Euler.c.
References BaseMath_ReadIndexCallback, EULER_SIZE, NULL, and self.
Referenced by Euler_axis_get(), and Euler_subscript().
|
static |
Sequence length: len(object)
.
Definition at line 437 of file mathutils_Euler.c.
References EULER_SIZE.
|
static |
Definition at line 271 of file mathutils_Euler.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, compatible_eul(), EULER_SIZE, mathutils_array_parse(), NULL, self, and void.
|
static |
Definition at line 95 of file mathutils_Euler.c.
References ATTR_FALLTHROUGH, Euler_CreatePyObject(), euler_order_from_string(), EULER_ORDER_XYZ, EULER_SIZE, mathutils_array_parse(), NULL, order, and type.
short euler_order_from_string | ( | const char * | str, |
const char * | error_prefix | ||
) |
Definition at line 33 of file mathutils_Euler.c.
References EULER_ORDER_XYZ, EULER_ORDER_XZY, EULER_ORDER_YXZ, EULER_ORDER_YZX, EULER_ORDER_ZXY, EULER_ORDER_ZYX, MAKE_ID3, and str.
Referenced by Euler_new(), Euler_order_set(), Matrix_to_euler(), and Quaternion_to_euler().
|
static |
Definition at line 681 of file mathutils_Euler.c.
References BaseMath_ReadCallback, euler_order_str(), and NULL.
|
static |
Definition at line 691 of file mathutils_Euler.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, euler_order_from_string(), NULL, order, and void.
|
static |
Internal use, assume read callback is done.
Definition at line 27 of file mathutils_Euler.c.
References EULER_ORDER_XYZ, and order.
Referenced by Euler_order_get(), Euler_repr(), and Euler_str().
|
static |
Definition at line 326 of file mathutils_Euler.c.
References BaseMath_ReadCallback, euler_order_str(), Euler_to_tuple_ex(), NULL, and ret.
|
static |
Definition at line 370 of file mathutils_Euler.c.
References Freestyle::a, ATTR_FALLTHROUGH, usdtokens::b(), BaseMath_ReadCallback, EULER_SIZE, EulerObject_Check, EXPP_VectorsAreEqual(), NULL, and EulerObject::order.
|
static |
Definition at line 243 of file mathutils_Euler.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, eulO_to_mat3(), mat3_to_compatible_eulO(), mathutils_any_to_rotmat(), mul_m3_m3m3(), NULL, self, and void.
|
static |
Definition at line 206 of file mathutils_Euler.c.
References angle(), BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, ELEM, NULL, rotate_eulO(), self, and void.
|
static |
Sequence slice accessor (get): x = object[i:j]
.
Definition at line 501 of file mathutils_Euler.c.
References BaseMath_ReadCallback, CLAMP, count, EULER_SIZE, MIN2, NULL, and self.
Referenced by Euler_subscript().
|
static |
Definition at line 343 of file mathutils_Euler.c.
References BaseMath_ReadCallback, BLI_dynstr_appendf(), BLI_dynstr_new(), euler_order_str(), mathutils_dynstr_to_py(), NULL, and self.
|
static |
Sequence generic subscript (get): x = object[...]
.
Definition at line 563 of file mathutils_Euler.c.
References Euler_item(), EULER_SIZE, Euler_slice(), and NULL.
|
static |
Definition at line 164 of file mathutils_Euler.c.
References BaseMath_ReadCallback, eulO_to_mat3(), Matrix_CreatePyObject(), NULL, and self.
|
static |
Definition at line 144 of file mathutils_Euler.c.
References BaseMath_ReadCallback, eulO_to_quat(), NULL, Quaternion_CreatePyObject(), and self.
|
static |
Definition at line 68 of file mathutils_Euler.c.
References double_round(), EULER_SIZE, ret, and self.
Referenced by Euler_repr().
|
static |
Definition at line 181 of file mathutils_Euler.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, NULL, self, and zero_v3().
PyDoc_STRVAR | ( | Euler_copy_doc | , |
".. function:: copy()\n" "\n" " Returns a copy of this euler.\n" "\n" " :return: A copy of the euler.\n" " :rtype: :class:`Euler`\n" "\n" " .. note:: use this to get a copy of a wrapped euler with\n" " no reference to the original data.\n" | |||
) |
PyDoc_STRVAR | ( | euler_doc | , |
".. class:: Euler(angles, order='XYZ')\n" "\n" " This object gives access to Eulers in Blender.\n" "\n" " .. seealso:: `Euler angles <https://en.wikipedia.org/wiki/Euler_angles>`__ on Wikipedia.\n" "\n" " :param angles: Three | angles, | ||
in radians.\n" " :type angles:3d vector\n" " :param order:Optional order of the | angles, | ||
a permutation of ``XYZ``.\n" " :type order:str\n" | |||
) |
PyDoc_STRVAR | ( | Euler_make_compatible_doc | , |
".. method:: make_compatible(other)\n" "\n" " Make this euler compatible with | another, | ||
\n" " so interpolating between them works as intended.\n" "\n" " .. note::the rotation order is not taken into account for this function.\n" | |||
) |
PyDoc_STRVAR | ( | Euler_order_doc | , |
"Euler rotation order.\n\n:type: string in " | [ 'XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'] | ||
) |
PyDoc_STRVAR | ( | Euler_rotate_axis_doc | , |
".. method:: rotate_axis(axis, angle)\n" "\n" " Rotates the euler a certain amount and returning a unique euler rotation\n" " (no 720 degree pitches).\n" "\n" " :arg axis: single character in .\n" " :type axis: string\n" " :arg angle: angle in radians.\n" " :type angle: float\n" | [ 'X, 'Y', 'Z'] | ||
) |
PyDoc_STRVAR | ( | Euler_rotate_doc | , |
".. method:: rotate(other)\n" "\n" " Rotates the euler by another mathutils value.\n" "\n" " :arg other: rotation component of mathutils value\n" " :type other: :class:`Euler` | , | ||
:class:`Quaternion` or :class:`Matrix`\n" | |||
) |
PyDoc_STRVAR | ( | Euler_to_matrix_doc | , |
".. method:: to_matrix()\n" "\n" " Return a matrix representation of the euler.\n" "\n" " :return: A 3x3 rotation matrix representation of the euler.\n" " :rtype: :class:`Matrix`\n" | |||
) |
PyDoc_STRVAR | ( | Euler_to_quaternion_doc | , |
".. method:: to_quaternion()\n" "\n" " Return a quaternion representation of the euler.\n" "\n" " :return: Quaternion representation of the euler.\n" " :rtype: :class:`Quaternion`\n" | |||
) |
PyDoc_STRVAR | ( | Euler_zero_doc | , |
".. method:: zero()\n" "\n" " Set all values to zero.\n" | |||
) |
|
static |
Definition at line 651 of file mathutils_Euler.c.
|
static |
Definition at line 716 of file mathutils_Euler.c.
|
static |
Definition at line 716 of file mathutils_Euler.c.
|
static |
Definition at line 638 of file mathutils_Euler.c.
PyTypeObject euler_Type |
Definition at line 781 of file mathutils_Euler.c.
Referenced by Euler_CreatePyObject(), Euler_CreatePyObject_wrap(), Matrix_to_euler(), PyInit_mathutils(), and Quaternion_to_euler().