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
This commit is contained in:
Himanshi Kalra 2021-08-16 12:17:30 +05:30 committed by Himanshi Kalra
parent c0016a8581
commit c48a01a88a
1 changed files with 13 additions and 0 deletions

View File

@ -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;
}