FBX IO: Material index access with attributes
commit670406d0a50a0a53b51e53f065c724b3afcb7c9a
authorThomas Barlow <github@mysterymayhem.co.uk>
Wed, 8 Mar 2023 04:38:04 +0000 (8 04:38 +0000)
committerGitea <gitea@fake.local>
Mon, 26 Jun 2023 11:05:45 +0000 (26 13:05 +0200)
tree7ddd02a54824a61cb81b2154a47b5c2297501c59
parenteba777ca9a161a7f25db19af2aabec741f79e6fe
FBX IO: Material index access with attributes

Blender 3.4 moved material indices to a generic attribute. The old API
still works for now, but is slower and may be removed in 4.0, so this
patch updates FBX IO to use the new "material_index" attribute.

This patch changes the export of meshes that have multiple materials,
but where all the polygons are assigned to the first material (so there
is no "material_index" attribute) to export using the "AllSame" type.
Material indices exported in this way export in negligible constant
time.

Pull Request: https://projects.blender.org/blender/blender-addons/pulls/104646
io_scene_fbx/export_fbx_bin.py
io_scene_fbx/import_fbx.py