diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-11 16:09:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-11 16:40:58 +0300 |
commit | 196dfc01a3e99c3bef0e44acf599bca50ae0300e (patch) | |
tree | 5d1b42a947e5f339b0a79e5f8d7a4617128d907a /source/blender/blenkernel/intern/customdata.c | |
parent | b20872d36ebcf8777b8a6970425ebbdd81eac29d (diff) |
Fix T84114: Existence of vertex groups slows down mesh editing
Having a vertex group in a mesh slowed down unrelated operations
such as selection.
De-duplicating custom-data arrays for layers that contain pointers
can become slow without any benefit as the content never matches.
Use full copies when storing custom-data for edit-mesh undo.
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index b0994fb683a..1121df0d568 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -4291,6 +4291,18 @@ bool CustomData_layertype_is_singleton(int type) } /** + * Has dynamically allocated members. + * This is useful to know if operations such as #memcmp are + * valid when comparing data from two layers. + */ +bool CustomData_layertype_is_dynamic(int type) +{ + const LayerTypeInfo *typeInfo = layerType_getInfo(type); + + return (typeInfo->free != NULL); +} + +/** * \return Maximum number of layers of given \a type, -1 means 'no limit'. */ int CustomData_layertype_layers_max(const int type) |