diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-04 12:53:17 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-30 17:59:10 +0300 |
commit | 3568d56bccc556e04c61d8f6ac3f005b0ff838b7 (patch) | |
tree | ceb80ddf5823fef3e37916c8cdc29d75107fccb0 /source/blender/alembic | |
parent | d65a4b5990c28365e89ac0495a31cac4e042704f (diff) |
Alembic: transformed chain-of-ifs into switch statement
By having a switch statement that lists all the values of the enum, it is
clear which cases we're not handling, and it also allows for warnings in
the future when the enum expands.
No functional changes.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r-- | source/blender/alembic/intern/abc_mesh.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 39d9f9d768e..1903b5149c5 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -919,11 +919,19 @@ ABC_INLINE void read_normals_params(AbcMeshData &abc_data, IN3fGeomParam::Sample normsamp = normals.getExpandedValue(selector); - if (normals.getScope() == kFacevaryingScope) { - abc_data.face_normals = normsamp.getVals(); - } - else if ((normals.getScope() == kVertexScope) || (normals.getScope() == kVaryingScope)) { - abc_data.vertex_normals = N3fArraySamplePtr(); + Alembic::AbcGeom::GeometryScope scope = normals.getScope(); + switch (scope) { + case Alembic::AbcGeom::kFacevaryingScope: + abc_data.face_normals = normsamp.getVals(); + break; + case Alembic::AbcGeom::kVertexScope: + case Alembic::AbcGeom::kVaryingScope: + abc_data.vertex_normals = N3fArraySamplePtr(); + break; + case Alembic::AbcGeom::kConstantScope: + case Alembic::AbcGeom::kUniformScope: + case Alembic::AbcGeom::kUnknownScope: + break; } } |