Example #1
0
 private void MutateClipUsing(AnimationClip source, AnimationClip destination, IEnumerable <CurveKey> curvesToKeep)
 {
     AnimationUtility.GetCurveBindings(source)
     .Where(binding => curvesToKeep.Contains(CurveKey.FromBinding(binding)))
     .ToList()
     .ForEach(binding =>
     {
         var curve = AnimationUtility.GetEditorCurve(source, binding);
         AnimationUtility.SetEditorCurve(destination, binding, curve);
     });
 }
Example #2
0
 private HashSet <SampledCurveKey> FilterAnimationClip(AnimationClip clip)
 {
     return(new HashSet <SampledCurveKey>(AnimationUtility.GetCurveBindings(clip)
                                          .Select(binding => new SampledCurveKey(CurveKey.FromBinding(binding), AnimationUtility.GetEditorCurve(clip, binding).keys[0].value))
                                          .Where(sampledCurveKey => !sampledCurveKey.CurveKey.IsMuscleCurve())
                                          .Where(sampledCurveKey => sampledCurveKey.CurveKey.Path != "_ignored")
                                          .ToList()));
 }