|
Blender V4.3
|
#include <algorithm>#include <Python.h>#include "mathutils.hh"#include "../generic/py_capi_utils.hh"#include "../generic/python_utildefines.hh"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.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: str\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` | :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 Py_ssize_t | Euler_len (EulerObject *) |
| static PyObject * | Euler_item (EulerObject *self, Py_ssize_t i) |
| static int | Euler_ass_item (EulerObject *self, Py_ssize_t 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: str in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']") | |
| static PyObject * | Euler_order_get (EulerObject *self, void *) |
| static int | Euler_order_set (EulerObject *self, PyObject *value, void *) |
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 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" " :arg angles: (X, Y, Z) angles in radians.\n" " :type angles: Sequence[float]\n" " :arg order: Optional order of the angles, a permutation of ``XYZ``.\n" " :type order: str\n") | |
| #define EULER_SIZE 3 |
Definition at line 26 of file mathutils_Euler.cc.
Referenced by Euler_ass_item(), Euler_ass_slice(), Euler_ass_subscript(), Euler_CreatePyObject(), Euler_hash(), Euler_item(), Euler_len(), Euler_make_compatible(), Euler_new(), Euler_richcmpr(), Euler_slice(), Euler_subscript(), and Euler_to_tuple_ex().
Referenced by euler_order_from_string().
|
static |
Sequence accessor (set): object[i] = x.
Definition at line 485 of file mathutils_Euler.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, EULER_SIZE, and self.
Referenced by Euler_ass_subscript(), and Euler_axis_set().
|
static |
Sequence slice accessor (set): object[i:j] = x.
Definition at line 547 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, EULER_SIZE, mathutils_array_parse(), self, and size().
Referenced by Euler_ass_subscript().
|
static |
Sequence generic subscript (set): object[...] = x.
Definition at line 622 of file mathutils_Euler.cc.
References Euler_ass_item(), Euler_ass_slice(), EULER_SIZE, and self.
|
static |
Definition at line 693 of file mathutils_Euler.cc.
References Euler_item(), POINTER_AS_INT, and self.
|
static |
Definition at line 698 of file mathutils_Euler.cc.
References Euler_ass_item(), POINTER_AS_INT, and self.
|
static |
Definition at line 325 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, Euler_CreatePyObject(), and self.
Referenced by Euler_deepcopy().
| PyObject * Euler_CreatePyObject | ( | const float | eul[3], |
| const short | order, | ||
| PyTypeObject * | base_type ) |
Definition at line 892 of file mathutils_Euler.cc.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, copy_v3_v3(), EULER_SIZE, euler_Type, 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 949 of file mathutils_Euler.cc.
References BLI_assert, Euler_CreatePyObject(), and self.
Referenced by pyrna_math_object_from_array().
| PyObject * Euler_CreatePyObject_wrap | ( | float | eul[3], |
| const short | order, | ||
| PyTypeObject * | base_type ) |
Definition at line 930 of file mathutils_Euler.cc.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, euler_Type, and self.
|
static |
Definition at line 333 of file mathutils_Euler.cc.
References Euler_copy(), PyC_CheckArgs_DeepCopy(), and self.
|
static |
Definition at line 438 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, EULER_SIZE, mathutils_array_hash(), and self.
|
static |
Sequence accessor (get): x = object[i].
Definition at line 464 of file mathutils_Euler.cc.
References BaseMath_ReadIndexCallback, EULER_SIZE, and self.
Referenced by Euler_axis_get(), and Euler_subscript().
|
static |
Sequence length: len(object).
Definition at line 458 of file mathutils_Euler.cc.
References EULER_SIZE.
|
static |
Definition at line 289 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, compatible_eul(), EULER_SIZE, mathutils_array_parse(), and self.
|
static |
Definition at line 101 of file mathutils_Euler.cc.
References ATTR_FALLTHROUGH, Euler_CreatePyObject(), euler_order_from_string(), EULER_ORDER_XYZ, EULER_SIZE, and mathutils_array_parse().
| short euler_order_from_string | ( | const char * | str, |
| const char * | error_prefix ) |
Definition at line 39 of file mathutils_Euler.cc.
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 711 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, euler_order_str(), and self.
|
static |
Definition at line 721 of file mathutils_Euler.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, euler_order_from_string(), and self.
|
static |
Internal use, assume read callback is done.
Definition at line 33 of file mathutils_Euler.cc.
References EULER_ORDER_XYZ, and self.
Referenced by Euler_order_get(), Euler_repr(), and Euler_str().
|
static |
Definition at line 347 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, euler_order_str(), Euler_to_tuple_ex(), ret, and self.
|
static |
Definition at line 391 of file mathutils_Euler.cc.
References ATTR_FALLTHROUGH, b, BaseMath_ReadCallback, EULER_SIZE, EulerObject_Check, EXPP_VectorsAreEqual(), and EulerObject::order.
|
static |
Definition at line 259 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, eulO_to_mat3(), mat3_to_compatible_eulO(), mathutils_any_to_rotmat(), mul_m3_m3m3(), and self.
|
static |
Definition at line 220 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, ELEM, rotate_eulO(), and self.
|
static |
Sequence slice accessor (get): x = object[i:j].
Definition at line 522 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, CLAMP, count, EULER_SIZE, and self.
Referenced by Euler_subscript().
|
static |
Definition at line 364 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, BLI_dynstr_appendf(), BLI_dynstr_new(), euler_order_str(), mathutils_dynstr_to_py(), and self.
|
static |
Sequence generic subscript (get): x = object[...].
Definition at line 585 of file mathutils_Euler.cc.
References Euler_item(), EULER_SIZE, Euler_slice(), and self.
|
static |
Definition at line 174 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, eulO_to_mat3(), Matrix_CreatePyObject(), and self.
|
static |
Definition at line 152 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, eulO_to_quat(), Quaternion_CreatePyObject(), and self.
|
static |
Definition at line 74 of file mathutils_Euler.cc.
References double_round(), EULER_SIZE, ret, and self.
Referenced by Euler_repr().
|
static |
Definition at line 193 of file mathutils_Euler.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, self, and zero_v3().
| PyDoc_STRVAR | ( | Euler_axis_doc | , |
| "Euler axis angle in radians.\n" "\n" ":type: float" | ) |
| 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" " :arg angles: (X, Y, Z) angles in radians.\n" " :type angles: Sequence\n" " :arg order: Optional order of the | angles[float], | ||
| 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: str 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: str\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` | :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 673 of file mathutils_Euler.cc.
|
static |
Definition at line 747 of file mathutils_Euler.cc.
|
static |
Definition at line 787 of file mathutils_Euler.cc.
|
static |
Definition at line 660 of file mathutils_Euler.cc.
| PyTypeObject euler_Type |
Definition at line 830 of file mathutils_Euler.cc.
Referenced by Euler_CreatePyObject(), Euler_CreatePyObject_wrap(), Matrix_to_euler(), PyInit_mathutils(), and Quaternion_to_euler().