/// <summary> /// return the currently active animation frames /// </summary> /// <returns></returns> public List <IFrameRecord> GetFrameDebugInfo() { List <IFrameRecord> snapshots = new List <IFrameRecord>(); #if UNITY_EDITOR if (poseGenerator.CurrentPushIndex >= 0) { AnimationSampleTimeIndex animSampleTime = Binary.GetAnimationSampleTimeIndex(Time.timeIndex); if (animSampleTime.IsValid) { AnimationFrameDebugInfo lastFrame = new AnimationFrameDebugInfo() { sequenceIdentifier = poseGenerator.CurrentPushIndex, animName = animSampleTime.clipName, animFrame = animSampleTime.animFrameIndex, weight = poseGenerator.ApproximateTransitionProgression, blendOutDuration = BlendDuration, }; snapshots.Add(lastFrame); } } #endif return(snapshots); }
public static float DrawFragment(ref MotionSynthesizer synthesizer, SamplingTime samplingTime, Color color, float timeOffset, AffineTransform anchorTransform) { Assert.IsTrue(samplingTime.IsValid); AnimationSampleTimeIndex animSampleTime = synthesizer.Binary.GetAnimationSampleTimeIndex(samplingTime.timeIndex); string animFrameTxt = $"{animSampleTime.clipName} frame {animSampleTime.animFrameIndex}"; ref Binary binary = ref synthesizer.Binary;
public string GetFragmentDebugText(SamplingTime samplingTime, string fragmentName, float speedTimeOffset = -1.0f) { AnimationSampleTimeIndex animSampleTime = GetAnimationSampleTimeIndex(samplingTime.timeIndex); if (!animSampleTime.IsValid) { return($"<b>{fragmentName}:</b> Invalid fragment"); } string speedText = speedTimeOffset >= 0.0f ? $", <b>Speed:</b> {GetAverageTrajectorySpeed(samplingTime, speedTimeOffset):0.000} m/s" : ""; return($"<b>{fragmentName}:</b> {animSampleTime.clipName}, <b>Frame:</b> {animSampleTime.animFrameIndex}{speedText}"); }