Fix #121666: Modifying UVs of duplicate affects the original object

Caused by 7eee378ecc.

Since the implicit sharing commit, uv data was not unshared when
accessed. Fix along the ines of 34b4487844 (same downside of not being
able to tell if the data is just read -- or written to).

Pull Request: https://projects.blender.org/blender/blender/pulls/121786
This commit is contained in:
Philipp Oeser
2024-05-15 15:23:26 +02:00
committed by Philipp Oeser
parent 8e6b276f84
commit 710d168e30

View File

@@ -941,10 +941,12 @@ static void rna_MeshUVLoopLayer_data_begin(CollectionPropertyIterator *iter, Poi
{
Mesh *mesh = rna_mesh(ptr);
CustomDataLayer *layer = (CustomDataLayer *)ptr->data;
const int length = (mesh->runtime->edit_mesh) ? 0 : mesh->corners_num;
CustomData_ensure_data_is_mutable(layer, length);
rna_iterator_array_begin(iter,
layer->data,
sizeof(float[2]),
(mesh->runtime->edit_mesh) ? 0 : mesh->corners_num,
length,
0,
nullptr);
}