diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-11-06 12:37:22 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-11-06 12:45:36 +0300 |
commit | b0e7a1d4b492ccb825d37547fa722535cb475108 (patch) | |
tree | 6c4ca21895e1c1a4fb1569aa55a279a82a640683 /source/blender/alembic/intern/abc_mesh.h | |
parent | 4f5086b6dc4b719dd9087ce336fb73545a05bdf6 (diff) |
Alembic: improved import/export of mesh normals
This commit implements the change in behaviour described in T71246.
In short:
For export, per mesh:
- Custom loop normals are defined → loop normals are exported.
- One or more polys are marked flat → loop normals are exported.
- Otherwise, no normals are exported.
For import, when the Alembic mesh contains:
- loop normals (kFacevaryingScope) → use as custom loop normals, and
enble Auto Smooth to have Blender actually use them.
- vertex normals (kVertexScope or kVaryingScope) → convert to loop
normals, and handle as above.
- no normals → mark mesh as smooth.
- unsupported normal types (kConstantScope, kUniformScope,
kUnknownScope) → handle as 'no normals'.
This also fixes T71130: Alembic split normal export issue
Previously the mesh flag `ME_AUTOSMOOTH` was used in conjunction with
the poly flag `ME_SMOOTH` to determine whether loop normals or vertex
normals were exported. This behaviour was hard to predict for artists,
and hard to describe in the manual. Instead, Blender now only exports
loop normals, computing them if necessary. This way, the mesh in Alembic
should always have the same loop normals as in Blender.
Maniphest Tasks: T71130
Differential Revision: https://developer.blender.org/D6197
Diffstat (limited to 'source/blender/alembic/intern/abc_mesh.h')
-rw-r--r-- | source/blender/alembic/intern/abc_mesh.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/alembic/intern/abc_mesh.h b/source/blender/alembic/intern/abc_mesh.h index c15fb948e03..38c589bbc32 100644 --- a/source/blender/alembic/intern/abc_mesh.h +++ b/source/blender/alembic/intern/abc_mesh.h @@ -148,8 +148,8 @@ class AbcSubDReader : public AbcObjectReader { /* ************************************************************************** */ void read_mverts(MVert *mverts, - const Alembic::AbcGeom::P3fArraySamplePtr &positions, - const Alembic::AbcGeom::N3fArraySamplePtr &normals); + const Alembic::AbcGeom::P3fArraySamplePtr positions, + const Alembic::AbcGeom::N3fArraySamplePtr normals); CDStreamConfig get_config(struct Mesh *mesh); |