Fix: FBX fails to export materials on geometry nodes objects #104530

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:fbx_fix_geometry_nodes_mat_export_pr into main 2023-04-12 11:27:03 +02:00

1 Commits

Author SHA1 Message Date
Thomas Barlow 98017421b4 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.
2023-04-05 13:51:08 +01:00