Blender Git Loki

Git Commits -> Revision b23ae77

August 10, 2021, 01:35 (GMT)
Fix slicing with negative indices

Negative indices that remained negative after adding the sequence length
caused incorrect slicing.

With the default scene for example:

bpy.context.scene.objects[-4:2]

Gave a different result to:

tuple(bpy.context.scene.objects)[-4:2]

Clamp indices above zero so loops that step forward works as intended.

Commit Details:

Full Hash: b23ae77e2ee2b24019b42ff17e0e089a6f33a309
Parent Commit: bad999e
Committed By: YimingWu
Lines Changed: +10, -0

4 Modified Paths:

/source/blender/python/bmesh/bmesh_py_types.c (+2, -0) (Diff)
/source/blender/python/bmesh/bmesh_py_types_customdata.c (+2, -0) (Diff)
/source/blender/python/bmesh/bmesh_py_types_select.c (+2, -0) (Diff)
/source/blender/python/intern/bpy_rna.c (+4, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021