Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/intern/bmesh_mesh_conv.c
| Show First 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | for (currkey = me->key->block.first; currkey; currkey = currkey->next) { | ||||
| (bm->shapenr - 1 == currkey->relative)); | (bm->shapenr - 1 == currkey->relative)); | ||||
| int cd_shape_offset; | int cd_shape_offset; | ||||
| int keyi; | int keyi; | ||||
| const float(*ofs_pt)[3] = ofs; | const float(*ofs_pt)[3] = ofs; | ||||
| float *newkey, (*oldkey)[3], *fp; | float *newkey, (*oldkey)[3], *fp; | ||||
| j = bm_to_mesh_shape_layer_index_from_kb(bm, currkey); | j = bm_to_mesh_shape_layer_index_from_kb(bm, currkey); | ||||
| cd_shape_offset = CustomData_get_n_offset(&bm->vdata, CD_SHAPEKEY, j); | cd_shape_offset = CustomData_get_n_offset(&bm->vdata, CD_SHAPEKEY, j); | ||||
| if (cd_shape_offset < 0) { | |||||
| /* The target Mesh has more shapekeys than the BMesh. */ | |||||
| break; | |||||
brecht: Use `continue` instead. | |||||
sybrenAuthorUnsubmitted Done Inline ActionsWhy? Is it possible for a mesh to not have CD_SHAPEKEY with index j but to do have one with index j+1? Otherwise I don't see anything in this for-loop that should be called for every CD_SHAPEKEY layer in the target mesh. sybren: Why? Is it possible for a mesh to not have `CD_SHAPEKEY` with index `j` but to do have one with… | |||||
brechtUnsubmitted Done Inline Actionsj is computed by bm_to_mesh_shape_layer_index_from_kb. It's not obvious that it is monotonically increasing. Even if it is, relying on such assumptions is fragile. brecht: `j` is computed by `bm_to_mesh_shape_layer_index_from_kb`. It's not obvious that it is… | |||||
| } | |||||
| fp = newkey = MEM_callocN(me->key->elemsize * bm->totvert, "currkey->data"); | fp = newkey = MEM_callocN(me->key->elemsize * bm->totvert, "currkey->data"); | ||||
| oldkey = currkey->data; | oldkey = currkey->data; | ||||
| mvert = me->mvert; | mvert = me->mvert; | ||||
| BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { | BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) { | ||||
| if (currkey == actkey) { | if (currkey == actkey) { | ||||
| ▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines | |||||
Use continue instead.