Python API: Expose background drawing as argument for gpu.types.GPUOffScreen.draw_view3d() #105748
|
@ -285,7 +285,7 @@ static PyObject *pygpu_offscreen_texture_color_get(BPyGPUOffScreen *self, void *
|
|||
PyDoc_STRVAR(
|
||||
pygpu_offscreen_draw_view3d_doc,
|
||||
".. method:: draw_view3d(scene, view_layer, view3d, region, view_matrix, projection_matrix, "
|
||||
"do_color_management=False)\n"
|
||||
"do_color_management=False, draw_background=True)\n"
|
||||
"\n"
|
||||
" Draw the 3d viewport in the offscreen object.\n"
|
||||
"\n"
|
||||
|
@ -302,7 +302,9 @@ PyDoc_STRVAR(
|
|||
" :arg projection_matrix: Projection Matrix (e.g. ``camera.calc_matrix_camera(...)``).\n"
|
||||
" :type projection_matrix: :class:`mathutils.Matrix`\n"
|
||||
" :arg do_color_management: Color manage the output.\n"
|
||||
" :type do_color_management: bool\n");
|
||||
" :type do_color_management: bool\n"
|
||||
" :arg draw_background: Draw background.\n"
|
||||
|
||||
" :type draw_background: bool\n");
|
||||
static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
MatrixObject *py_mat_view, *py_mat_projection;
|
||||
|
@ -315,6 +317,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
|
|||
ARegion *region;
|
||||
|
||||
bool do_color_management = false;
|
||||
bool draw_background = true;
|
||||
|
||||
BPY_GPU_OFFSCREEN_CHECK_OBJ(self);
|
||||
|
||||
|
@ -326,6 +329,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
|
|||
"view_matrix",
|
||||
"projection_matrix",
|
||||
"do_color_management",
|
||||
"draw_background",
|
||||
NULL,
|
||||
};
|
||||
static _PyArg_Parser _parser = {
|
||||
|
@ -337,6 +341,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
|
|||
"O&" /* `projection_matrix` */
|
||||
"|$" /* Optional keyword only arguments. */
|
||||
"O&" /* `do_color_management` */
|
||||
"O&" /* `draw_background` */
|
||||
":draw_view3d",
|
||||
_keywords,
|
||||
0,
|
||||
|
@ -353,7 +358,9 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
|
|||
Matrix_Parse4x4,
|
||||
&py_mat_projection,
|
||||
PyC_ParseBool,
|
||||
&do_color_management) ||
|
||||
&do_color_management,
|
||||
PyC_ParseBool,
|
||||
&draw_background) ||
|
||||
(!(scene = PyC_RNA_AsPointer(py_scene, "Scene")) ||
|
||||
!(view_layer = PyC_RNA_AsPointer(py_view_layer, "ViewLayer")) ||
|
||||
!(v3d = PyC_RNA_AsPointer(py_view3d, "SpaceView3D")) ||
|
||||
|
@ -392,7 +399,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar
|
|||
(const float(*)[4])py_mat_view->matrix,
|
||||
(const float(*)[4])py_mat_projection->matrix,
|
||||
true,
|
||||
true,
|
||||
draw_background,
|
||||
"",
|
||||
do_color_management,
|
||||
true,
|
||||
|
|
Loading…
Reference in New Issue
This description is not adding much.