|
Blender V5.0
|
#include <algorithm>#include <Python.h>#include "mathutils.hh"#include "../generic/py_capi_utils.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) |
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_vectorcall (PyObject *type, PyObject *const *args, const size_t nargsf, PyObject *kwnames) |
| 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: An axis string.\n" " :type axis: Literal['X', 'Y', 'Z']\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" " :arg other: Other euler rotation.\n" " :type other: :class:`Euler`\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\n") | |
| 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: Literal['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']\n") | |
| 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: Buffer Protocol | |
| static PyBufferProcs | Euler_as_buffer |
| static int | Euler_getbuffer (PyObject *obj, Py_buffer *view, int flags) |
| static void | Euler_releasebuffer (PyObject *, Py_buffer *view) |
Euler Type: Python Object Definition | |
| PyTypeObject | euler_Type |
| PyDoc_STRVAR (euler_doc, ".. class:: Euler(angles=(0.0, 0.0, 0.0), 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: Euler rotation order.\n" " :type order: Literal['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']\n") | |
| #define EULER_SIZE 3 |
Definition at line 25 of file mathutils_Euler.cc.
Referenced by Euler_ass_item(), Euler_ass_slice(), Euler_ass_subscript(), Euler_CreatePyObject(), Euler_getbuffer(), Euler_hash(), Euler_item(), Euler_len(), Euler_make_compatible(), Euler_richcmpr(), Euler_slice(), Euler_subscript(), Euler_to_tuple_ex(), and Euler_vectorcall().
| #define MAKE_ID3 | ( | a, | |
| b, | |||
| c ) |
Referenced by euler_order_from_string().
|
static |
Sequence accessor (set): object[i] = x.
Definition at line 571 of file mathutils_Euler.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, EULER_SIZE, i, and self.
Referenced by Euler_ass_subscript(), and Euler_axis_set().
|
static |
Sequence slice accessor (set): object[i:j] = x.
Definition at line 633 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, begin(), CLAMP, EULER_SIZE, i, mathutils_array_parse(), self, and size().
Referenced by Euler_ass_subscript().
|
static |
Sequence generic subscript (set): object[...] = x.
Definition at line 708 of file mathutils_Euler.cc.
References Euler_ass_item(), Euler_ass_slice(), EULER_SIZE, i, self, and step.
|
static |
Definition at line 779 of file mathutils_Euler.cc.
References Euler_item(), POINTER_AS_INT, and self.
|
static |
Definition at line 784 of file mathutils_Euler.cc.
References Euler_ass_item(), POINTER_AS_INT, and self.
|
static |
Definition at line 355 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, Euler_CreatePyObject(), and self.
Referenced by Euler_deepcopy().
|
nodiscard |
Definition at line 987 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_vectorcall(), Matrix_to_euler(), pyrna_math_object_from_array(), and Quaternion_to_euler().
|
nodiscard |
Definition at line 1044 of file mathutils_Euler.cc.
References BLI_assert, Euler_CreatePyObject(), and self.
Referenced by pyrna_math_object_from_array().
|
nodiscard |
Definition at line 1025 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 363 of file mathutils_Euler.cc.
References Euler_copy(), PyC_CheckArgs_DeepCopy(), and self.
|
static |
Definition at line 421 of file mathutils_Euler.cc.
References BASE_MATH_FLAG_HAS_BUFFER_VIEW, BaseMath_Prepare_ForBufferAccess, BaseMath_ReadCallback, EULER_SIZE, float, self, UNLIKELY, and view.
|
static |
Definition at line 524 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 550 of file mathutils_Euler.cc.
References BaseMath_ReadIndexCallback, EULER_SIZE, i, and self.
Referenced by Euler_axis_get(), and Euler_subscript().
|
static |
Sequence length: len(object).
Definition at line 544 of file mathutils_Euler.cc.
References EULER_SIZE.
|
static |
Definition at line 319 of file mathutils_Euler.cc.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, compatible_eul(), EULER_SIZE, mathutils_array_parse(), and self.
|
static |
Definition at line 150 of file mathutils_Euler.cc.
References Euler_vectorcall(), and UNLIKELY.
|
nodiscard |
Definition at line 38 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_order_set(), Euler_vectorcall(), Matrix_to_euler(), and Quaternion_to_euler().
|
static |
Definition at line 797 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, euler_order_str(), and self.
|
static |
Definition at line 807 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 32 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 451 of file mathutils_Euler.cc.
References BASE_MATH_FLAG_HAS_BUFFER_VIEW, BaseMath_WriteCallback, self, UNLIKELY, and view.
|
static |
Definition at line 377 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, euler_order_str(), Euler_to_tuple_ex(), Py_DECREF(), ret, and self.
|
static |
Definition at line 474 of file mathutils_Euler.cc.
References ATTR_FALLTHROUGH, b, BaseMath_ReadCallback, EULER_SIZE, EulerObject_Check, EXPP_VectorsAreEqual(), and EulerObject::order.
|
static |
Definition at line 286 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 247 of file mathutils_Euler.cc.
References angle(), BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, ELEM, rotate_eulO(), and self.
|
static |
Sequence slice accessor (get): x = object[i:j].
Definition at line 608 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, begin(), CLAMP, count, EULER_SIZE, and self.
Referenced by Euler_subscript().
|
static |
Definition at line 394 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 671 of file mathutils_Euler.cc.
References Euler_item(), EULER_SIZE, Euler_slice(), i, self, and step.
|
static |
Definition at line 201 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, eulO_to_mat3(), Matrix_CreatePyObject(), and self.
|
static |
Definition at line 179 of file mathutils_Euler.cc.
References BaseMath_ReadCallback, eulO_to_quat(), Quaternion_CreatePyObject(), and self.
|
static |
Definition at line 76 of file mathutils_Euler.cc.
References double_round(), EULER_SIZE, i, ret, and self.
Referenced by Euler_repr().
|
static |
Definition at line 103 of file mathutils_Euler.cc.
References ATTR_FALLTHROUGH, Euler_CreatePyObject(), euler_order_from_string(), EULER_ORDER_XYZ, EULER_SIZE, mathutils_array_parse(), and UNLIKELY.
Referenced by Euler_new().
|
static |
Definition at line 220 of file mathutils_Euler.cc.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, 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=(0.0, 0.0, 0.0), 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: Euler rotation order.\n" " :type order: Literal\n" | [float][ 'XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'] ) |
| 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" " :arg other:Other euler rotation.\n" " :type other::class:`Euler`\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: Literal\n" | [ '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: An axis string.\n" " :type axis: Literal\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 463 of file mathutils_Euler.cc.
|
static |
Definition at line 759 of file mathutils_Euler.cc.
|
static |
Definition at line 833 of file mathutils_Euler.cc.
|
static |
Definition at line 877 of file mathutils_Euler.cc.
|
static |
Definition at line 746 of file mathutils_Euler.cc.
| PyTypeObject euler_Type |
Definition at line 925 of file mathutils_Euler.cc.
Referenced by Euler_CreatePyObject(), Euler_CreatePyObject_wrap(), Matrix_to_euler(), PyInit_mathutils(), and Quaternion_to_euler().