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:
authorHans Goudey <h.goudey@me.com>2022-02-04 19:29:11 +0300
committerHans Goudey <h.goudey@me.com>2022-02-04 19:29:11 +0300
commite7912dfa1959be671f77e4e67eab01de9de86c77 (patch)
treecd0df5a3457b9bb0e33b1856fb32a1b01622d99b /source/blender/blenkernel/intern/mesh.cc
parentb4563ab2dfe1e553bfe48d50592823ff13a49692 (diff)
Attributes: Infrastructure for generic 8-bit integer data type
This commit adds infrastructure for 8 bit signed integer attributes. This can be useful given the discussion in T94193, where we want to store spline type, Bezier handle type, and other small enums as attributes. This is only exposed in the interface in the attribute lists, so it shouldn't be an option in geometry nodes, at least for now. I expect that this type won't be used directly very often, it should mostly be cast to an enum type. However, with support for 8 bit integers, it also makes sense to add things like mixing implementations for consistency. Differential Revision: https://developer.blender.org/D13721
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.cc')
-rw-r--r--source/blender/blenkernel/intern/mesh.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc
index 73fe279552d..c1b1f62a881 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -685,6 +685,17 @@ static int customdata_compare(
}
break;
}
+ case CD_PROP_INT8: {
+ const int8_t *l1_data = (int8_t *)l1->data;
+ const int8_t *l2_data = (int8_t *)l2->data;
+
+ for (int i = 0; i < total_length; i++) {
+ if (l1_data[i] != l2_data[i]) {
+ return MESHCMP_ATTRIBUTE_VALUE_MISMATCH;
+ }
+ }
+ break;
+ }
case CD_PROP_BOOL: {
const bool *l1_data = (bool *)l1->data;
const bool *l2_data = (bool *)l2->data;