From 00ff9da2eecd7a0edeca60c03e1b5e7ddabf2226 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 21 Oct 2014 11:59:14 +0200 Subject: ShapeKeys: rework 'move skey' code, and add options to move to first/last position. Main moving logic is moved to new `BKE_keyblock_move()`, which makes it available from anywhere. In addition, move code was reworked so that it only loops once on whole keyblocks list, and it accepts arbitrary org and dest indices, not only neighbor ones. Partly based on work by revzin (Grigory Revzin) in his soc-2014-shapekey GSoC branch, thanks! --- source/blender/blenkernel/BKE_key.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/BKE_key.h') diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index 6183df8666d..892c42b4588 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -97,6 +97,10 @@ float (*BKE_key_convert_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]; void BKE_key_convert_from_vertcos(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); void BKE_key_convert_from_offset(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]); +/* other management */ +bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index); + + /* key.c */ extern int slurph_opt; -- cgit v1.2.3