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->mWeights = bone->mWeights;
skeletonBone->mOffsetMatrix = bone->mOffsetMatrix; skeletonBone->mOffsetMatrix = bone->mOffsetMatrix;
skeletonBone->mMeshId = mesh; skeletonBone->mMeshId = mesh;
#ifndef ASSIMP_BUILD_NO_ARMATUREPOPULATE_PROCESS
skeletonBone->mNode = bone->mNode; skeletonBone->mNode = bone->mNode;
#endif
skeletonBone->mParent = -1; skeletonBone->mParent = -1;
} }

View File

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