|
Blender V4.3
|
#include <Python.h>#include "GPU_framebuffer.hh"#include "GPU_state.hh"#include "../generic/py_capi_utils.hh"#include "../generic/python_utildefines.hh"#include "gpu_py.hh"#include "gpu_py_framebuffer.hh"#include "gpu_py_state.hh"Go to the source code of this file.
Functions | |
Manage Stack | |
| PyDoc_STRVAR (pygpu_state_blend_set_doc, ".. function:: blend_set(mode)\n" "\n" " Defines the fixed pipeline blending equation.\n" "\n" " :arg mode: The type of blend mode.\n" "\n" " * ``NONE`` No blending.\n" " * ``ALPHA`` The original color channels are interpolated according to the alpha " "value.\n" " * ``ALPHA_PREMULT`` The original color channels are interpolated according to the " "alpha value with the new colors pre-multiplied by this value.\n" " * ``ADDITIVE`` The original color channels are added by the corresponding ones.\n" " * ``ADDITIVE_PREMULT`` The original color channels are added by the corresponding ones " "that are pre-multiplied by the alpha value.\n" " * ``MULTIPLY`` The original color channels are multiplied by the corresponding ones.\n" " * ``SUBTRACT`` The original color channels are subtracted by the corresponding ones.\n" " * ``INVERT`` The original color channels are replaced by its complementary color.\n" " :type mode: str\n") | |
| static PyObject * | pygpu_state_blend_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_blend_get_doc, ".. function:: blend_get()\n" "\n" " Current blending equation.\n" "\n") | |
| static PyObject * | pygpu_state_blend_get (PyObject *) |
| PyDoc_STRVAR (pygpu_state_clip_distances_set_doc, ".. function:: clip_distances_set(distances_enabled)\n" "\n" " Sets the number of `gl_ClipDistance` planes used for clip geometry.\n" "\n" " :arg distances_enabled: Number of clip distances enabled.\n" " :type distances_enabled: int\n") | |
| static PyObject * | pygpu_state_clip_distances_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_depth_test_set_doc, ".. function:: depth_test_set(mode)\n" "\n" " Defines the depth_test equation.\n" "\n" " :arg mode: The depth test equation name.\n" " Possible values are `NONE`, `ALWAYS`, `LESS`, `LESS_EQUAL`, `EQUAL`, " "`GREATER` and `GREATER_EQUAL`.\n" " :type mode: str\n") | |
| static PyObject * | pygpu_state_depth_test_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_depth_test_get_doc, ".. function:: depth_test_get()\n" "\n" " Current depth_test equation.\n" "\n") | |
| static PyObject * | pygpu_state_depth_test_get (PyObject *) |
| PyDoc_STRVAR (pygpu_state_depth_mask_set_doc, ".. function:: depth_mask_set(value)\n" "\n" " Write to depth component.\n" "\n" " :arg value: True for writing to the depth component.\n" " :type near: bool\n") | |
| static PyObject * | pygpu_state_depth_mask_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_depth_mask_get_doc, ".. function:: depth_mask_get()\n" "\n" " Writing status in the depth component.\n") | |
| static PyObject * | pygpu_state_depth_mask_get (PyObject *) |
| PyDoc_STRVAR (pygpu_state_viewport_set_doc, ".. function:: viewport_set(x, y, xsize, ysize)\n" "\n" " Specifies the viewport of the active framebuffer.\n" " Note: The viewport state is not saved upon framebuffer rebind.\n" "\n" " :arg x, y: lower left corner of the viewport_set rectangle, in pixels.\n" " :type x, y: int\n" " :arg xsize, ysize: width and height of the viewport_set.\n" " :type xsize, ysize: int\n") | |
| static PyObject * | pygpu_state_viewport_set (PyObject *, PyObject *args) |
| PyDoc_STRVAR (pygpu_state_viewport_get_doc, ".. function:: viewport_get()\n" "\n" " Viewport of the active framebuffer.\n") | |
| static PyObject * | pygpu_state_viewport_get (PyObject *, PyObject *) |
| PyDoc_STRVAR (pygpu_state_scissor_set_doc, ".. function:: scissor_set(x, y, xsize, ysize)\n" "\n" " Specifies the scissor area of the active framebuffer.\n" " Note: The scissor state is not saved upon framebuffer rebind.\n" "\n" " :arg x, y: lower left corner of the scissor rectangle, in pixels.\n" " :type x, y: int\n" " :arg xsize, ysize: width and height of the scissor rectangle.\n" " :type xsize, ysize: int\n") | |
| static PyObject * | pygpu_state_scissor_set (PyObject *, PyObject *args) |
| PyDoc_STRVAR (pygpu_state_scissor_get_doc, ".. function:: scissor_get()\n" "\n" " Retrieve the scissors of the active framebuffer.\n" " Note: Only valid between 'scissor_set' and a framebuffer rebind.\n" "\n" " :return: The scissor of the active framebuffer as a tuple\n" " (x, y, xsize, ysize).\n" " x, y: lower left corner of the scissor rectangle, in pixels.\n" " xsize, ysize: width and height of the scissor rectangle.\n" " :rtype: tuple[int, int, int, int]\n") | |
| static PyObject * | pygpu_state_scissor_get (PyObject *, PyObject *) |
| PyDoc_STRVAR (pygpu_state_scissor_test_set_doc, ".. function:: scissor_test_set(enable)\n" "\n" " Enable/disable scissor testing on the active framebuffer.\n" "\n" " :arg enable:\n" " True - enable scissor testing.\n" " False - disable scissor testing.\n" " :type enable: bool\n") | |
| static PyObject * | pygpu_state_scissor_test_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_line_width_set_doc, ".. function:: line_width_set(width)\n" "\n" " Specify the width of rasterized lines.\n" "\n" " :arg size: New width.\n" " :type mode: float\n") | |
| static PyObject * | pygpu_state_line_width_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_line_width_get_doc, ".. function:: line_width_get()\n" "\n" " Current width of rasterized lines.\n") | |
| static PyObject * | pygpu_state_line_width_get (PyObject *) |
| PyDoc_STRVAR (pygpu_state_point_size_set_doc, ".. function:: point_size_set(size)\n" "\n" " Specify the diameter of rasterized points.\n" "\n" " :arg size: New diameter.\n" " :type mode: float\n") | |
| static PyObject * | pygpu_state_point_size_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_color_mask_set_doc, ".. function:: color_mask_set(r, g, b, a)\n" "\n" " Enable or disable writing of frame buffer color components.\n" "\n" " :arg r, g, b, a: components red, green, blue, and alpha.\n" " :type r, g, b, a: bool\n") | |
| static PyObject * | pygpu_state_color_mask_set (PyObject *, PyObject *args) |
| PyDoc_STRVAR (pygpu_state_face_culling_set_doc, ".. function:: face_culling_set(culling)\n" "\n" " Specify whether none, front-facing or back-facing facets can be culled.\n" "\n" " :arg mode: `NONE`, `FRONT` or `BACK`.\n" " :type mode: str\n") | |
| static PyObject * | pygpu_state_face_culling_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_front_facing_set_doc, ".. function:: front_facing_set(invert)\n" "\n" " Specifies the orientation of front-facing polygons.\n" "\n" " :arg invert: True for clockwise polygons as front-facing.\n" " :type mode: bool\n") | |
| static PyObject * | pygpu_state_front_facing_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_program_point_size_set_doc, ".. function:: program_point_size_set(enable)\n" "\n" " If enabled, the derived point size is taken from the (potentially clipped) " "shader builtin gl_PointSize.\n" "\n" " :arg enable: True for shader builtin gl_PointSize.\n" " :type enable: bool\n") | |
| static PyObject * | pygpu_state_program_point_size_set (PyObject *, PyObject *value) |
| PyDoc_STRVAR (pygpu_state_active_framebuffer_get_doc, ".. function:: active_framebuffer_get(enable)\n" "\n" " Return the active frame-buffer in context.\n") | |
| static PyObject * | pygpu_state_active_framebuffer_get (PyObject *) |
Variables | |
Helper Functions | |
| static const PyC_StringEnumItems | pygpu_state_blend_items [] |
| static const PyC_StringEnumItems | pygpu_state_depthtest_items [] |
| static const PyC_StringEnumItems | pygpu_state_faceculling_items [] |
Module | |
| static PyMethodDef | pygpu_state__tp_methods [] |
| static PyModuleDef | pygpu_state_module_def |
| PyDoc_STRVAR (pygpu_state__tp_doc, "This module provides access to the gpu state.") | |
| PyObject * | bpygpu_state_init () |
This file defines the gpu.state API.
bpygpu_ for local API.BPyGPU for public API. Definition in file gpu_py_state.cc.
| PyObject * bpygpu_state_init | ( | ) |
Definition at line 617 of file gpu_py_state.cc.
References pygpu_state_module_def.
Referenced by BPyInit_gpu().
| PyDoc_STRVAR | ( | pygpu_state__tp_doc | , |
| "This module provides access to the gpu state." | ) |
| PyDoc_STRVAR | ( | pygpu_state_active_framebuffer_get_doc | , |
| ".. function:: active_framebuffer_get(enable)\n" "\n" " Return the active frame-buffer in context.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_blend_get_doc | , |
| ".. function:: blend_get()\n" "\n" " Current blending equation.\n" "\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_blend_set_doc | , |
| ".. function:: blend_set(mode)\n" "\n" " Defines the fixed pipeline blending equation.\n" "\n" " :arg mode: The type of blend mode.\n" "\n" " * ``NONE`` No blending.\n" " * ``ALPHA`` The original color channels are interpolated according to the alpha " "value.\n" " * ``ALPHA_PREMULT`` The original color channels are interpolated according to the " "alpha value with the new colors pre-multiplied by this value.\n" " * ``ADDITIVE`` The original color channels are added by the corresponding ones.\n" " * ``ADDITIVE_PREMULT`` The original color channels are added by the corresponding ones " "that are pre-multiplied by the alpha value.\n" " * ``MULTIPLY`` The original color channels are multiplied by the corresponding ones.\n" " * ``SUBTRACT`` The original color channels are subtracted by the corresponding ones.\n" " * ``INVERT`` The original color channels are replaced by its complementary color.\n" " :type mode: str\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_clip_distances_set_doc | , |
| ".. function:: clip_distances_set(distances_enabled)\n" "\n" " Sets the number of `gl_ClipDistance` planes used for clip geometry.\n" "\n" " :arg distances_enabled: Number of clip distances enabled.\n" " :type distances_enabled: int\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_color_mask_set_doc | , |
| ".. function:: color_mask_set(r, g, b, a)\n" "\n" " Enable or disable writing of frame buffer color components.\n" "\n" " :arg | r, | ||
| g | , | ||
| b | , | ||
| a:components | red, | ||
| green | , | ||
| blue | , | ||
| and alpha.\n" " :type | r, | ||
| g | , | ||
| b | , | ||
| a:bool\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_depth_mask_get_doc | , |
| ".. function:: depth_mask_get()\n" "\n" " Writing status in the depth component.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_depth_mask_set_doc | , |
| ".. function:: depth_mask_set(value)\n" "\n" " Write to depth component.\n" "\n" " :arg value: True for writing to the depth component.\n" " :type near: bool\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_depth_test_get_doc | , |
| ".. function:: depth_test_get()\n" "\n" " Current depth_test equation.\n" "\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_depth_test_set_doc | , |
| ".. function:: depth_test_set(mode)\n" "\n" " Defines the depth_test equation.\n" "\n" " :arg mode: The depth test equation name.\n" " Possible values are `NONE` | , | ||
| `ALWAYS` | , | ||
| `LESS` | , | ||
| `LESS_EQUAL` | , | ||
| `EQUAL` | , | ||
| " "`GREATER` and `GREATER_EQUAL`.\n" " :type mode:str\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_face_culling_set_doc | , |
| ".. function:: face_culling_set(culling)\n" "\n" " Specify whether | none, | ||
| front-facing or back-facing facets can be culled.\n" "\n" " :arg mode:`NONE` | , | ||
| `FRONT` or `BACK`.\n" " :type mode:str\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_front_facing_set_doc | , |
| ".. function:: front_facing_set(invert)\n" "\n" " Specifies the orientation of front-facing polygons.\n" "\n" " :arg invert: True for clockwise polygons as front-facing.\n" " :type mode: bool\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_line_width_get_doc | , |
| ".. function:: line_width_get()\n" "\n" " Current width of rasterized lines.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_line_width_set_doc | , |
| ".. function:: line_width_set(width)\n" "\n" " Specify the width of rasterized lines.\n" "\n" " :arg size: New width.\n" " :type mode: float\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_point_size_set_doc | , |
| ".. function:: point_size_set(size)\n" "\n" " Specify the diameter of rasterized points.\n" "\n" " :arg size: New diameter.\n" " :type mode: float\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_program_point_size_set_doc | , |
| ".. function:: program_point_size_set(enable)\n" "\n" " If | enabled, | ||
| the derived point size is taken from the(potentially clipped) " "shader builtin gl_PointSize.\n" "\n" " :arg enable:True for shader builtin gl_PointSize.\n" " :type enable:bool\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_scissor_get_doc | , |
| ".. function:: scissor_get()\n" "\n" " Retrieve the scissors of the active framebuffer.\n" " Note: Only valid between 'scissor_set' and a framebuffer rebind.\n" "\n" " :return: The scissor of the active framebuffer as a tuple\n" " (x, y, xsize, ysize).\n" " | x, | ||
| y:lower left corner of the scissor | rectangle, | ||
| in pixels.\n" " | xsize, | ||
| ysize:width and height of the scissor rectangle.\n" " :rtype:tuple\n" | [int, int, int, int] ) |
| PyDoc_STRVAR | ( | pygpu_state_scissor_set_doc | , |
| ".. function:: scissor_set(x, y, xsize, ysize)\n" "\n" " Specifies the scissor area of the active framebuffer.\n" " Note: The scissor state is not saved upon framebuffer rebind.\n" "\n" " :arg | x, | ||
| y:lower left corner of the scissor | rectangle, | ||
| in pixels.\n" " :type | x, | ||
| y:int\n" " :arg | xsize, | ||
| ysize:width and height of the scissor rectangle.\n" " :type | xsize, | ||
| ysize:int\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_scissor_test_set_doc | , |
| ".. function:: scissor_test_set(enable)\n" "\n" " Enable/disable scissor testing on the active framebuffer.\n" "\n" " :arg enable:\n" " True - enable scissor testing.\n" " False - disable scissor testing.\n" " :type enable: bool\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_viewport_get_doc | , |
| ".. function:: viewport_get()\n" "\n" " Viewport of the active framebuffer.\n" | ) |
| PyDoc_STRVAR | ( | pygpu_state_viewport_set_doc | , |
| ".. function:: viewport_set(x, y, xsize, ysize)\n" "\n" " Specifies the viewport of the active framebuffer.\n" " Note: The viewport state is not saved upon framebuffer rebind.\n" "\n" " :arg | x, | ||
| y:lower left corner of the viewport_set | rectangle, | ||
| in pixels.\n" " :type | x, | ||
| y:int\n" " :arg | xsize, | ||
| ysize:width and height of the viewport_set.\n" " :type | xsize, | ||
| ysize:int\n" | ) |
|
static |
Definition at line 499 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, BPyGPUFrameBuffer_CreatePyObject(), fb(), and GPU_framebuffer_active_get().
|
static |
Definition at line 115 of file gpu_py_state.cc.
References blend, BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_blend_get(), PyC_StringEnum_FindIDFromValue(), and pygpu_state_blend_items.
|
static |
Definition at line 96 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_blend(), PyC_ParseStringEnum(), pygpu_state_blend_items, and PyC_StringEnum::value_found.
|
static |
Definition at line 132 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_clip_distances(), and int.
|
static |
Definition at line 413 of file gpu_py_state.cc.
References b, BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_color_mask().
|
static |
Definition at line 214 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_depth_mask_get().
|
static |
Definition at line 196 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_depth_mask(), and PyC_ParseBool().
|
static |
Definition at line 179 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_depth_test_get(), PyC_StringEnum_FindIDFromValue(), and pygpu_state_depthtest_items.
|
static |
Definition at line 160 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_depth_test(), PyC_ParseStringEnum(), pygpu_state_depthtest_items, and PyC_StringEnum::value_found.
|
static |
Definition at line 435 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_face_culling(), PyC_ParseStringEnum(), pygpu_state_faceculling_items, and PyC_StringEnum::value_found.
|
static |
Definition at line 457 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_front_facing(), invert(), and PyC_ParseBool().
|
static |
Definition at line 374 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, and GPU_line_width_get().
|
static |
Definition at line 355 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, float, and GPU_line_width().
|
static |
Definition at line 391 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, float, and GPU_point_size().
|
static |
Definition at line 480 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_program_point_size(), and PyC_ParseBool().
|
static |
Definition at line 306 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_scissor_get(), PyTuple_SET_ITEMS, and ret.
|
static |
Definition at line 280 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_scissor(), x, and y.
|
static |
Definition at line 333 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, enabled, GPU_scissor_test(), and PyC_ParseBool().
|
static |
Definition at line 252 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_viewport_size_get_i(), PyTuple_SET_ITEMS, and ret.
|
static |
Definition at line 233 of file gpu_py_state.cc.
References BPYGPU_IS_INIT_OR_ERROR_OBJ, GPU_viewport(), x, and y.
|
static |
Definition at line 518 of file gpu_py_state.cc.
|
static |
Definition at line 30 of file gpu_py_state.cc.
Referenced by pygpu_state_blend_get(), and pygpu_state_blend_set().
|
static |
Definition at line 48 of file gpu_py_state.cc.
Referenced by pygpu_state_depth_test_get(), and pygpu_state_depth_test_set().
|
static |
Definition at line 59 of file gpu_py_state.cc.
Referenced by pygpu_state_face_culling_set().
|
static |
Definition at line 605 of file gpu_py_state.cc.
Referenced by bpygpu_state_init().