|
Blender V4.3
|
#include <Python.h>#include "BLI_utildefines.h"#include "../mathutils/mathutils.hh"#include "../generic/py_capi_utils.hh"#include "GPU_matrix.hh"#include "gpu_py.hh"#include "gpu_py_matrix.hh"Go to the source code of this file.
Classes | |
| struct | BPyGPU_MatrixStackContext |
Macros | |
| #define | USE_GPU_PY_MATRIX_API |
Functions | |
Helper Functions | |
| static bool | pygpu_stack_is_push_model_view_ok_or_error () |
| static bool | pygpu_stack_is_push_projection_ok_or_error () |
| static bool | pygpu_stack_is_pop_model_view_ok_or_error () |
| static bool | pygpu_stack_is_pop_projection_ok_or_error () |
Manage Stack | |
| PyDoc_STRVAR (pygpu_matrix_push_doc, ".. function:: push()\n" "\n" " Add to the model-view matrix stack.\n") | |
| static PyObject * | pygpu_matrix_push (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_pop_doc, ".. function:: pop()\n" "\n" " Remove the last model-view matrix from the stack.\n") | |
| static PyObject * | pygpu_matrix_pop (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_push_projection_doc, ".. function:: push_projection()\n" "\n" " Add to the projection matrix stack.\n") | |
| static PyObject * | pygpu_matrix_push_projection (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_pop_projection_doc, ".. function:: pop_projection()\n" "\n" " Remove the last projection matrix from the stack.\n") | |
| static PyObject * | pygpu_matrix_pop_projection (PyObject *) |
Manipulate State | |
| PyDoc_STRVAR (pygpu_matrix_multiply_matrix_doc, ".. function:: multiply_matrix(matrix)\n" "\n" " Multiply the current stack matrix.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_multiply_matrix (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_matrix_scale_doc, ".. function:: scale(scale)\n" "\n" " Scale the current stack matrix.\n" "\n" " :arg scale: Scale the current stack matrix with 2 or 3 floats.\n" " :type scale: Sequence[float]\n") | |
| static PyObject * | pygpu_matrix_scale (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_matrix_scale_uniform_doc, ".. function:: scale_uniform(scale)\n" "\n" " :arg scale: Scale the current stack matrix.\n" " :type scale: float\n") | |
| static PyObject * | pygpu_matrix_scale_uniform (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_matrix_translate_doc, ".. function:: translate(offset)\n" "\n" " Scale the current stack matrix.\n" "\n" " :arg offset: Translate the current stack matrix with 2 or 3 floats.\n" " :type offset: Sequence[float]\n") | |
| static PyObject * | pygpu_matrix_translate (PyObject *, PyObject *value) |
Write State | |
| PyDoc_STRVAR (pygpu_matrix_reset_doc, ".. function:: reset()\n" "\n" " Empty stack and set to identity.\n") | |
| static PyObject * | pygpu_matrix_reset (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_load_identity_doc, ".. function:: load_identity()\n" "\n" " Load an identity matrix into the stack.\n") | |
| static PyObject * | pygpu_matrix_load_identity (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_load_matrix_doc, ".. function:: load_matrix(matrix)\n" "\n" " Load a matrix into the stack.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_load_matrix (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_matrix_load_projection_matrix_doc, ".. function:: load_projection_matrix(matrix)\n" "\n" " Load a projection matrix into the stack.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_load_projection_matrix (PyObject *, PyObject *value) |
Read State | |
| PyDoc_STRVAR (pygpu_matrix_get_projection_matrix_doc, ".. function:: get_projection_matrix()\n" "\n" " Return a copy of the projection matrix.\n" "\n" " :return: A 4x4 projection matrix.\n" " :rtype: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_get_projection_matrix (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_get_model_view_matrix_doc, ".. function:: get_model_view_matrix()\n" "\n" " Return a copy of the model-view matrix.\n" "\n" " :return: A 4x4 view matrix.\n" " :rtype: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_get_model_view_matrix (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_get_normal_matrix_doc, ".. function:: get_normal_matrix()\n" "\n" " Return a copy of the normal matrix.\n" "\n" " :return: A 3x3 normal matrix.\n" " :rtype: :class:`mathutils.Matrix`\n") | |
| static PyObject * | pygpu_matrix_get_normal_matrix (PyObject *) |
Stack (Context Manager) | |
Safer alternative to ensure balanced push/pop calls. | |
| enum | { PYGPU_MATRIX_TYPE_MODEL_VIEW = 1 , PYGPU_MATRIX_TYPE_PROJECTION = 2 } |
| static PyMethodDef | pygpu_matrix_stack_context__tp_methods [] |
| static PyTypeObject | PyGPUMatrixStackContext_Type |
| static PyObject * | pygpu_matrix_stack_context_enter (BPyGPU_MatrixStackContext *self) |
| static PyObject * | pygpu_matrix_stack_context_exit (BPyGPU_MatrixStackContext *self, PyObject *args) |
| static PyObject * | pygpu_matrix_push_pop_impl (int type) |
| PyDoc_STRVAR (pygpu_matrix_push_pop_doc, ".. function:: push_pop()\n" "\n" " Context manager to ensure balanced push/pop calls, even in the case of an error.\n") | |
| static PyObject * | pygpu_matrix_push_pop (PyObject *) |
| PyDoc_STRVAR (pygpu_matrix_push_pop_projection_doc, ".. function:: push_pop_projection()\n" "\n" " Context manager to ensure balanced push/pop calls, even in the case of an error.\n") | |
| static PyObject * | pygpu_matrix_push_pop_projection (PyObject *) |
Module | |
| static PyMethodDef | pygpu_matrix__tp_methods [] |
| static PyModuleDef | pygpu_matrix_module_def |
| PyDoc_STRVAR (pygpu_matrix__tp_doc, "This module provides access to the matrix stack.") | |
| PyObject * | bpygpu_matrix_init () |
This file defines the gpu.matrix stack API.
bpygpu_ for local API.BPyGPU for public API. Definition in file gpu_py_matrix.cc.
| #define USE_GPU_PY_MATRIX_API |
Definition at line 25 of file gpu_py_matrix.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| PYGPU_MATRIX_TYPE_MODEL_VIEW | |
| PYGPU_MATRIX_TYPE_PROJECTION | |
Definition at line 165 of file gpu_py_matrix.cc.
| PyObject * bpygpu_matrix_init | ( | ) |
Definition at line 678 of file gpu_py_matrix.cc.
References pygpu_matrix_module_def, and PyGPUMatrixStackContext_Type.
Referenced by BPyInit_gpu().
| PyDoc_STRVAR | ( | pygpu_matrix__tp_doc | , |
| "This module provides access to the matrix stack." | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_get_model_view_matrix_doc | , |
| ".. function:: get_model_view_matrix()\n" "\n" " Return a copy of the model-view matrix.\n" "\n" " :return: A 4x4 view matrix.\n" " :rtype: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_get_normal_matrix_doc | , |
| ".. function:: get_normal_matrix()\n" "\n" " Return a copy of the normal matrix.\n" "\n" " :return: A 3x3 normal matrix.\n" " :rtype: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_get_projection_matrix_doc | , |
| ".. function:: get_projection_matrix()\n" "\n" " Return a copy of the projection matrix.\n" "\n" " :return: A 4x4 projection matrix.\n" " :rtype: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_load_identity_doc | , |
| ".. function:: load_identity()\n" "\n" " Load an identity matrix into the stack.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_load_matrix_doc | , |
| ".. function:: load_matrix(matrix)\n" "\n" " Load a matrix into the stack.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_load_projection_matrix_doc | , |
| ".. function:: load_projection_matrix(matrix)\n" "\n" " Load a projection matrix into the stack.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_multiply_matrix_doc | , |
| ".. function:: multiply_matrix(matrix)\n" "\n" " Multiply the current stack matrix.\n" "\n" " :arg matrix: A 4x4 matrix.\n" " :type matrix: :class:`mathutils.Matrix`\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_pop_doc | , |
| ".. function:: pop()\n" "\n" " Remove the last model-view matrix from the stack.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_pop_projection_doc | , |
| ".. function:: pop_projection()\n" "\n" " Remove the last projection matrix from the stack.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_push_doc | , |
| ".. function:: push()\n" "\n" " Add to the model-view matrix stack.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_push_pop_doc | , |
| ".. function:: push_pop()\n" "\n" " Context manager to ensure balanced push/pop | calls, | ||
| even in the case of an error.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_push_pop_projection_doc | , |
| ".. function:: push_pop_projection()\n" "\n" " Context manager to ensure balanced push/pop | calls, | ||
| even in the case of an error.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_push_projection_doc | , |
| ".. function:: push_projection()\n" "\n" " Add to the projection matrix stack.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_reset_doc | , |
| ".. function:: reset()\n" "\n" " Empty stack and set to identity.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_scale_doc | , |
| ".. function:: scale(scale)\n" "\n" " Scale the current stack matrix.\n" "\n" " :arg scale: Scale the current stack matrix with 2 or 3 floats.\n" " :type scale: Sequence\n" | [float] ) |
| PyDoc_STRVAR | ( | pygpu_matrix_scale_uniform_doc | , |
| ".. function:: scale_uniform(scale)\n" "\n" " :arg scale: Scale the current stack matrix.\n" " :type scale: float\n" | ) |
| PyDoc_STRVAR | ( | pygpu_matrix_translate_doc | , |
| ".. function:: translate(offset)\n" "\n" " Scale the current stack matrix.\n" "\n" " :arg offset: Translate the current stack matrix with 2 or 3 floats.\n" " :type offset: Sequence\n" | [float] ) |
|
static |
Definition at line 551 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_model_view_get, and Matrix_CreatePyObject().
|
static |
Definition at line 569 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_normal_get, and Matrix_CreatePyObject().
|
static |
Definition at line 533 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_projection_get, and Matrix_CreatePyObject().
|
static |
Definition at line 468 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_matrix_identity_set().
|
static |
Definition at line 485 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_set, and Matrix_Parse4x4().
|
static |
Definition at line 506 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_projection_set, and Matrix_Parse4x4().
|
static |
Definition at line 354 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_mul, and Matrix_Parse4x4().
|
static |
Definition at line 105 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_pop(), and pygpu_stack_is_pop_model_view_ok_or_error().
|
static |
Definition at line 139 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_pop_projection(), and pygpu_stack_is_pop_projection_ok_or_error().
|
static |
Definition at line 88 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_push(), and pygpu_stack_is_push_model_view_ok_or_error().
|
static |
Definition at line 321 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, pygpu_matrix_push_pop_impl(), and PYGPU_MATRIX_TYPE_MODEL_VIEW.
|
static |
Definition at line 306 of file gpu_py_matrix.cc.
References PyGPUMatrixStackContext_Type, and ret.
Referenced by pygpu_matrix_push_pop(), and pygpu_matrix_push_pop_projection().
|
static |
Definition at line 334 of file gpu_py_matrix.cc.
References pygpu_matrix_push_pop_impl(), and PYGPU_MATRIX_TYPE_PROJECTION.
|
static |
Definition at line 122 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_push_projection(), and pygpu_stack_is_push_projection_ok_or_error().
|
static |
Definition at line 454 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_matrix_reset().
|
static |
Definition at line 375 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_scale_2fv(), GPU_matrix_scale_3fv(), len, and mathutils_array_parse().
|
static |
Definition at line 402 of file gpu_py_matrix.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_matrix_scale_1f().
|
static |
Definition at line 240 of file gpu_py_matrix.cc.
References BLI_assert_unreachable, BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_push(), GPU_matrix_push_projection(), GPU_matrix_stack_level_get_model_view(), GPU_matrix_stack_level_get_projection(), PYGPU_MATRIX_TYPE_MODEL_VIEW, PYGPU_MATRIX_TYPE_PROJECTION, pygpu_stack_is_push_model_view_ok_or_error(), pygpu_stack_is_push_projection_ok_or_error(), and self.
|
static |
Definition at line 270 of file gpu_py_matrix.cc.
References BLI_assert_unreachable, BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_stack_level_get_model_view(), GPU_matrix_stack_level_get_projection(), PYGPU_MATRIX_TYPE_MODEL_VIEW, PYGPU_MATRIX_TYPE_PROJECTION, and self.
|
static |
Definition at line 424 of file gpu_py_matrix.cc.
References GPU_matrix_translate_2fv(), GPU_matrix_translate_3fv(), len, and mathutils_array_parse().
|
static |
Definition at line 58 of file gpu_py_matrix.cc.
References GPU_matrix_stack_level_get_model_view().
Referenced by pygpu_matrix_pop().
|
static |
Definition at line 67 of file gpu_py_matrix.cc.
References GPU_matrix_stack_level_get_projection().
Referenced by pygpu_matrix_pop_projection().
|
static |
Definition at line 36 of file gpu_py_matrix.cc.
References GPU_matrix_stack_level_get_model_view(), and STRINGIFY.
Referenced by pygpu_matrix_push(), and pygpu_matrix_stack_context_enter().
|
static |
Definition at line 47 of file gpu_py_matrix.cc.
References GPU_matrix_stack_level_get_projection(), and STRINGIFY.
Referenced by pygpu_matrix_push_projection(), and pygpu_matrix_stack_context_enter().
|
static |
Definition at line 589 of file gpu_py_matrix.cc.
|
static |
Definition at line 666 of file gpu_py_matrix.cc.
Referenced by bpygpu_matrix_init().
|
static |
Definition at line 178 of file gpu_py_matrix.cc.
|
static |
Definition at line 188 of file gpu_py_matrix.cc.
Referenced by bpygpu_matrix_init(), and pygpu_matrix_push_pop_impl().