diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-04-21 13:39:09 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-04-22 16:25:11 +0300 |
commit | 5179b8236ba84e50d26485a17df6b17d8e581477 (patch) | |
tree | bd5340e3f52374d3fdec973cd9ae0ccc5a3a8e7e /source/blender/blenkernel/intern/data_transfer.c | |
parent | 048c769774ac7f2be32ecb354f0416bd13b632e6 (diff) |
Fix accessing attribute data in editmode
When in mesh editmode, attributes point to bmesh customdata, the
attribute data is empty since custom data is stored per element instead
of a single array there (same es UVs etc.).
Opposed to e.g. UVs, general attributes were not setting their data
length/size to zero in case of editmode though, which could lead to
- crash in Outliner Data Api view [that was reported in T95922]
- RuntimeError such as the following:
```
RuntimeError: bpy_prop_collection[index]: internal error, valid index 0
given in 8 sized collection, but value not found
```
Now check for mesh editmode in `BKE_id_attribute_data_length` (and
return zero in that case).
Alternatively, the check could also be done in
`rna_Attribute_data_length` only (such as UVs do in
`rna_MeshUVLoopLayer_data_length`).
Ref D11998
Fixes T95922
Maniphest Tasks: T95922
Differential Revision: https://developer.blender.org/D14714
Diffstat (limited to 'source/blender/blenkernel/intern/data_transfer.c')
0 files changed, 0 insertions, 0 deletions