Page MenuHome

Alembic: import & export face-varying normals
ClosedPublic

Authored by Sybren A. Stüvel (sybren) on Jul 5 2019, 1:53 PM.

Details

Summary

Loop normals are called 'Face-varying normals' in Alembic. Before this commit, the existence of such normals was used to enable smooth shading. This is incorrect, as the normals could encode flat faces just as well.

This commit adds the loading of these normals as custom loop normals. It then also enables Auto-Smoothing on the mesh (which is a bit of a misnomer and indicates to Blender that the custom normals should be used).

Fixes the glitching described in T65959 and bad normals in T61375.

This introduces a new feature and changes the interpretation of certain properties in Alembic, so definitely aimed for after the 2.80 release.

Diff Detail

Repository
rB Blender

Event Timeline

From quick look this seems OK…

Regarding whether to include this in 2.80 or later, well, it mostly depends on how safe you feel regarding those changes. That looks more like a (non-critical) bugfix to me, than a real new feature, so imho if you are confident about it, it could as well go into 2.80.

source/blender/alembic/intern/abc_mesh.cc
1318

This seems a bit weird to me. Can you elaborate a bit?

source/blender/alembic/intern/abc_mesh.cc
1318

Alembic's 'SubD' scheme is used to store subdivision surfaces, i.e. the pre-subdivision mesh. Currently we don't even add a subdivison modifier when we load such data. This code is assuming (so it should have a comment stating this) that the subdivided surface should be smooth, and sets a flag that will eventually mark all polygons as such.

Before this commit the mesh data was just loaded as-is and presented flat shaded.

Sybren A. Stüvel (sybren) updated this revision to Diff 16289.
  • Added comment about smoothing in SubD loading
  • Alembic export: fix exporting of loop normals

I've fixed exporting loop normals as well; now things load properly in Gaffer as well as Blender, so I'm confident this is a proper bug fix (or two).

If you accept before 15:00 I'll push this to master for inclusion in 2.80 RC :)

Sybren A. Stüvel (sybren) marked an inline comment as done.Jul 10 2019, 10:48 AM

Don't add this to 2.80, no risky changes like this right before the RC.

Sybren A. Stüvel (sybren) retitled this revision from Alembic import: load face-varying normals to Alembic: import & export face-varying normals.Jul 11 2019, 10:22 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.