Fix #120861: BMFace.copy_from_face_interp looses reference

Remove call to BM_elem_attrs_copy in face interpolation function.
This was copying custom-data which cleared the faces CD_BM_ELEM_PYPTR,
making the Python objects behave as if it was removed.

While the issue could also be fixed by skipping the PYPTR layer,
copying attributes such as the material & normal in a face-data
interpolation function isn't correct. In cases where this is needed,
it's better the caller handles copying attributes.
This commit is contained in:
Campbell Barton 2024-09-03 20:39:09 +10:00 • committed by Philipp Oeser
parent 8b18e57921
commit d460fbae60
2 changed files with 2 additions and 4 deletions

View file

@ -150,10 +150,6 @@ void BM_face_interp_from_face_ex(BMesh *bm,
float *w = BLI_array_alloca(w, f_src->len);
float co[2];
if (f_src != f_dst) {
BM_elem_attrs_copy(bm, bm, f_src, f_dst);
}
/* interpolate */
l_iter = l_first = BM_FACE_FIRST_LOOP(f_dst);
do {

View file

@ -88,6 +88,8 @@ void BM_elem_float_data_set(CustomData *cd, void *element, int type, float val);
* Projects target onto source, and pulls interpolated custom-data from source.
*
* \note Only handles loop custom-data. multi-res is handled.
* \note Attributes such as selection, material & normals
* must be handled with a separate call to #BM_elem_attrs_copy.
*/
void BM_face_interp_from_face_ex(BMesh *bm,
BMFace *f_dst,