FBX SDK 2015 skeleton animation on rotation issues

FBX SDK 2015 skeleton animation on rotation issues

Anonymous
Not applicable
730 Views
0 Replies
Message 1 of 1

FBX SDK 2015 skeleton animation on rotation issues

Anonymous
Not applicable

Hi,

 

I´m currently working on a customized exporter for a tool that doesn´t have an Fbx export option. The goal of that exporter is to actually import the animation into Unity.

 

So far I manage to import the skeleton and the meshes

From the animation tool I get all the required data (rotation axis, euler angle, time, etc...) to generate the animation

 

the euler angles from the tool can be negative value (-180, +infinite) but Unity convert all negative rotation key value into positive value (if the tool tell me -5 convert it to 355).

cR = node->LclRotation.GetCurve(animLayer, FBXSDK_CURVENODE_COMPONENT_Z, true);

//...

cR->KeyModifyBegin();

for (KeyData* key = rotTimelineData->child; key; key = key->next)
{
myTime.SetSecondDouble(key->GetFloat("time", 0.0));
myKeyIndex = cR->KeyAdd(myTime);
cR->KeySet(myKeyIndex, myTime, key->GetFloat("angle", 0.0)); //0.0 is the default value:

//it´s not the issue

}
cR->KeyModifyEnd();

 

On the targetted FbxNode I set the limits like that to do some tests but Unity seems to ignore that:

FbxLimitsUtilities *flu = new FbxLimitsUtilities(curNode);
flu->SetRotationType(FbxLimitsUtilities::ERotationType::eEuler);
flu->SetEnable(FbxLimitsUtilities::EType::eRotation, true);
flu->SetMax(FbxLimitsUtilities::EType::eRotation, FbxVector4(0.0, 0.0, 270.0));
flu->SetMin(FbxLimitsUtilities::EType::eRotation, FbxVector4(0.0, 0.0, -90));
flu->SetRotationAxis(FbxVector4(0.0, 0.0, 1.0));

 

Did I miss something? Any idea or advices? I´m a complete beginner on the FBX SDK  🙂

Thanks

0 Likes
731 Views
0 Replies
Replies (0)