From b7f5ab0cd33bc7632bd71af5f883745e340d6e18 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 16 Nov 2014 21:45:40 +0100 Subject: ShapeKeys: Add `BKE_keyblock_is_basis` to check whether a given keyblock is used a basis by others. Also fix stupid debug-only error in previous commit. --- source/blender/bmesh/intern/bmesh_mesh_conv.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source/blender/bmesh/intern/bmesh_mesh_conv.c') diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index 8c96cc9addf..3630bb78b8a 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -850,15 +850,7 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface) * bmesh and the mesh are out of sync */ (oldverts != NULL)) /* not used here, but 'oldverts' is used later for applying 'ofs' */ { - bool act_is_basis = false; - - /* find if this key is a basis for any others */ - for (currkey = me->key->block.first; currkey; currkey = currkey->next) { - if (bm->shapenr - 1 == currkey->relative) { - act_is_basis = true; - break; - } - } + const bool act_is_basis = BKE_keyblock_is_basis(me->key, bm->shapenr - 1); /* active key is a base */ if (act_is_basis && (cd_shape_keyindex_offset != -1)) { -- cgit v1.2.3