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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-02-28 20:03:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-28 22:47:50 +0300
commitf95f1a47b4dcf3ce2a41362eb1f1655b9e6f545a (patch)
tree549cd99e26de2a1758d2b5fe108bf992073772c9 /source/blender/blenkernel/intern/customdata.c
parent3b3b86f62a3c1a6b7d778f00591411c8b1dede0f (diff)
CustomData: add function to clear layers' flags.
We only had one to set those flags, up til now...
Diffstat (limited to 'source/blender/blenkernel/intern/customdata.c')
-rw-r--r--source/blender/blenkernel/intern/customdata.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index fb7a0924367..f4b9040ce85 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1853,6 +1853,17 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
data->layers[i].flag |= flag;
}
+void CustomData_clear_layer_flag(struct CustomData *data, int type, int flag)
+{
+ const int nflag = ~flag;
+
+ for (int i = 0; i < data->totlayer; ++i) {
+ if (data->layers[i].type == type) {
+ data->layers[i].flag &= nflag;
+ }
+ }
+}
+
static int customData_resize(CustomData *data, int amount)
{
CustomDataLayer *tmp = MEM_calloc_arrayN((data->maxlayer + amount), sizeof(*tmp),