From 673c70658573a40899dac7a23454f9aa76d054aa Mon Sep 17 00:00:00 2001 From: Martijn Versteegh Date: Sun, 13 Nov 2022 21:23:06 +0100 Subject: Always ensure bool layers for pyhton api. When verifying a uv layer from the pytho api, always ensure the associated bool layers. We can't lazily allocate them because allocating CustomData layers on a BMesh reallocates layers thereby invalidating existing python objects. --- source/blender/python/bmesh/bmesh_py_types_customdata.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 10ae6a33435..f6e9a6864d8 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -465,13 +465,13 @@ static PyObject *bpy_bmlayercollection_verify(BPy_BMLayerCollection *self) * in Py objects we can't lazily add the associated bool layers. So add them all right * now. */ - if (self->type == CD_PROP_FLOAT2 && self->htype == BM_LOOP) { - const char *active_uv_name = CustomData_get_active_layer_name(&self->bm->ldata, + } + if (self->type == CD_PROP_FLOAT2 && self->htype == BM_LOOP) { + const char *active_uv_name = CustomData_get_active_layer_name(&self->bm->ldata, CD_PROP_FLOAT2); - BM_uv_map_ensure_vert_selection_attribute(self->bm, active_uv_name); - BM_uv_map_ensure_edge_selection_attribute(self->bm, active_uv_name); - BM_uv_map_ensure_pin_attribute(self->bm, active_uv_name); - } + BM_uv_map_ensure_vert_selection_attribute(self->bm, active_uv_name); + BM_uv_map_ensure_edge_selection_attribute(self->bm, active_uv_name); + BM_uv_map_ensure_pin_attribute(self->bm, active_uv_name); } BLI_assert(index >= 0); -- cgit v1.2.3