Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/bmesh/bmesh_py_types_customdata.c
| Show First 20 Lines • Show All 837 Lines • ▼ Show 20 Lines | if (key_slice->stop != Py_None && !_PyEval_SliceIndex(key_slice->stop, &stop)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (start < 0 || stop < 0) { | if (start < 0 || stop < 0) { | ||||
| /* only get the length for negative values */ | /* only get the length for negative values */ | ||||
| const Py_ssize_t len = bpy_bmlayercollection_length(self); | const Py_ssize_t len = bpy_bmlayercollection_length(self); | ||||
| if (start < 0) { | if (start < 0) { | ||||
| start += len; | start += len; | ||||
| CLAMP_MIN(start, 0); | |||||
| } | } | ||||
| if (stop < 0) { | if (stop < 0) { | ||||
| stop += len; | stop += len; | ||||
| CLAMP_MIN(stop, 0); | |||||
| } | } | ||||
| } | } | ||||
| if (stop - start <= 0) { | if (stop - start <= 0) { | ||||
| return PyTuple_New(0); | return PyTuple_New(0); | ||||
| } | } | ||||
| return bpy_bmlayercollection_subscript_slice(self, start, stop); | return bpy_bmlayercollection_subscript_slice(self, start, stop); | ||||
| ▲ Show 20 Lines • Show All 450 Lines • Show Last 20 Lines | |||||