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:
authorHimanshi Kalra <calra>2021-08-16 09:47:30 +0300
committerHimanshi Kalra <himanshikalra98@gmail.com>2021-08-16 09:58:12 +0300
commitc48a01a88add5247f08de6f8af8d223ebc4e28c9 (patch)
treeb56fe14c70d240c87c606bbadf715444c5deed56 /source/blender/blenkernel/intern/mesh.c
parentc0016a8581f3124d34dc8cf0a2a5c3374e72356a (diff)
Add cutom data color property for mesh comparison
Add color data type comparison for meshes, adding it as part of comparing meshes with geometry nodes applied. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12192
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index b32d58de1e2..b1292a1c94d 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -638,6 +638,19 @@ static int customdata_compare(
}
break;
}
+ case CD_PROP_COLOR: {
+ const MPropCol *l1_data = l1->data;
+ const MPropCol *l2_data = l2->data;
+
+ for (int i = 0; i < total_length; i++) {
+ for (int j = 0; j < 4; j++) {
+ if (fabsf(l1_data[i].color[j] - l2_data[i].color[j]) > thresh) {
+ return MESHCMP_ATTRIBUTE_VALUE_MISMATCH;
+ }
+ }
+ }
+ break;
+ }
default: {
break;
}