MD3
- shaders are now processed - multi-part player models are handled correctly Material system - added flags for 'usealpha' or 'ignorealpha' setting of textures LWO - fixed texture assignment bug due to invalid tag list 3DS - improved handling of dummy nodes Viewer: - lines&points are now displayed - improved animation control via slider (still some stuff missing) - skeleton is now displayed - some other minor fixes Validator: - some material issues are warnings now (no errors anymore) git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@349 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -95,8 +95,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
for (unsigned int i = 0; i < pScene->mNumMaterials;++i)
|
||||
{
|
||||
// if the material is not referenced ... remove it
|
||||
if (!abReferenced[i])
|
||||
{
|
||||
if (!abReferenced[i]) {
|
||||
++unreferenced;
|
||||
continue;
|
||||
}
|
||||
@@ -104,8 +103,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
uint32_t me = aiHashes[i] = ((MaterialHelper*)pScene->mMaterials[i])->ComputeHash();
|
||||
for (unsigned int a = 0; a < i;++a)
|
||||
{
|
||||
if (me == aiHashes[a])
|
||||
{
|
||||
if (me == aiHashes[a]) {
|
||||
++iCnt;
|
||||
me = 0;
|
||||
aiMappingTable[i] = aiMappingTable[a];
|
||||
@@ -113,27 +111,26 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (me)
|
||||
{
|
||||
if (me) {
|
||||
aiMappingTable[i] = iNewNum++;
|
||||
}
|
||||
}
|
||||
if (iCnt)
|
||||
{
|
||||
if (iCnt) {
|
||||
// build an output material list
|
||||
aiMaterial** ppcMaterials = new aiMaterial*[iNewNum];
|
||||
::memset(ppcMaterials,0,sizeof(void*)*iNewNum);
|
||||
for (unsigned int p = 0; p < pScene->mNumMaterials;++p)
|
||||
{
|
||||
// if the material is not referenced ... remove it
|
||||
if (!abReferenced[p])continue;
|
||||
if (!abReferenced[p])
|
||||
continue;
|
||||
|
||||
// generate new names for all modified materials
|
||||
const unsigned int idx = aiMappingTable[p];
|
||||
if (ppcMaterials[idx])
|
||||
{
|
||||
aiString sz;
|
||||
sz.length = ::sprintf(sz.data,"aiMaterial #%i",p);
|
||||
sz.length = ::sprintf(sz.data,"JoinedMaterial_#%i",p);
|
||||
((MaterialHelper*)ppcMaterials[idx])->AddProperty(&sz,AI_MATKEY_NAME);
|
||||
}
|
||||
else ppcMaterials[idx] = pScene->mMaterials[p];
|
||||
|
||||
Reference in New Issue
Block a user