我將我的FBX SDK升級到2016年,但有一個錯誤。FbxAnimCurve在SDK 2016和2009版本之間有不同的行爲
舊代碼:
KFbxCamera * FBXPopulator::GetActiveCamera(KTime & a_Time) const { KFbxCameraSwitcher* cameraSwitcher = m_Scene->GetGlobalCameraSettings().GetCameraSwitcher(); if (cameraSwitcher) { KFCurve* curve = cameraSwitcher->CameraIndex.GetKFCurve(NULL, m_Scene->GetCurrentTakeName()); if (curve) { int32_t index = static_cast< int32_t >(curve->Evaluate(a_Time) - 1); return m_DeclaredCameras[ index ]->GetCamera(); } } return NULL; }
當前的代碼:
FbxCamera * FBXPopulator::GetActiveCamera(FbxTime & a_Time) const { FbxCameraSwitcher* cameraSwitcher = m_Scene->GlobalCameraSettings().GetCameraSwitcher(); if (cameraSwitcher) { //Is it right here? FbxAnimCurve* curve = cameraSwitcher->CameraIndex.GetCurve(m_Scene->GetCurrentAnimationStack()->GetMember()); if (curve) { int32_t index = static_cast< int32_t >(curve->Evaluate(a_Time) - 1); return m_DeclaredCameras[index]->GetCamera(); } } return NULL; }
是不是錯了?
我在2009版中獲得索引== 0,而2016版的索引== 1。
有什麼建議嗎? 謝謝!