Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_rna_array.c
| Show First 20 Lines • Show All 921 Lines • ▼ Show 20 Lines | PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, | ||||
| BPy_PropertyArrayRNA *ret = NULL; | BPy_PropertyArrayRNA *ret = NULL; | ||||
| arraydim = self ? self->arraydim : 0; | arraydim = self ? self->arraydim : 0; | ||||
| arrayoffset = self ? self->arrayoffset : 0; | arrayoffset = self ? self->arrayoffset : 0; | ||||
| /* just in case check */ | /* just in case check */ | ||||
| len = RNA_property_multi_array_length(ptr, prop, arraydim); | len = RNA_property_multi_array_length(ptr, prop, arraydim); | ||||
| if (index >= len || index < 0) { | if (index >= len || index < 0) { | ||||
| /* this shouldn't happen because higher level funcs must check for invalid index */ | /* This shouldn't happen because higher level functions must check for invalid index. */ | ||||
| CLOG_WARN(BPY_LOG_RNA, "invalid index %d for array with length=%d", index, len); | CLOG_WARN(BPY_LOG_RNA, "invalid index %d for array with length=%d", index, len); | ||||
| PyErr_SetString(PyExc_IndexError, "out of range"); | PyErr_SetString(PyExc_IndexError, "out of range"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| totdim = RNA_property_array_dimension(ptr, prop, dimsize); | totdim = RNA_property_array_dimension(ptr, prop, dimsize); | ||||
| ▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines | |||||