MCPcopy Create free account
hub / github.com/blender/blender / mathutils_array_parse_fast

Function mathutils_array_parse_fast

source/blender/python/mathutils/mathutils.cc:43–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 "- :class:`Vector`,\n");
42
43static int mathutils_array_parse_fast(float *array,
44 int size,
45 PyObject *value_fast,
46 const char *error_prefix)
47{
48 PyObject *item;
49 PyObject **value_fast_items = PySequence_Fast_ITEMS(value_fast);
50
51 int i;
52
53 i = size;
54 do {
55 i--;
56 if (((array[i] = PyFloat_AsDouble(item = value_fast_items[i])) == -1.0f) && PyErr_Occurred()) {
57 PyErr_Format(PyExc_TypeError,
58 "%.200s: sequence index %d expected a number, "
59 "found '%.200s' type, ",
60 error_prefix,
61 i,
62 Py_TYPE(item)->tp_name);
63 size = -1;
64 break;
65 }
66 } while (i);
67
68 return size;
69}
70
71Py_hash_t mathutils_array_hash(const float *array, size_t array_len)
72{

Callers 2

mathutils_array_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected