mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
Fix BlendShape output error
This commit is contained in:
parent
344b675745
commit
03f74bac64
@ -941,22 +941,22 @@ AS_API(int32_t) AsFbxAnimGetCurrentBlendShapeChannelCount(AsFbxAnimContext* pAni
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lGeometry = dynamic_cast<FbxGeometry*>(pNode->GetNodeAttribute());
|
auto pMesh = pNode->GetMesh();
|
||||||
pAnimContext->lGeometry = lGeometry;
|
pAnimContext->pMesh = pMesh;
|
||||||
|
|
||||||
if (lGeometry == nullptr)
|
if (pMesh == nullptr)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto blendShapeDeformerCount = lGeometry->GetDeformerCount(FbxDeformer::eBlendShape);
|
auto blendShapeDeformerCount = pMesh->GetDeformerCount(FbxDeformer::eBlendShape);
|
||||||
|
|
||||||
if (blendShapeDeformerCount <= 0)
|
if (blendShapeDeformerCount <= 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lBlendShape = dynamic_cast<FbxBlendShape*>(lGeometry->GetDeformer(0, FbxDeformer::eBlendShape));
|
auto lBlendShape = (FbxBlendShape*)pMesh->GetDeformer(0, FbxDeformer::eBlendShape);
|
||||||
pAnimContext->lBlendShape = lBlendShape;
|
pAnimContext->lBlendShape = lBlendShape;
|
||||||
|
|
||||||
if (lBlendShape == nullptr)
|
if (lBlendShape == nullptr)
|
||||||
@ -991,12 +991,12 @@ AS_API(bool32_t) AsFbxAnimIsBlendShapeChannelMatch(AsFbxAnimContext* pAnimContex
|
|||||||
|
|
||||||
AS_API(void) AsFbxAnimBeginBlendShapeAnimCurve(AsFbxAnimContext* pAnimContext, int32_t channelIndex)
|
AS_API(void) AsFbxAnimBeginBlendShapeAnimCurve(AsFbxAnimContext* pAnimContext, int32_t channelIndex)
|
||||||
{
|
{
|
||||||
if (pAnimContext == nullptr || pAnimContext->lGeometry == nullptr || pAnimContext->lAnimLayer == nullptr)
|
if (pAnimContext == nullptr || pAnimContext->pMesh == nullptr || pAnimContext->lAnimLayer == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pAnimContext->lAnimCurve = pAnimContext->lGeometry->GetShapeChannel(0, channelIndex, pAnimContext->lAnimLayer, true);
|
pAnimContext->lAnimCurve = pAnimContext->pMesh->GetShapeChannel(0, channelIndex, pAnimContext->lAnimLayer, true);
|
||||||
pAnimContext->lAnimCurve->KeyModifyBegin();
|
pAnimContext->lAnimCurve->KeyModifyBegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ AsFbxAnimContext::AsFbxAnimContext(bool32_t eulerFilter)
|
|||||||
lCurveTY = nullptr;
|
lCurveTY = nullptr;
|
||||||
lCurveTZ = nullptr;
|
lCurveTZ = nullptr;
|
||||||
|
|
||||||
lGeometry = nullptr;
|
pMesh = nullptr;
|
||||||
lBlendShape = nullptr;
|
lBlendShape = nullptr;
|
||||||
lAnimCurve = nullptr;
|
lAnimCurve = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ struct AsFbxAnimContext
|
|||||||
FbxAnimCurve* lCurveTY;
|
FbxAnimCurve* lCurveTY;
|
||||||
FbxAnimCurve* lCurveTZ;
|
FbxAnimCurve* lCurveTZ;
|
||||||
|
|
||||||
FbxGeometry* lGeometry;
|
FbxMesh* pMesh;
|
||||||
FbxBlendShape* lBlendShape;
|
FbxBlendShape* lBlendShape;
|
||||||
FbxAnimCurve* lAnimCurve;
|
FbxAnimCurve* lAnimCurve;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user