Blender V5.3
gpu_py_offscreen.cc File Reference
#include <Python.h>
#include "BLI_string_utf8.hh"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_scene.hh"
#include "DNA_view3d_types.h"
#include "GPU_context.hh"
#include "GPU_framebuffer.hh"
#include "GPU_state.hh"
#include "GPU_texture.hh"
#include "GPU_viewport.hh"
#include "ED_view3d_offscreen.hh"
#include "../mathutils/mathutils.hh"
#include "../generic/py_capi_utils.hh"
#include "../generic/python_compat.hh"
#include "gpu_py.hh"
#include "gpu_py_texture.hh"
#include "gpu_py_offscreen.hh"

Go to the source code of this file.

Classes

struct  blender::OffScreenStackContext

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define BPYGPU_USE_GPUOBJ_FREE_METHOD

Functions

Public API
PyObject * blender::BPyGPUOffScreen_CreatePyObject (GPUOffScreen *ofs)

GPUOffScreen Common Utilities

#define BPY_GPU_OFFSCREEN_CHECK_OBJ(bpygpu)
static const PyC_StringEnumItems blender::pygpu_framebuffer_color_texture_formats []
static int blender::pygpu_offscreen_valid_check (BPyGPUOffScreen *py_ofs)

Stack (Context Manager)

Safer alternative to ensure balanced push/pop calls.

static PyMethodDef blender::pygpu_offscreen_stack_context__tp_methods []
PyTypeObject blender::PyGPUOffscreenStackContext_Type
static void blender::pygpu_offscreen_stack_context__tp_dealloc (OffScreenStackContext *self)
static PyObject * blender::pygpu_offscreen_stack_context_enter (OffScreenStackContext *self)
static PyObject * blender::pygpu_offscreen_stack_context_exit (OffScreenStackContext *self, PyObject *)
 blender::PyDoc_STRVAR (pygpu_offscreen_stack_context__tp_doc, "Context manager for off-screen framebuffer binding.")
 blender::PyDoc_STRVAR (pygpu_offscreen_bind_doc, ".. method:: bind()\n" "\n" " Context manager to ensure balanced bind calls, even in the case of an error.\n" "\n" " :return: A context manager for the off-screen binding.\n" " :rtype: :class:`gpu.types.OffScreenStackContext`\n")
static PyObject * blender::pygpu_offscreen_bind (BPyGPUOffScreen *self)
 blender::PyDoc_STRVAR (pygpu_offscreen_unbind_doc, ".. method:: unbind(*, restore=True)\n" "\n" " Unbind the offscreen object.\n" "\n" " :param restore: Restore the OpenGL state, can only be used when the state has been " "saved before.\n" " :type restore: bool\n")
static PyObject * blender::pygpu_offscreen_unbind (BPyGPUOffScreen *self, PyObject *args, PyObject *kwds)

GPUOffscreen Type

static PyGetSetDef blender::pygpu_offscreen__tp_getseters []
static PyMethodDef blender::pygpu_offscreen__tp_methods []
PyTypeObject blender::BPyGPUOffScreen_Type
static PyObject * blender::pygpu_offscreen__tp_new (PyTypeObject *, PyObject *args, PyObject *kwds)
 blender::PyDoc_STRVAR (pygpu_offscreen_width_doc, "Width of the texture.\n" "\n" ":type: int\n")
static PyObject * blender::pygpu_offscreen_width_get (BPyGPUOffScreen *self, void *)
 blender::PyDoc_STRVAR (pygpu_offscreen_height_doc, "Height of the texture.\n" "\n" ":type: int\n")
static PyObject * blender::pygpu_offscreen_height_get (BPyGPUOffScreen *self, void *)
 blender::PyDoc_STRVAR (pygpu_offscreen_texture_color_doc, "The color texture attached.\n" "\n" ":type: :class:`gpu.types.GPUTexture`\n")
static PyObject * blender::pygpu_offscreen_texture_color_get (BPyGPUOffScreen *self, void *)
 blender::PyDoc_STRVAR (pygpu_offscreen_draw_view3d_doc, ".. method:: draw_view3d(scene, view_layer, view3d, region, view_matrix, projection_matrix, " "*, do_color_management=False, draw_background=True)\n" "\n" " Draw the 3d viewport in the offscreen object.\n" "\n" " :param scene: Scene to draw.\n" " :type scene: :class:`bpy.types.Scene`\n" " :param view_layer: View layer to draw.\n" " :type view_layer: :class:`bpy.types.ViewLayer`\n" " :param view3d: 3D View to get the drawing settings from.\n" " :type view3d: :class:`bpy.types.SpaceView3D`\n" " :param region: Region of the 3D View (required as temporary draw target).\n" " :type region: :class:`bpy.types.Region`\n" " :param view_matrix: View Matrix (e.g. ``camera.matrix_world.inverted()``).\n" " :type view_matrix: :class:`mathutils.Matrix`\n" " :param projection_matrix: Projection Matrix (e.g. ``camera.calc_matrix_camera(...)``).\n" " :type projection_matrix: :class:`mathutils.Matrix`\n" " :param do_color_management: Color manage the output.\n" " :type do_color_management: bool\n" " :param draw_background: Draw background.\n" " :type draw_background: bool\n")
static PyObject * blender::pygpu_offscreen_draw_view3d (BPyGPUOffScreen *self, PyObject *args, PyObject *kwds)
 blender::PyDoc_STRVAR (pygpu_offscreen_free_doc, ".. method:: free()\n" "\n" " Free the offscreen object.\n" " The framebuffer, texture and render objects will no longer be accessible.\n")
static PyObject * blender::pygpu_offscreen_free (BPyGPUOffScreen *self)
static void blender::BPyGPUOffScreen__tp_dealloc (BPyGPUOffScreen *self)
 blender::PyDoc_STRVAR (pygpu_offscreen__tp_doc, ".. class:: GPUOffScreen\n" "\n" " This object gives access to off screen buffers.\n" "\n" " .. method:: __init__(width, height, *, format='RGBA8')\n" "\n" " :param width: Horizontal dimension of the buffer.\n" " :type width: int\n" " :param height: Vertical dimension of the buffer.\n" " :type height: int\n" " :param format: Internal data format inside GPU memory for color attachment texture.\n" " :type format: Literal['RGBA8', 'RGBA16', 'RGBA16F', 'RGBA32F']\n")

Detailed Description

This file defines the offscreen functionalities of the 'gpu' module used for off-screen OpenGL rendering.

  • Use bpygpu_ for local API.
  • Use BPyGPU for public API.

Definition in file gpu_py_offscreen.cc.

Macro Definition Documentation

◆ BPY_GPU_OFFSCREEN_CHECK_OBJ

#define BPY_GPU_OFFSCREEN_CHECK_OBJ ( bpygpu)

◆ BPYGPU_USE_GPUOBJ_FREE_METHOD