Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / How to use LclTranslation.GetKFCurve() ?
  RSS 2.0 ATOM  

How to use LclTranslation.GetKFCurve() ?
Rate this thread
 
48987
 
Permlink of this thread  
avatar
  • qiaochu
  • Posted: 01 November 2010 10:33 AM
  • Total Posts: 15
  • Joined: 25 October 2010 04:23 PM

Hi guys,

lCurve = pNode->LclTranslation.GetKFCurve(KFCURVENODE_T_X, pTakeName.Buffer());
lCurve = pNode->LclTranslation.GetKFCurve(KFCURVENODE_T_Y, pTakeName.Buffer());
lCurve = pNode->LclTranslation.GetKFCurve(KFCURVENODE_T_Z, pTakeName.Buffer());

Using these three sentences above, we can generate animation which is translation at one direction.

My question is can I translate for these three directions at once or at one sentence ?

Thank you for your help.

Have a nice day !



Replies: 1
/img/forum/dark/default_avatar.png

I think it’s better to use KFbxAnimCurveNode ::CreateTypedCurveNode.
Your codes may like as
KFbxAnimCurveNode* lCurve = KFbxAnimCurveNode::CreateTypedCurveNode(pNode.LclTranslation, pScene);

Also the method GetKFCurve in KFbxProperty is deprecated.

Author: Kyd

Replied: 01 November 2010 08:30 PM  
avatar
  • qiaochu
  • Posted: 02 November 2010 09:09 AM

Kyd, thank you for your help.

But could you give some more detail about
KFbxAnimCurveNode* lCurve = KFbxAnimCurveNode::CreateTypedCurveNode(pNode.LclTranslation, pScene);

I use the code below for generation animation:
KFCurve* lCurve = NULL;
KTime lTime;
int lKeyIndex = 0;
pNode->CreateTakeNode(pTakeName.Buffer());
pNode->SetCurrentTakeNode(pTakeName.Buffer());
pNode->LclTranslation.GetKFCurveNode(true, pTakeName.Buffer());
lCurve->KeyModifyBegin();
lTime.SetSecondDouble(0.0);
lKeyIndex = lCurve->KeyAdd(lTime);
lCurve->KeySet(lKeyIndex, lTime, 5.0);
lCurveTX->KeyModifyEnd();

how to use your method to generate the animation? Totally I need to do the translation in 3 channels(X, Y, Z).

Thank you !



Replies: 1
/img/forum/dark/default_avatar.png

FBX sdk only supports numeric animation. we have to create curves for each channels.So I find no way to manipulate x, y , z
all together.
your codes may like this:

KFbxAnimCurveNode* lCurveNode = KFbxAnimCurveNode::CreateTypedCurveNode(pNode.LclTranslation, pScene);
KFbxAnimCurve* lCurve = lCurveNode->CreateCurve( lCurveNode->GetName(), KFCURVENODE_T_X);
//then you can add keys
//lCurve->KeyModifyBegin();
...
...
...
//lCurve->KeyModifyEnd();
may this helps you

Author: Kyd

Replied: 02 November 2010 08:32 PM