diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c index 8fbbf1be12a..4123547da51 100644 --- a/source/blender/python/gpu/gpu_py_batch.c +++ b/source/blender/python/gpu/gpu_py_batch.c @@ -174,6 +174,12 @@ PyDoc_STRVAR( " :type program: :class:`gpu.types.GPUShader`\n"); static PyObject *pygpu_batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader) { + + PyErr_WarnEx(PyExc_DeprecationWarning, + "calls to 'gpu.types.GPUBatch.program_set' is deprecated'", + 1); + + if (!BPyGPUShader_Check(py_shader)) { PyErr_Format(PyExc_TypeError, "Expected a GPUShader, got %s", Py_TYPE(py_shader)->tp_name); return NULL; @@ -227,6 +233,13 @@ static PyObject *pygpu_batch_draw(BPyGPUBatch *self, PyObject *args) GPU_batch_set_shader(self->batch, py_program->shader); } + if(args<2 || self<2) + { + PyErr_WarnEx(PyExc_DeprecationWarning, + "'GPU BATCH' program is deprecated. Please add a valid program parameter ", + 1); + } + GPU_batch_draw(self->batch); Py_RETURN_NONE; } @@ -334,7 +347,7 @@ PyTypeObject BPyGPUBatch_Type = { PyObject *BPyGPUBatch_CreatePyObject(GPUBatch *batch) { BPyGPUBatch *self; - + #ifdef USE_GPU_PY_REFERENCES self = (BPyGPUBatch *)_PyObject_GC_New(&BPyGPUBatch_Type); self->references = NULL;