Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-05 09:51:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-05 09:51:26 +0400
commitf4ccee2785f91efd4acceeae0713b93b7afaeccd (patch)
tree17dae274c05977b9b860cfe32c3fb3ce76f7a27e /source/blender/editors/object/object_shapekey.c
parent0aa6ade75a0004d00f769589ae24ef0b152bba9d (diff)
adding shape key blocks to absolute shape keys would not set the position (which is odd since its the only time they are used).
also re-sort the shape keys after adding them in for absolute keyblocks.
Diffstat (limited to 'source/blender/editors/object/object_shapekey.c')
-rw-r--r--source/blender/editors/object/object_shapekey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 40a7a9b6a92..98a7eca5068 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -76,9 +76,11 @@
static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int from_mix)
{
- if (object_insert_shape_key(scene, ob, NULL, from_mix)) {
+ KeyBlock *kb;
+ if ((kb = object_insert_shape_key(scene, ob, NULL, from_mix))) {
Key *key= ob_get_key(ob);
- ob->shapenr= BLI_countlist(&key->block);
+ /* for absolute shape keys, new keys may not be added last */
+ ob->shapenr = BLI_findindex(&key->block, kb) + 1;
WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
}