From 2196173579ec63022482f2b232a5ad2f51274a94 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Tue, 7 Sep 2021 22:31:41 -0700 Subject: [PATCH] nodes: hopefully this makes the old projects compatible --- app/common/xmlutils.cpp | 7 +++++++ app/common/xmlutils.h | 3 +++ app/node/node.cpp | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/common/xmlutils.cpp b/app/common/xmlutils.cpp index e8a967cbf..88ad34474 100644 --- a/app/common/xmlutils.cpp +++ b/app/common/xmlutils.cpp @@ -22,6 +22,7 @@ #include "node/block/block.h" #include "node/factory.h" +#include "widget/nodeparamview/nodeparamviewundo.h" #include "widget/nodeview/nodeviewundo.h" namespace olive { @@ -34,8 +35,14 @@ void XMLConnectNodes(const XMLNodeData &xml_node_data, MultiUndoCommand *command if (out) { if (command) { command->add_child(new NodeEdgeAddCommand(out, con.input)); + + /// Deprecated: backwards compatibility only + command->add_child(new NodeSetValueHintCommand(con.input, {{}, -1, con.output_param})); } else { Node::ConnectEdge(out, con.input); + + /// Deprecated: backwards compatibility only + con.input.node()->SetValueHintForInput(con.input.input(), con.input.element(), {{}, -1, con.output_param}); } } } diff --git a/app/common/xmlutils.h b/app/common/xmlutils.h index 98e595c42..2e0640591 100644 --- a/app/common/xmlutils.h +++ b/app/common/xmlutils.h @@ -39,6 +39,9 @@ struct XMLNodeData { struct SerializedConnection { NodeInput input; quintptr output_node; + + /// Deprecated + QString output_param; }; struct BlockLink { diff --git a/app/node/node.cpp b/app/node/node.cpp index bf4f80453..0afc7ae7e 100644 --- a/app/node/node.cpp +++ b/app/node/node.cpp @@ -122,12 +122,13 @@ void Node::Load(QXmlStreamReader *reader, XMLNodeData& xml_node_data, uint versi } QString output_node_id; + QString output_param_id; while (XMLReadNextStartElement(reader)) { if ((version >= 210907 && reader->name() == QStringLiteral("output")) || reader->name() == QStringLiteral("node")) { output_node_id = reader->readElementText(); } else if (version < 210907 && reader->name() == QStringLiteral("output")) { - qDebug() << "FIXME: Convert output string to ValueHint"; + output_param_id = reader->readElementText(); } else { reader->skipCurrentElement(); }