Fix: FBX fails to export materials on geometry nodes objects
commit893100d8e3f10759e4b044df32f0864cfc5310a8
authorThomas Barlow <github@mysterymayhem.co.uk>
Wed, 5 Apr 2023 00:10:55 +0000 (5 01:10 +0100)
committerGitea <gitea@fake.local>
Wed, 12 Apr 2023 09:27:01 +0000 (12 11:27 +0200)
tree729e47d609ed569bb4806f3b6d7016f5ca721aa6
parent35b588cb059f9ab03b0a8e1d74e7dd5e5e3a5f07
Fix: FBX fails to export materials on geometry nodes objects

For only the FBX exporter, fixes #104516.

The exporter would always get the materials to export from the original,
non-evaluated, object, but Geometry nodes, when applied, replace the
materials of the object and mesh/curve/etc., so the wrong materials
would be exported.

Now, when modifiers are applied on export, the materials of the
evaluated object are checked against the materials of the original
object. When the materials differ, the materials of the evaluated object
are set into the `override_materials` of the ObjectWrapper, causing its
`materials` property (refactored from the `material_slots` property) to
return them.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104530
io_scene_fbx/export_fbx_bin.py
io_scene_fbx/fbx_utils.py