Fix #119873: Bake node crash with instanced light objectsv4.1.0
commit40a5e739e2701ee7434dcbd8acf6b740622ddf50
authorHans Goudey <hans@blender.org>
Mon, 25 Mar 2024 20:42:07 +0000 (25 21:42 +0100)
committerHans Goudey <hooglyboogly@noreply.localhost>
Mon, 25 Mar 2024 20:42:07 +0000 (25 21:42 +0100)
tree714cfadba78c0215087f7fd66ff593a7a1b80272
parent6c74d4af15a4bdc0d29c71e2f2f910842efd864c
Fix #119873: Bake node crash with instanced light objects

4d0936c7d74bee32cd50 explicitly avoids turning non-geometry object
instances into geometry instances. This code is called to prepare
geometry sets for baking, and baking currently assumes that the baked
instances are always geometry sets.

To fix this, just check the instance type and serialize an empty
geometry set for the crashing object instance case. Compared to before
the crash causing commit, there is no change in behavior, since that
would have created empty geometry sets too.

Pull Request: https://projects.blender.org/blender/blender/pulls/119892
source/blender/blenkernel/intern/bake_items_serialize.cc