From 065d19e223bd1a9ceec139ac32a4436c3cf3ec2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 26 Oct 2018 11:59:49 +1100 Subject: [PATCH] Fix parsing single int for uniform_int This worked for float but not int. --- source/blender/python/gpu/gpu_py_shader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index f62e9b775b1..bc3aea91166 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -518,7 +518,12 @@ static PyObject *bpygpu_shader_uniform_int( int values[4]; int length; int ret; - { + + if (PyLong_Check(params.seq)) { + values[0] = PyC_Long_AsI32(params.seq); + length = 1; + } + else { PyObject *seq_fast = PySequence_Fast(params.seq, error_prefix); if (seq_fast == NULL) { PyErr_Format(PyExc_TypeError,