Skip to content

Commit

Permalink
Merge pull request #5133 from Biohazard90/Fix-removeEmptyBones-cannot…
Browse files Browse the repository at this point in the history
…-be-disabled

Fixed missing config property lookup for removal of empty bones.
  • Loading branch information
kimkulling committed Jun 7, 2023
2 parents 02d5ab2 + cb86029 commit 49a6eec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code/PostProcessing/LimitBoneWeightsProcess.cpp
Expand Up @@ -81,6 +81,7 @@ void LimitBoneWeightsProcess::Execute( aiScene* pScene) {
// Executes the post processing step on the given imported data.
void LimitBoneWeightsProcess::SetupProperties(const Importer* pImp) {
this->mMaxWeights = pImp->GetPropertyInteger(AI_CONFIG_PP_LBW_MAX_WEIGHTS,AI_LMW_MAX_WEIGHTS);
this->mRemoveEmptyBones = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES, 1) != 0;
}

// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -172,9 +173,9 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh* pMesh) {
}

// remove empty bones
#ifdef AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES
pMesh->mNumBones = removeEmptyBones(pMesh);
#endif // AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES
if (mRemoveEmptyBones) {
pMesh->mNumBones = removeEmptyBones(pMesh);
}

if (!DefaultLogger::isNullLogger()) {
ASSIMP_LOG_INFO("Removed ", removed, " weights. Input bones: ", old_bones, ". Output bones: ", pMesh->mNumBones);
Expand Down
1 change: 1 addition & 0 deletions code/PostProcessing/LimitBoneWeightsProcess.h
Expand Up @@ -133,6 +133,7 @@ class ASSIMP_API LimitBoneWeightsProcess : public BaseProcess {

/** Maximum number of bones influencing any single vertex. */
unsigned int mMaxWeights;
bool mRemoveEmptyBones;
};

} // end of namespace Assimp
Expand Down

0 comments on commit 49a6eec

Please sign in to comment.