[Bf-blender-cvs] [065d19e223b] blender2.8: Fix parsing single int for uniform_int
Campbell Barton
noreply at git.blender.org
Fri Oct 26 03:13:47 CEST 2018
Commit: 065d19e223bd1a9ceec139ac32a4436c3cf3ec2e
Author: Campbell Barton
Date: Fri Oct 26 11:59:49 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB065d19e223bd1a9ceec139ac32a4436c3cf3ec2e
Fix parsing single int for uniform_int
This worked for float but not int.
===================================================================
M source/blender/python/gpu/gpu_py_shader.c
===================================================================
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,
More information about the Bf-blender-cvs
mailing list