keyframeview: implemented transforming keyframe times to and from sequence time

Since the node graph can have transform cross nodes, input keyframes may occur
at a different times requiring transforming between sequence time and media
time. This commit implements such a mechanism in all UI classes that need it.
This commit is contained in:
itsmattkc
2020-03-26 19:17:46 +11:00
parent 592171cc31
commit 3399227b3a
27 changed files with 389 additions and 144 deletions
+8 -2
View File
@@ -6,6 +6,7 @@
#include <QWidget>
#include "common/qtutils.h"
#include "node/input.h"
KeyframeViewItem::KeyframeViewItem(NodeKeyframePtr key, QGraphicsItem *parent) :
QGraphicsRectItem(parent),
@@ -76,11 +77,16 @@ void KeyframeViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
}
}
void KeyframeViewItem::TimeTargetChangedEvent(Node *)
{
UpdatePos();
}
void KeyframeViewItem::UpdatePos()
{
double x_center = key_->time().toDouble() * scale_;
rational adjusted = GetAdjustedTime(key_->parent()->parentNode(), GetTimeTarget(), key_->time(), NodeParam::kOutput);
setPos(x_center, vert_center_);
setPos(adjusted.toDouble() * scale_, vert_center_);
}
void KeyframeViewItem::Redraw()