Fix Build Without ArmaturePopulate Post Process Step

This post process step introduced new attributes into `aiSkeletonBone`. Said attributes are only defined with the process enabled, i.e. when the `ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS` macro has not been defined.

Some code, however, accessed the variables unconditionally, leading to build failures if `ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS` was defined.

This commit adds the missing checks.
pull/4880/head
Krishty 2023-01-16 08:42:50 +01:00
parent 70edec0efb
commit 793284a766
2 changed files with 4 additions and 0 deletions

View File

@ -1455,7 +1455,9 @@ static void copyBoneToSkeletonBone(aiMesh *mesh, aiBone *bone, aiSkeletonBone *s
skeletonBone->mWeights = bone->mWeights;
skeletonBone->mOffsetMatrix = bone->mOffsetMatrix;
skeletonBone->mMeshId = mesh;
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
skeletonBone->mNode = bone->mNode;
#endif
skeletonBone->mParent = -1;
}

View File

@ -988,8 +988,10 @@ struct aiSkeletonBone {
#ifdef __cplusplus
aiSkeletonBone() :
mParent(-1),
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
mArmature(nullptr),
mNode(nullptr),
#endif
mNumnWeights(0),
mMeshId(nullptr),
mWeights(nullptr),