[Bf-blender-cvs] [bd2f9a16fb0] master: Merge branch 'blender-v3.2-release'
Brecht Van Lommel
noreply at git.blender.org
Fri May 27 17:11:14 CEST 2022
Commit: bd2f9a16fb0c606ccc8a39f983293f462f89751e
Author: Brecht Van Lommel
Date: Fri May 27 17:06:58 2022 +0200
Branches: master
https://developer.blender.org/rBbd2f9a16fb0c606ccc8a39f983293f462f89751e
Merge branch 'blender-v3.2-release'
===================================================================
===================================================================
diff --cc intern/cycles/blender/mesh.cpp
index c76ce3801d4,635421d3d61..e2db52cc5c1
--- a/intern/cycles/blender/mesh.cpp
+++ b/intern/cycles/blender/mesh.cpp
@@@ -316,26 -297,32 +297,32 @@@ static void fill_generic_attribute(BL::
break;
}
case BL::Attribute::domain_EDGE: {
- /* Average edge attributes at vertices. */
- const size_t num_verts = b_mesh.vertices.length();
- vector<int> count(num_verts, 0);
-
- for (BL::MeshEdge &e : b_mesh.edges) {
- BL::Array<int, 2> vertices = e.vertices();
- TypeInCycles value = get_value_at_index(e.index());
-
- data[vertices[0]] += value;
- data[vertices[1]] += value;
- count[vertices[0]]++;
- count[vertices[1]]++;
+ if constexpr (std::is_same_v<TypeInCycles, uchar4>) {
+ /* uchar4 edge attributes do not exist, and averaging in place
+ * would not work. */
+ assert(0);
}
+ else {
- /* Averge edge attributes at vertices. */
++ /* Average edge attributes at vertices. */
+ const size_t num_verts = b_mesh.vertices.length();
+ vector<int> count(num_verts, 0);
+
+ for (BL::MeshEdge &e : b_mesh.edges) {
+ BL::Array<int, 2> vertices = e.vertices();
+ TypeInCycles value = get_value_at_index(e.index());
+
+ data[vertices[0]] += value;
+ data[vertices[1]] += value;
+ count[vertices[0]]++;
+ count[vertices[1]]++;
+ }
- for (size_t i = 0; i < num_verts; i++) {
- if (count[i] > 1) {
- data[i] /= (float)count[i];
+ for (size_t i = 0; i < num_verts; i++) {
+ if (count[i] > 1) {
+ data[i] /= (float)count[i];
+ }
}
}
-
break;
}
case BL::Attribute::domain_POINT: {
More information about the Bf-blender-cvs
mailing list