From 728451f01ad5eec6abdc4f54364fe82490b151c5 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 17 Oct 2022 12:21:30 -0500 Subject: 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. --- source/blender/geometry/intern/realize_instances.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/geometry') 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]; -- cgit v1.2.3