public void SampleTransformations(MotionData reference, params string[] bones) { if (reference == null) { Debug.Log("No reference specified."); return; } foreach (string bone in bones) { Hierarchy.Bone self = Source.FindBone(bone); Hierarchy.Bone other = reference.Source.FindBone(bone); if (self == null || other == null) { Debug.Log("No mapping found for resampling bone " + bone + "."); } else { foreach (Frame frame in Frames) { frame.Transformations[self.Index] = reference.SampleSourceTransformation(frame.Timestamp.Normalize(0f, GetTotalTime(), 0f, reference.GetTotalTime()), other.Index); } } } }