From 046b1cc49841ae0f6cf1571858728d3430fc3e3b Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Fri, 10 Jun 2022 09:55:56 -0700 Subject: [PATCH] serializer: bypass bezier adj on keyframe type set --- app/node/keyframe.cpp | 10 +++++++--- app/node/keyframe.h | 1 + app/node/project/serializer/serializer220403.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/node/keyframe.cpp b/app/node/keyframe.cpp index eb6d5dea1..8a30ec560 100644 --- a/app/node/keyframe.cpp +++ b/app/node/keyframe.cpp @@ -99,7 +99,7 @@ const NodeKeyframe::Type &NodeKeyframe::type() const void NodeKeyframe::set_type(const NodeKeyframe::Type &type) { if (type_ != type) { - type_ = type; + set_type_no_bezier_adj(type); if (type_ == kBezier) { // Set some sane defaults if this keyframe existed in the track and was just changed @@ -120,11 +120,15 @@ void NodeKeyframe::set_type(const NodeKeyframe::Type &type) } } } - - emit TypeChanged(type_); } } +void NodeKeyframe::set_type_no_bezier_adj(const Type &type) +{ + type_ = type; + emit TypeChanged(type_); +} + const QPointF &NodeKeyframe::bezier_control_in() const { return bezier_control_in_; diff --git a/app/node/keyframe.h b/app/node/keyframe.h index ffe5a7728..e81de91f6 100644 --- a/app/node/keyframe.h +++ b/app/node/keyframe.h @@ -98,6 +98,7 @@ public: */ const Type& type() const; void set_type(const Type& type); + void set_type_no_bezier_adj(const Type& type); /** * @brief For bezier interpolation, the control point leading into this keyframe diff --git a/app/node/project/serializer/serializer220403.cpp b/app/node/project/serializer/serializer220403.cpp index 2075b6ce8..7dd4ae5c3 100644 --- a/app/node/project/serializer/serializer220403.cpp +++ b/app/node/project/serializer/serializer220403.cpp @@ -865,7 +865,7 @@ void ProjectSerializer220403::LoadKeyframe(QXmlStreamReader *reader, NodeKeyfram } else if (attr.name() == QStringLiteral("time")) { key->set_time(rational::fromString(attr.value().toString())); } else if (attr.name() == QStringLiteral("type")) { - key->set_type(static_cast(attr.value().toInt())); + key->set_type_no_bezier_adj(static_cast(attr.value().toInt())); } else if (attr.name() == QStringLiteral("inhandlex")) { key_in_handle.setX(attr.value().toDouble()); } else if (attr.name() == QStringLiteral("inhandley")) {