diff options
Diffstat (limited to 'source/blender/editors/object/object_shapekey.c')
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 2b6d69ca694..6a511d4d924 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -137,9 +137,11 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) } if (key->totkey == 0) { - if (GS(key->from->name) == ID_ME) ((Mesh *)key->from)->key = NULL; - else if (GS(key->from->name) == ID_CU) ((Curve *)key->from)->key = NULL; - else if (GS(key->from->name) == ID_LT) ((Lattice *)key->from)->key = NULL; + switch (GS(key->from->name)) { + case ID_ME: ((Mesh *)key->from)->key = NULL; break; + case ID_CU: ((Curve *)key->from)->key = NULL; break; + case ID_LT: ((Lattice *)key->from)->key = NULL; break; + } BKE_libblock_free_us(&(bmain->key), key); } |