Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/mathutils/mathutils.c
| Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | int EXPP_VectorsAreEqual(const float *vecA, const float *vecB, int size, int floatSteps) | ||||
| for (x = 0; x < size; x++) { | for (x = 0; x < size; x++) { | ||||
| if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) | if (EXPP_FloatsAreEqual(vecA[x], vecB[x], floatSteps) == 0) | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| #ifndef MATH_STANDALONE | #ifndef MATH_STANDALONE | ||||
| /* dynstr as python string utility funcions, frees 'ds'! */ | /* dynstr as python string utility functions, frees 'ds'! */ | ||||
| PyObject *mathutils_dynstr_to_py(struct DynStr *ds) | PyObject *mathutils_dynstr_to_py(struct DynStr *ds) | ||||
| { | { | ||||
| const int ds_len = BLI_dynstr_get_len(ds); /* space for \0 */ | const int ds_len = BLI_dynstr_get_len(ds); /* space for \0 */ | ||||
| char *ds_buf = PyMem_Malloc(ds_len + 1); | char *ds_buf = PyMem_Malloc(ds_len + 1); | ||||
| PyObject *ret; | PyObject *ret; | ||||
| BLI_dynstr_get_cstring_ex(ds, ds_buf); | BLI_dynstr_get_cstring_ex(ds, ds_buf); | ||||
| BLI_dynstr_free(ds); | BLI_dynstr_free(ds); | ||||
| ret = PyUnicode_FromStringAndSize(ds_buf, ds_len); | ret = PyUnicode_FromStringAndSize(ds_buf, ds_len); | ||||
| ▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines | |||||