Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2018-11-13 14:59:50 +0300
committerJacques Lucke <mail@jlucke.com>2018-11-13 15:00:18 +0300
commit6ae84ddc6e7c40d89896c3c5a4f7c67dceb586d5 (patch)
tree503050f28aad6ec65041a07750a22430c2060ac4 /source/blender/python/gpu/gpu_py_batch.c
parentde36a2f99b344b35aef580cd711e36bd5045127a (diff)
Py API Docs: GPUBatch documentation
Diffstat (limited to 'source/blender/python/gpu/gpu_py_batch.c')
-rw-r--r--source/blender/python/gpu/gpu_py_batch.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index b3bdf663621..add813dd928 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -130,7 +130,16 @@ static PyObject *bpygpu_Batch_new(PyTypeObject *UNUSED(type), PyObject *args, Py
}
PyDoc_STRVAR(bpygpu_Batch_vertbuf_add_doc,
-"TODO"
+".. method:: vertbuf_add(buf)\n"
+"\n"
+" Add another vertex buffer to the Batch. \n"
+" It is not possible to add more vertices to the batch using this method. \n"
+" Instead it can be used to add more attributes to the existing vertices. \n"
+" A good use case would be when you have a separate vertex buffer for vertex positions and vertex normals. \n"
+" Current a batch can have at most " STRINGIFY(GPU_BATCH_VBO_MAX_LEN) " vertex buffers. \n"
+"\n"
+" :param buf: The vertex buffer that will be added to the batch. \n"
+" :type buf: :class:`gpu.types.GPUVertBuf` \n"
);
static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_buf)
{
@@ -165,7 +174,14 @@ static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_b
}
PyDoc_STRVAR(bpygpu_Batch_program_set_doc,
-"TODO"
+".. method:: program_set(program)\n"
+"\n"
+" Assign a shader to this batch that will be used for drawing when not overwritten later. \n"
+" Note: This method has to be called in the draw context that the batch will be drawn in. \n"
+" This function does not need to be called when you always set the shader when calling `batch.draw`. \n"
+"\n"
+" :param program: The program/shader the batch will use in future draw calls. \n"
+" :type program: :class:`gpu.types.GPUShader` \n"
);
static PyObject *bpygpu_Batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader)
{
@@ -307,21 +323,21 @@ PyDoc_STRVAR(py_gpu_batch_doc,
"Contains VAOs + VBOs + Shader representing a drawable entity."
"\n"
" :param type: One of these primitive types: {\n"
-" 'POINTS',\n"
-" 'LINES',\n"
-" 'TRIS',\n"
-" 'LINE_STRIP',\n"
-" 'LINE_LOOP',\n"
-" 'TRI_STRIP',\n"
-" 'TRI_FAN',\n"
-" 'LINES_ADJ',\n"
-" 'TRIS_ADJ',\n"
-" 'LINE_STRIP_ADJ'}\n"
-" :type type: `str`\n"
-" :param buf: Vertex buffer.\n"
-" :type buf: :class: `gpu.types.GPUVertBuf`\n"
-" :param elem: Optional Index buffer.\n"
-" :type elem: :class: `gpu.types.GPUIndexBuf`\n"
+" `POINTS`,\n"
+" `LINES`,\n"
+" `TRIS`,\n"
+" `LINE_STRIP`,\n"
+" `LINE_LOOP`,\n"
+" `TRI_STRIP`,\n"
+" `TRI_FAN`,\n"
+" `LINES_ADJ`,\n"
+" `TRIS_ADJ`,\n"
+" `LINE_STRIP_ADJ` }\n"
+" :type type: :class:`str`\n"
+" :param buf: Vertex buffer containing all or some of the attributes required for drawing.\n"
+" :type buf: :class:`gpu.types.GPUVertBuf`\n"
+" :param elem: Optional index buffer.\n"
+" :type elem: :class:`gpu.types.GPUIndexBuf`\n"
);
PyTypeObject BPyGPUBatch_Type = {
PyVarObject_HEAD_INIT(NULL, 0)