Skip to content

Commit

Permalink
replace deprecated common::SubMesh::MaterialIndex() with GetMaterialI…
Browse files Browse the repository at this point in the history
…ndex()

Signed-off-by: Ashton Larkin <[email protected]>
  • Loading branch information
adlarkin committed Apr 11, 2022
1 parent a5464eb commit e21a185
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/systems/collada_world_exporter/ColladaWorldExporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,20 @@ class ignition::gazebo::systems::ColladaWorldExporterPrivate
{
auto subMeshLock = mesh->SubMeshByIndex(k).lock();
subm = worldMesh.AddSubMesh(*subMeshLock.get());
addSubmeshFunc(subMeshLock->MaterialIndex());
if (const auto subMeshIdx = subMeshLock->GetMaterialIndex())
addSubmeshFunc(static_cast<int>(subMeshIdx.value()));
else
addSubmeshFunc(-1);
}
}
else
{
auto subMeshLock = mesh->SubMeshByName(subMeshName).lock();
subm = worldMesh.AddSubMesh(*subMeshLock.get());
addSubmeshFunc(subMeshLock->MaterialIndex());
if (const auto subMeshIdx = subMeshLock->GetMaterialIndex())
addSubmeshFunc(static_cast<int>(subMeshIdx.value()));
else
addSubmeshFunc(-1);
}
}
else
Expand Down

0 comments on commit e21a185

Please sign in to comment.