FBX IO: Edge/face sharp access with attributes #104649

Merged
Bastien Montagne merged 1 commits from Mysteryem/blender-addons:attribute_access_sharp_smooth_pr into main 2023-06-26 15:46:41 +02:00
Member

Blender 3.5 moved edge sharp to a generic attribute and 3.6 moved face
smooth 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 "sharp_edge" and "sharp_face" attributes.

Because the old API was face smooth, not sharp, the logic for working
with "sharp_face" is inverted compared to before.

When the "sharp_edge" or "sharp_face" attributes do not exist, all edges
or faces can be assumed to not be marked sharp, reducing necessary work.

A comment comparing the speed of calculating polygon sides from t_ls
vs getting polygon sides from polygon "loop_total" has been updated to
reflect the change that "loop_total" is not stored internally as of 3.6
and is now slower to access.

This patch makes a minor change to the import of FBX files, whereby code
that used to set every face to smooth now removes the "sharp_face"
attribute instead.

Blender 3.5 moved edge sharp to a generic attribute and 3.6 moved face smooth 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 "sharp_edge" and "sharp_face" attributes. Because the old API was face smooth, not sharp, the logic for working with "sharp_face" is inverted compared to before. When the "sharp_edge" or "sharp_face" attributes do not exist, all edges or faces can be assumed to not be marked sharp, reducing necessary work. A comment comparing the speed of calculating polygon sides from `t_ls` vs getting polygon sides from polygon "loop_total" has been updated to reflect the change that "loop_total" is not stored internally as of 3.6 and is now slower to access. This patch makes a minor change to the import of FBX files, whereby code that used to set every face to smooth now removes the "sharp_face" attribute instead.
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:41 +02:00
Thomas Barlow force-pushed attribute_access_sharp_smooth_pr from d8c9d1b668 to 8f03ef8302 2023-06-26 04:59:11 +02:00 Compare
Bastien Montagne force-pushed attribute_access_sharp_smooth_pr from 8f03ef8302 to 2a58d659aa 2023-06-26 15:31:34 +02:00 Compare
Bastien Montagne approved these changes 2023-06-26 15:46:29 +02:00
Bastien Montagne merged commit eb2bfdcaf1 into main 2023-06-26 15:46:41 +02:00
Bastien Montagne deleted branch attribute_access_sharp_smooth_pr 2023-06-26 15:46:42 +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#104649
No description provided.