From 00efe024fd47aa2f73ebc172ef137606f2ebafc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 28 Dec 2023 14:39:54 +0100 Subject: [PATCH] Cleanup: Anim, document `ANIM_armature_bonecoll_move_to_index` more Just some added documentation for `ANIM_armature_bonecoll_move_to_index()`. No functional changes. --- source/blender/animrig/ANIM_bone_collections.hh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/blender/animrig/ANIM_bone_collections.hh b/source/blender/animrig/ANIM_bone_collections.hh index 1cf60b7d42d..2200342de97 100644 --- a/source/blender/animrig/ANIM_bone_collections.hh +++ b/source/blender/animrig/ANIM_bone_collections.hh @@ -143,11 +143,23 @@ bool ANIM_armature_bonecoll_is_editable(const struct bArmature *armature, const struct BoneCollection *bcoll); /** - * Moves the bone collection at from_index to to_index. + * Move the bone collection at from_index to its sibling at to_index. + * + * The element at `to_index` is shifted to make space; it is not overwritten. + * This shift happens towards `from_index`. + * + * This operation does not change the total number of elements in the array. * * \return true if the collection was successfully moved, false otherwise. * The latter happens if either index is out of bounds, or if the indices * are equal. + * \note This function ensures that the element at index `from_index` (before + * the call) will end up at `to_index` (after the call). The element at + * `to_index` before the call will shift towards `from_index`; in other words, + * depending on the direction of movement, the moved element will end up either + * before or after that one. + * + * TODO: add ASCII-art illustration of left & right movement. */ bool ANIM_armature_bonecoll_move_to_index(bArmature *armature, int from_index, int to_index);