Dyntopo: Solve issue with test file by Jens.
Seems like custom data indices can be mangled when many layers are present in the mesh, so use more strict calculation of offset (copied over from BM_CD_LAYER_ID). I was under the impression that all custom data would be deleted on entering dyntopo, it seems this is not the case though.
This commit is contained in:
@@ -4805,7 +4805,8 @@ void sculpt_dyntopo_node_layers_add(SculptSession *ss)
|
||||
cd_node_layer_index = CustomData_get_named_layer_index(&ss->bm->vdata, CD_PROP_INT, layer_id);
|
||||
}
|
||||
|
||||
ss->cd_vert_node_offset = CustomData_get_n_offset(&ss->bm->vdata, CD_PROP_INT, cd_node_layer_index);
|
||||
ss->cd_vert_node_offset = CustomData_get_n_offset(&ss->bm->vdata, CD_PROP_INT,
|
||||
cd_node_layer_index - CustomData_get_layer_index(&ss->bm->vdata, CD_PROP_INT));
|
||||
|
||||
ss->bm->vdata.layers[cd_node_layer_index].flag |= CD_FLAG_TEMPORARY;
|
||||
|
||||
@@ -4815,7 +4816,8 @@ void sculpt_dyntopo_node_layers_add(SculptSession *ss)
|
||||
cd_node_layer_index = CustomData_get_named_layer_index(&ss->bm->pdata, CD_PROP_INT, layer_id);
|
||||
}
|
||||
|
||||
ss->cd_face_node_offset = CustomData_get_n_offset(&ss->bm->pdata, CD_PROP_INT, cd_node_layer_index);
|
||||
ss->cd_face_node_offset = CustomData_get_n_offset(&ss->bm->pdata, CD_PROP_INT,
|
||||
cd_node_layer_index - CustomData_get_layer_index(&ss->bm->pdata, CD_PROP_INT));
|
||||
|
||||
ss->bm->pdata.layers[cd_node_layer_index].flag |= CD_FLAG_TEMPORARY;
|
||||
}
|
||||
|
Reference in New Issue
Block a user