diff options
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 3fe8c86ef5c..fb9687da6df 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -120,9 +120,16 @@ static bool ED_object_shape_key_remove(Main *bmain, Object *ob) kb = BLI_findlink(&key->block, ob->shapenr - 1); if (kb) { - for (rkb = key->block.first; rkb; rkb = rkb->next) - if (rkb->relative == ob->shapenr - 1) + for (rkb = key->block.first; rkb; rkb = rkb->next) { + if (rkb->relative == ob->shapenr - 1) { + /* remap to the 'Basis' */ rkb->relative = 0; + } + else if (rkb->relative >= ob->shapenr) { + /* Fix positional shift of the keys when kb is deleted from the list */ + rkb->relative -= 1; + } + } BLI_remlink(&key->block, kb); key->totkey--; |