Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/generic/py_capi_utils.c
| Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| PyObject *tuple = PyTuple_New(len); | PyObject *tuple = PyTuple_New(len); | ||||
| for (uint i = 0; i < len; i++) { | for (uint i = 0; i < len; i++) { | ||||
| PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array[i])); | PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array[i])); | ||||
| } | } | ||||
| return tuple; | return tuple; | ||||
| } | } | ||||
| PyObject *PyC_Tuple_PackArray_F64(const double *array, uint len) | |||||
| { | |||||
| PyObject *tuple = PyTuple_New(len); | |||||
| for (uint i = 0; i < len; i++) { | |||||
| PyTuple_SET_ITEM(tuple, i, PyFloat_FromDouble(array[i])); | |||||
| } | |||||
| return tuple; | |||||
| } | |||||
| PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len) | PyObject *PyC_Tuple_PackArray_I32(const int *array, uint len) | ||||
| { | { | ||||
| PyObject *tuple = PyTuple_New(len); | PyObject *tuple = PyTuple_New(len); | ||||
| for (uint i = 0; i < len; i++) { | for (uint i = 0; i < len; i++) { | ||||
| PyTuple_SET_ITEM(tuple, i, PyLong_FromLong(array[i])); | PyTuple_SET_ITEM(tuple, i, PyLong_FromLong(array[i])); | ||||
| } | } | ||||
| return tuple; | return tuple; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,107 Lines • Show Last 20 Lines | |||||