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:
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/gpu/gpu_py_batch.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index c6acbcb0308..54574bda1f4 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -185,7 +185,13 @@ static PyObject *bpygpu_VertBatch_draw(BPyGPUBatch *self, PyObject *args)
{
return NULL;
}
-
+ else if (py_program == NULL) {
+ if (!glIsProgram(self->batch->program)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "batch does not have any program assigned to it");
+ return NULL;
+ }
+ }
else if (self->batch->program != GPU_shader_get_program(py_program->shader)) {
GPU_batch_program_set(self->batch,
GPU_shader_get_program(py_program->shader),
@@ -199,8 +205,8 @@ static PyObject *bpygpu_VertBatch_draw(BPyGPUBatch *self, PyObject *args)
static PyObject *bpygpu_VertBatch_program_use_begin(BPyGPUBatch *self)
{
if (!glIsProgram(self->batch->program)) {
- PyErr_SetString(PyExc_ValueError,
- "batch program has not not set");
+ PyErr_SetString(PyExc_RuntimeError,
+ "batch does not have any program assigned to it");
}
GPU_batch_program_use_begin(self->batch);
Py_RETURN_NONE;
@@ -209,8 +215,8 @@ static PyObject *bpygpu_VertBatch_program_use_begin(BPyGPUBatch *self)
static PyObject *bpygpu_VertBatch_program_use_end(BPyGPUBatch *self)
{
if (!glIsProgram(self->batch->program)) {
- PyErr_SetString(PyExc_ValueError,
- "batch program has not not set");
+ PyErr_SetString(PyExc_RuntimeError,
+ "batch does not have any program assigned to it");
}
GPU_batch_program_use_end(self->batch);
Py_RETURN_NONE;