FBX IO: Material index access with attributes #104646

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:attribute_access_material_index_pr into main 2023-06-26 13:05:47 +02:00
Member

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.

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.
Author
Member

This PR depends on the base patch for adding attribute utility functions: #104645

This PR depends on the base patch for adding attribute utility functions: https://projects.blender.org/blender/blender-addons/pulls/104645
Thomas Barlow requested review from Bastien Montagne 2023-05-29 05:45:01 +02:00
Thomas Barlow force-pushed attribute_access_material_index_pr from e23e7f7b36 to 9590af0660 2023-06-26 05:00:17 +02:00 Compare
Bastien Montagne force-pushed attribute_access_material_index_pr from 9590af0660 to cd43964f87 2023-06-26 13:03:03 +02:00 Compare
Bastien Montagne approved these changes 2023-06-26 13:05:31 +02:00
Bastien Montagne merged commit 670406d0a5 into main 2023-06-26 13:05:47 +02:00
Bastien Montagne deleted branch attribute_access_material_index_pr 2023-06-26 13:05:48 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104646
No description provided.