Keep original materials names after RemoveRedundant materials process and export to collada
This commit is contained in:
@@ -177,12 +177,14 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
continue;
|
||||
}
|
||||
|
||||
// generate new names for all modified materials
|
||||
// generate new names for modified materials that had no names
|
||||
const unsigned int idx = aiMappingTable[p];
|
||||
if (ppcMaterials[idx]) {
|
||||
aiString sz;
|
||||
sz.length = ::ai_snprintf(sz.data,MAXLEN,"JoinedMaterial_#%u",p);
|
||||
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
if( ppcMaterials[idx]->Get(AI_MATKEY_NAME, sz) != AI_SUCCESS ) {
|
||||
sz.length = ::ai_snprintf(sz.data,MAXLEN,"JoinedMaterial_#%u",p);
|
||||
((aiMaterial*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
}
|
||||
} else {
|
||||
ppcMaterials[idx] = pScene->mMaterials[p];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user