nodes: hopefully this makes the old projects compatible

This commit is contained in:
itsmattkc
2021-09-07 22:31:41 -07:00
parent bfe6ead5da
commit 2196173579
3 changed files with 12 additions and 1 deletions
+7
View File
@@ -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});
}
}
}
+3
View File
@@ -39,6 +39,9 @@ struct XMLNodeData {
struct SerializedConnection {
NodeInput input;
quintptr output_node;
/// Deprecated
QString output_param;
};
struct BlockLink {
+2 -1
View File
@@ -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();
}