Nascent normals, materials

pull/5522/head
Steve M 2024-04-04 17:57:30 -07:00
parent c28b73a571
commit fb84d91350
1 changed files with 13 additions and 0 deletions

View File

@ -229,6 +229,19 @@ void USDImporterImplTinyusdz::materials(
const std::string &nameWExt) {
const size_t numMaterials{render_scene.materials.size()};
(void) numMaterials; // Ignore unused variable when -Werror enabled
pScene->mMaterials = 0;
if (render_scene.materials.empty()) {
return;
}
pScene->mMaterials = new aiMaterial *[render_scene.materials.size()];
for (const auto &material : render_scene.materials) {
aiMaterial *mat = new aiMaterial;
aiString *materialName = new aiString();
materialName->Set(material.name);
mat->AddProperty(materialName, AI_MATKEY_NAME);
pScene->mMaterials[pScene->mNumMaterials] = mat;
++pScene->mNumMaterials;
}
}
void USDImporterImplTinyusdz::textures(