[Bf-blender-cvs] [0b6d7bab5a1] master: Cleanup: remove redundant indexing value
Campbell Barton
noreply at git.blender.org
Tue Sep 15 05:33:45 CEST 2020
Commit: 0b6d7bab5a148b316a9067e30cda9155af331777
Author: Campbell Barton
Date: Tue Sep 15 13:09:49 2020 +1000
Branches: master
https://developer.blender.org/rB0b6d7bab5a148b316a9067e30cda9155af331777
Cleanup: remove redundant indexing value
===================================================================
M source/blender/bmesh/intern/bmesh_mesh_convert.c
===================================================================
diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.c b/source/blender/bmesh/intern/bmesh_mesh_convert.c
index 2269837cc8e..e30a0ca984a 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_convert.c
+++ b/source/blender/bmesh/intern/bmesh_mesh_convert.c
@@ -829,7 +829,6 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh
/* Go through and find any shape-key custom-data layers
* that might not have corresponding KeyBlocks, and add them if necessary. */
- j = 0;
for (i = 0; i < bm->vdata.totlayer; i++) {
if (bm->vdata.layers[i].type != CD_SHAPEKEY) {
continue;
@@ -845,8 +844,6 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh
currkey = BKE_keyblock_add(me->key, bm->vdata.layers[i].name);
currkey->uid = bm->vdata.layers[i].uid;
}
-
- j++;
}
/* Editing the base key should update others. */
@@ -897,8 +894,8 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh
const float(*ofs_pt)[3] = ofs;
float *newkey, (*oldkey)[3], *fp;
- j = bm_to_mesh_shape_layer_index_from_kb(bm, currkey);
- const int cd_shape_offset = CustomData_get_n_offset(&bm->vdata, CD_SHAPEKEY, j);
+ const int currkey_uuid = bm_to_mesh_shape_layer_index_from_kb(bm, currkey);
+ const int cd_shape_offset = CustomData_get_n_offset(&bm->vdata, CD_SHAPEKEY, currkey_uuid);
const bool apply_offset = (cd_shape_offset != -1) && (ofs != NULL) && (currkey != actkey) &&
(bm->shapenr - 1 == currkey->relative);
More information about the Bf-blender-cvs
mailing list