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

1 Commits

Author SHA1 Message Date
2a58d659aa FBX IO: Edge/face sharp access with attributes
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.
2023-06-26 15:31:31 +02:00