diff options
author | Himanshi Kalra <calra> | 2021-08-16 09:47:30 +0300 |
---|---|---|
committer | Himanshi Kalra <himanshikalra98@gmail.com> | 2021-08-16 09:58:12 +0300 |
commit | c48a01a88add5247f08de6f8af8d223ebc4e28c9 (patch) | |
tree | b56fe14c70d240c87c606bbadf715444c5deed56 /source/blender | |
parent | c0016a8581f3124d34dc8cf0a2a5c3374e72356a (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')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 13 |
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; } |