我正在尝试使用fbx SDK从fbx文件中获取动画曲线。我正在像FBX文档中所说的那样尝试:http://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref__import_scene_2_display_animation_8cxx_example_html。这是代码:
int layersCount = currAnimStack->GetMemberCount();
/// layersCount = 1
FbxAnimLayer* layer = currAnimStack->GetMember<FbxAnimLayer>(0);
//// layer is ok, it's not null
FbxAnimCurve* curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_X);
curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Y, NULL);
curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Z, NULL);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_X, NULL);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Y, NULL);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Z, NULL);
curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_X, NULL, false);
curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Y, NULL, false);
curve = inNode->LclTranslation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Z, NULL, false);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_X, NULL, false);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Y, NULL, false);
curve = inNode->LclRotation.GetCurve(layer, FBXSDK_CURVENODE_COMPONENT_Z, NULL, false);
但无论我怎么尝试,曲线总是空的。同时,在3ds Max中显示曲线。那么,可能出了什么问题呢?
从3ds Max导出过程中的操作为我提供了所需的曲线:
- 转到"运动"->"轨迹"并按"折叠">