[Bf-blender-cvs] [2838a7646be] blender2.8: _gawain python module: Add methods "program_use_begin" and "program_use_end"

Germano noreply at git.blender.org
Fri Dec 1 07:25:56 CET 2017


Commit: 2838a7646be89ebd64db886cfe6d3bc5275f6463
Author: Germano
Date:   Fri Dec 1 04:25:47 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB2838a7646be89ebd64db886cfe6d3bc5275f6463

_gawain python module: Add methods "program_use_begin" and "program_use_end"

Required to updade uniforms

===================================================================

M	source/blender/python/gawain/gwn_py_types.c

===================================================================

diff --git a/source/blender/python/gawain/gwn_py_types.c b/source/blender/python/gawain/gwn_py_types.c
index cc448d9ed90..5b602e85a12 100644
--- a/source/blender/python/gawain/gwn_py_types.c
+++ b/source/blender/python/gawain/gwn_py_types.c
@@ -671,6 +671,26 @@ static PyObject *bpygwn_VertBatch_draw(BPyGwn_Batch *self)
 	Py_RETURN_NONE;
 }
 
+static PyObject *bpygwn_VertBatch_program_use_begin(BPyGwn_Batch *self)
+{
+	if (!glIsProgram(self->batch->program)) {
+		PyErr_SetString(PyExc_ValueError,
+		                "batch program has not not set");
+	}
+	GWN_batch_program_use_begin(self->batch);
+	Py_RETURN_NONE;
+}
+
+static PyObject *bpygwn_VertBatch_program_use_end(BPyGwn_Batch *self)
+{
+	if (!glIsProgram(self->batch->program)) {
+		PyErr_SetString(PyExc_ValueError,
+		                "batch program has not not set");
+	}
+	GWN_batch_program_use_end(self->batch);
+	Py_RETURN_NONE;
+}
+
 static struct PyMethodDef bpygwn_VertBatch_methods[] = {
 	{"vertbuf_add", (PyCFunction)bpygwn_VertBatch_vertbuf_add,
 	 METH_O, bpygwn_VertBatch_vertbuf_add_doc},
@@ -684,6 +704,10 @@ static struct PyMethodDef bpygwn_VertBatch_methods[] = {
 	  METH_VARARGS, NULL},
 	{"draw", (PyCFunction) bpygwn_VertBatch_draw,
 	 METH_NOARGS, bpygwn_VertBatch_draw_doc},
+	{"program_use_begin", (PyCFunction)bpygwn_VertBatch_program_use_begin,
+	 METH_NOARGS, ""},
+	{"program_use_end", (PyCFunction)bpygwn_VertBatch_program_use_end,
+	 METH_NOARGS, ""},
 	{NULL, NULL, 0, NULL}
 };



More information about the Bf-blender-cvs mailing list