diff options
author | Hans Goudey <h.goudey@me.com> | 2022-10-17 20:21:30 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-10-17 20:21:30 +0300 |
commit | 728451f01ad5eec6abdc4f54364fe82490b151c5 (patch) | |
tree | 32a62c03b993eb1cd25729c14dfaa56908b741b5 | |
parent | d3b47fa84297dbbf5d5f91d0d68473468c363bd4 (diff) |
Fix T101871: Realize instances node can skip material indices
The node only created a material index attribute on the result mesh
if it existed on any of the input meshes. But the input meshes might
not have the attribute if they had a single material or no materials.
As a fix, also create the attribute if the result has more than one
material.
-rw-r--r-- | source/blender/geometry/intern/realize_instances.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index daafe0e4aa7..c649bde06ca 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -859,6 +859,7 @@ static AllMeshesInfo preprocess_meshes(const GeometrySet &geometry_set, } } } + info.create_material_index_attribute |= info.materials.size() > 1; info.realize_info.reinitialize(info.order.size()); for (const int mesh_index : info.realize_info.index_range()) { MeshRealizeInfo &mesh_info = info.realize_info[mesh_index]; |