GPUShader: shader.uniform_float parameters

Allow to pass in single numbers, sequences and mathutils.* types into `shader.uniform_float`.

Reviewers: mano-wii

Differential Revision: https://developer.blender.org/D3820
This commit is contained in:
2018-10-23 10:17:38 +02:00
parent 13cfb641c6
commit fc3d771801
2 changed files with 22 additions and 32 deletions

View File

@@ -136,7 +136,9 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
if ((size = VectorObject_Check(value) ? ((VectorObject *)value)->size : 0) ||
(size = EulerObject_Check(value) ? 3 : 0) ||
(size = QuaternionObject_Check(value) ? 4 : 0) ||
(size = ColorObject_Check(value) ? 3 : 0))
(size = ColorObject_Check(value) ? 3 : 0) ||
(size = MatrixObject_Check(value) ? ((MatrixObject *)value)->num_col
* ((MatrixObject *)value)->num_row : 0))
{
if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
return -1;