无法从FBX获得曲线

时间:2017-10-30 17:08:13

标签: animation fbx curves

我尝试使用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曲线中显示。那可能是什么错?

1 个答案:

答案 0 :(得分:0)

从3ds Max导出期间的操作为我提供了我需要的曲线:

  1. 转到Motion-&gt; Trajectories并按折叠。