diff options
author | Martijn Versteegh <martijn@aaltjegron.nl> | 2022-11-13 23:23:06 +0300 |
---|---|---|
committer | Martijn Versteegh <martijn@aaltjegron.nl> | 2022-11-13 23:23:28 +0300 |
commit | 673c70658573a40899dac7a23454f9aa76d054aa (patch) | |
tree | e3b880112552d4a1238a7c77d2573f1f573e07f6 | |
parent | ea4275a9bd3928f3fe25575944e7e1f33d41d556 (diff) |
Always ensure bool layers for pyhton api.refactor-mesh-uv-map-generic
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.
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types_customdata.c | 12 |
1 files 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); |