Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-02-03 18:52:16 +0300
committerJacques Lucke <jacques@blender.org>2022-02-03 18:52:16 +0300
commit4be87e97f48533e16594b6ec73980ffb2ba12ade (patch)
tree03d0199a32288f20c766b010ee815bf8163733d8 /source/blender/blenkernel/intern/customdata.cc
parent946c70e6a7892985289bf8dfaead8512d33eba79 (diff)
Fix T94435: remove anonymous attributes when applying modifier
Differential Revision: https://developer.blender.org/D13994
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.cc')
-rw-r--r--source/blender/blenkernel/intern/customdata.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc
index 02b50027ef9..e4c18325d76 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -2780,6 +2780,24 @@ void CustomData_free_layers(CustomData *data, int type, int totelem)
}
}
+void CustomData_free_layers_anonymous(struct CustomData *data, int totelem)
+{
+ while (true) {
+ bool found_anonymous_layer = false;
+ for (int i = 0; i < data->totlayer; i++) {
+ const CustomDataLayer *layer = &data->layers[i];
+ if (layer->anonymous_id != NULL) {
+ CustomData_free_layer(data, layer->type, totelem, i);
+ found_anonymous_layer = true;
+ break;
+ }
+ }
+ if (!found_anonymous_layer) {
+ break;
+ }
+ }
+}
+
bool CustomData_has_layer(const CustomData *data, int type)
{
return (CustomData_get_layer_index(data, type) != -1);