FBX IO: Export normals matching the mesh's normals_domain #104976
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#104976
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Mysteryem/blender-addons:fbx_update_for_auto_smooth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The appropriate normals array and FBX layer mapping are now used
according to the Mesh.normals_domain property.
This results in slightly faster exports with smaller file size when
meshes are either fully smooth shaded or fully flat shaded because the
FACE and POINT domains almost always have fewer normals than the CORNER
domain and never have more (a fully smooth shaded mesh where each face
has its own vertices would be POINT domain with as many vertices as
corners).
Additionally, getting the normals from the new Mesh.corner_normals
property runs in about 60% of the time of getting the normals through
MeshLoop.normal.
For me with a subdivided cube with 185856 corners:
MeshLoop.normal: ~6.7ms
Mesh.corner_normals: ~4.0ms
Import is unaffected, because only custom split normals can be set.
If blender/blender#114063 makes it into Main, then getting normals through Mesh.corner_normals (and the other normals arrays) is much faster and runs in about 7.2% of the time of getting the normals through MeshLoop.normal, at ~0.5ms for a subdivided cube with 185856 corners.
Attached is a source .blend (authored in 4.1.0a) and .fbx created using the changes in this PR. The files have 1 Cube and 1 Suzanne for each Mesh.normals_domain value.
All meshes in the .fbx display as expected for me in FBX Review, Unity 2019 (and later) and Microsoft 3D Viewer, I have not tried other external software. If there are issues with some external software, getting this change in now during 4.1 Bcon1 will hopefully identify the issues before release.
Patch LGTM, minor point raised in comment below can be addressed without needing another review imho.
@ -1176,3 +1194,3 @@
# Since we don't care about how the normals are sorted, only that they're unique, we can use the fast unique
# helper function.
t_ln, t_lnidx = fast_first_axis_unique(t_ln.reshape(-1, 3), return_inverse=True)
t_normal, t_lnidx = fast_first_axis_unique(t_normal.reshape(-1, 3), return_inverse=True)
Shouldn't
t_lnidx
variable also be renamed, maybe tot_normal_idx
then?