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
+5 -5
View File
@@ -221,7 +221,7 @@ public:
/**
* @brief Find a node of a certain type that this Node outputs to
*/
const T* FindOutputNode() const;
T* FindOutputNode();
/**
* @brief Convert a pointer to a value that can be sent between NodeParams
@@ -416,7 +416,7 @@ T* Node::ValueToPtr(const QVariant &ptr)
}
template<class T>
const Node* FindOutputNodeInternal(const Node* n) {
Node* FindOutputNodeInternal(Node* n) {
foreach (NodeEdgePtr edge, n->output()->edges()) {
Node* connected = edge->input()->parentNode();
T* cast_test = dynamic_cast<T*>(connected);
@@ -424,7 +424,7 @@ const Node* FindOutputNodeInternal(const Node* n) {
if (cast_test) {
return cast_test;
} else {
const Node* drill_test = FindOutputNodeInternal<T>(connected);
Node* drill_test = FindOutputNodeInternal<T>(connected);
if (drill_test) {
return drill_test;
}
@@ -435,9 +435,9 @@ const Node* FindOutputNodeInternal(const Node* n) {
}
template<class T>
const T* Node::FindOutputNode() const
T* Node::FindOutputNode()
{
return static_cast<const T*>(FindOutputNodeInternal<T>(this));
return static_cast<T*>(FindOutputNodeInternal<T>(this));
}
#endif // NODE_H