------------------------------------------------------------------------------------------------ Executes the post processing step on the given imported data.
| 75 | // ------------------------------------------------------------------------------------------------ |
| 76 | // Executes the post processing step on the given imported data. |
| 77 | void RemoveVCProcess::Execute(aiScene *pScene) { |
| 78 | ASSIMP_LOG_DEBUG("RemoveVCProcess begin"); |
| 79 | bool bHas = false; //,bMasked = false; |
| 80 | |
| 81 | mScene = pScene; |
| 82 | |
| 83 | // handle animations |
| 84 | if (configDeleteFlags & aiComponent_ANIMATIONS) { |
| 85 | |
| 86 | bHas = true; |
| 87 | ArrayDelete(pScene->mAnimations, pScene->mNumAnimations); |
| 88 | } |
| 89 | |
| 90 | // handle textures |
| 91 | if (configDeleteFlags & aiComponent_TEXTURES) { |
| 92 | bHas = true; |
| 93 | ArrayDelete(pScene->mTextures, pScene->mNumTextures); |
| 94 | } |
| 95 | |
| 96 | // handle materials |
| 97 | if (configDeleteFlags & aiComponent_MATERIALS && pScene->mNumMaterials) { |
| 98 | bHas = true; |
| 99 | for (unsigned int i = 1; i < pScene->mNumMaterials; ++i) |
| 100 | delete pScene->mMaterials[i]; |
| 101 | |
| 102 | pScene->mNumMaterials = 1; |
| 103 | aiMaterial *helper = (aiMaterial *)pScene->mMaterials[0]; |
| 104 | ai_assert(nullptr != helper); |
| 105 | helper->Clear(); |
| 106 | |
| 107 | // gray |
| 108 | aiColor3D clr(0.6f, 0.6f, 0.6f); |
| 109 | helper->AddProperty(&clr, 1, AI_MATKEY_COLOR_DIFFUSE); |
| 110 | |
| 111 | // add a small ambient color value |
| 112 | clr = aiColor3D(0.05f, 0.05f, 0.05f); |
| 113 | helper->AddProperty(&clr, 1, AI_MATKEY_COLOR_AMBIENT); |
| 114 | |
| 115 | aiString s; |
| 116 | s.Set("Dummy_MaterialsRemoved"); |
| 117 | helper->AddProperty(&s, AI_MATKEY_NAME); |
| 118 | } |
| 119 | |
| 120 | // handle light sources |
| 121 | if (configDeleteFlags & aiComponent_LIGHTS) { |
| 122 | bHas = true; |
| 123 | ArrayDelete(pScene->mLights, pScene->mNumLights); |
| 124 | } |
| 125 | |
| 126 | // handle camneras |
| 127 | if (configDeleteFlags & aiComponent_CAMERAS) { |
| 128 | bHas = true; |
| 129 | ArrayDelete(pScene->mCameras, pScene->mNumCameras); |
| 130 | } |
| 131 | |
| 132 | // handle meshes |
| 133 | if (configDeleteFlags & aiComponent_MESHES) { |
| 134 | bHas = true; |
nothing calls this directly
no test coverage detected