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>2018-12-03 18:19:08 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-12-03 18:22:27 +0300
commit3235a3081c12e99d4bec350eff04b3073c07cdf8 (patch)
treec75a7e0edd39f81ca879de8cc2d27c595c6c35fd /source/blender/blenkernel/BKE_customdata.h
parent957435785cd04dd68307c390a5063026917e836e (diff)
Fix T57858: Add validation callback to CustomData layers.
Our mesh validation was only checking cd layout so far, not their actual data. While this might only be needed for a few types, this is a required addition for things like imported UVs, else we have no way to avoid nasty things like NANs & co. Note that more layer types may need that callback, time will say. For now added it to some obvious missing cases...
Diffstat (limited to 'source/blender/blenkernel/BKE_customdata.h')
-rw-r--r--source/blender/blenkernel/BKE_customdata.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 23bc7ddd6fd..0be8e760cae 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -82,6 +82,7 @@ void customData_mask_layers__print(CustomDataMask mask);
typedef void (*cd_interp)(const void **sources, const float *weights, const float *sub_weights, int count, void *dest);
typedef void (*cd_copy)(const void *source, void *dest, int count);
+typedef bool (*cd_validate)(void *item, const uint totitems, const bool do_fixes);
/**
* Checks if the layer at physical offset \a layer_n (in data->layers) support math
@@ -399,6 +400,9 @@ void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const char
bool CustomData_from_bmeshpoly_test(CustomData *fdata, CustomData *ldata, bool fallback);
#endif
+/* Layer data validation. */
+bool CustomData_layer_validate(struct CustomDataLayer *layer, const uint totitems, const bool do_fixes);
+
/* External file storage */
void CustomData_external_add(struct CustomData *data,