From a1150ccfe40be968aae7b745569bfefd7396e8c3 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 4 Oct 2017 15:52:52 +0100 Subject: Improve debug output for fcurves Change-Id: I4a9044933b182a2e0eba745483f1b8bc214dcdba Reviewed-by: Paul Lemire --- src/animation/backend/fcurve_p.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/animation/backend/fcurve_p.h b/src/animation/backend/fcurve_p.h index 7ab1593d1..e9138d6a1 100644 --- a/src/animation/backend/fcurve_p.h +++ b/src/animation/backend/fcurve_p.h @@ -98,14 +98,27 @@ private: inline QDebug operator<<(QDebug dbg, const FCurve &fcurve) { QDebugStateSaver saver(dbg); - dbg << "Keyframe Count =" << fcurve.keyframeCount() << endl; + dbg << "Keyframe Count = " << fcurve.keyframeCount() << endl; for (int i = 0; i < fcurve.keyframeCount(); ++i) { const Keyframe &kf = fcurve.keyframe(i); - dbg << "t =" << fcurve.localTime(i) - << "value =" << kf.value - << "leftHandle =" << kf.leftControlPoint - << "rightHandle =" << kf.rightControlPoint - << endl; + switch (kf.interpolation) { + case QKeyFrame::BezierInterpolation: { + dbg << "t = " << fcurve.localTime(i) + << ", value = " << kf.value + << ", leftHandle = " << kf.leftControlPoint + << ", rightHandle = " << kf.rightControlPoint + << endl; + break; + } + + case QKeyFrame::ConstantInterpolation: + case QKeyFrame::LinearInterpolation: { + dbg << "t = " << fcurve.localTime(i) + << ", value = " << kf.value + << endl; + break; + } + } } return dbg; } -- cgit v1.2.3