Fixed crash when importing FBX files that don't have any animations
--HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%40212
This commit is contained in:
@@ -593,10 +593,11 @@ void LoadNode(KFbxScene* pFbxScene, KRNode *parent_node, std::vector<KRResource
|
||||
// FbxAnimStack* pAnimStack = FbxCast<FbxAnimStack>(pFbxScene->GetSrcObject(FBX_TYPE(FbxAnimStack), i));
|
||||
FbxAnimStack* pAnimStack = pFbxScene->GetSrcObject<FbxAnimStack>(i);
|
||||
KRAnimation *pAnimation = parent_node->getContext().getAnimationManager()->getAnimation(pAnimStack->GetName());
|
||||
if(pAnimation) {
|
||||
int cLayers = pAnimStack->GetMemberCount<FbxAnimLayer>();
|
||||
for(int iLayer=0; iLayer < cLayers; iLayer++) {
|
||||
FbxAnimLayer *pFbxAnimLayer = pAnimStack->GetMember<FbxAnimLayer>(iLayer);
|
||||
float weight = pFbxAnimLayer->Weight.Get();
|
||||
// float weight = pFbxAnimLayer->Weight.Get();
|
||||
KRAnimationLayer *pAnimationLayer = pAnimation->getLayer(pFbxAnimLayer->GetName());
|
||||
|
||||
FbxAnimCurve *pAnimCurve = pNode->LclRotation.GetCurve(pFbxAnimLayer, FBXSDK_CURVENODE_COMPONENT_X);
|
||||
@@ -681,6 +682,7 @@ void LoadNode(KFbxScene* pFbxScene, KRNode *parent_node, std::vector<KRResource
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fbxDouble3 local_rotation = pNode->LclRotation.Get(); // pNode->GetGeometricRotation(KFbxNode::eSourcePivot);
|
||||
fbxDouble3 local_translation = pNode->LclTranslation.Get(); // pNode->GetGeometricTranslation(KFbxNode::eSourcePivot);
|
||||
|
||||
Reference in New Issue
Block a user