public void TestBasics() { // create a curve we can unroll. var fbxScene = FbxScene.Create(Manager, "scene"); var fbxNode = FbxNode.Create(fbxScene, "node"); var fbxAnimNode = FbxAnimCurveNode.CreateTypedCurveNode(fbxNode.LclRotation, fbxScene); FbxAnimCurve[] fbxAnimCurves = { fbxAnimNode.CreateCurve(fbxAnimNode.GetName(), Globals.FBXSDK_CURVENODE_COMPONENT_X), fbxAnimNode.CreateCurve(fbxAnimNode.GetName(), Globals.FBXSDK_CURVENODE_COMPONENT_Y), fbxAnimNode.CreateCurve(fbxAnimNode.GetName(), Globals.FBXSDK_CURVENODE_COMPONENT_Z) }; FbxAnimCurveFilterUnroll filter = new FbxAnimCurveFilterUnroll(); Assert.That(filter.NeedApply(fbxAnimNode), Is.False, "expected not to need to unroll curves"); Assert.That(filter.Apply(fbxAnimNode), Is.False, "expected to have nothing to do"); // ensure coverage for function that takes an FbxStatus Assert.That(filter.NeedApply(fbxAnimNode, new FbxStatus()), Is.False); Assert.That(filter.Apply(fbxAnimNode, new FbxStatus()), Is.False); // configure the unroll condition foreach (float[] keydata in KeyTimeValues) { double seconds = keydata[0]; foreach (var fbxAnimCurve in fbxAnimCurves) { fbxAnimCurve.KeyModifyBegin(); } using (var fbxTime = FbxTime.FromSecondDouble(seconds)) { for (int ci = 0; ci < fbxAnimCurves.Length; ci++) { int ki = fbxAnimCurves[ci].KeyAdd(fbxTime); fbxAnimCurves[ci].KeySet(ki, fbxTime, keydata[ci + 1]); } } foreach (var fbxAnimCurve in fbxAnimCurves) { fbxAnimCurve.KeyModifyEnd(); } } Assert.That(filter.NeedApply(fbxAnimNode), Is.True, "expected to need to unroll curves"); Assert.That(filter.Apply(fbxAnimNode), Is.True, "expected to have unroll"); IEnumerator origKeydata = KeyTimeValues.GetEnumerator(); for (int ki = 0; ki < fbxAnimCurves[0].KeyGetCount(); ki++) { List <float> result = new List <float>() { (float)fbxAnimCurves[0].KeyGetTime(ki).GetSecondDouble() }; result = result.Concat((from ac in fbxAnimCurves select ac.KeyGetValue(ki))).ToList(); origKeydata.MoveNext(); if (ki == 0 || ki == 3 || ki == 4) { Assert.That(result, Is.EqualTo(origKeydata.Current)); } else { Assert.That(result, Is.Not.EqualTo(origKeydata.Current)); } } filter.Reset(); filter.Dispose(); }