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.
This commit is contained in:
@@ -919,11 +919,19 @@ ABC_INLINE void read_normals_params(AbcMeshData &abc_data,
|
||||
|
||||
IN3fGeomParam::Sample normsamp = normals.getExpandedValue(selector);
|
||||
|
||||
if (normals.getScope() == kFacevaryingScope) {
|
||||
Alembic::AbcGeom::GeometryScope scope = normals.getScope();
|
||||
switch (scope) {
|
||||
case Alembic::AbcGeom::kFacevaryingScope:
|
||||
abc_data.face_normals = normsamp.getVals();
|
||||
}
|
||||
else if ((normals.getScope() == kVertexScope) || (normals.getScope() == kVaryingScope)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user