Core/ParameterList: Rework Parameter getter using Result

This commit is contained in:
SirLynix
2022-09-09 13:47:06 +02:00
parent e063c7b45e
commit 6bf4ccaae1
23 changed files with 311 additions and 405 deletions

View File

@@ -115,9 +115,7 @@ int main()
std::vector<std::shared_ptr<Nz::Material>> materials(bobMesh->GetMaterialCount());
for (std::size_t i = 0; i < bobMesh->GetMaterialCount(); ++i)
{
std::string matPath;
bobMesh->GetMaterialData(i).GetStringParameter(Nz::MaterialData::BaseColorTexturePath, &matPath);
std::string matPath = bobMesh->GetMaterialData(i).GetStringParameter(Nz::MaterialData::BaseColorTexturePath).GetValueOr("");
if (!matPath.empty())
materials[i] = Nz::Material::LoadFromFile(matPath);
}