timeline/project: block serializations to and from xml now include links
Fixes issue where blocks would become unlinked after copy/paste or save/load.
This commit is contained in:
+13
-3
@@ -4,13 +4,14 @@
|
||||
#include <QUndoCommand>
|
||||
#include <QXmlStreamReader>
|
||||
|
||||
#include "project/item/footage/stream.h"
|
||||
|
||||
class Block;
|
||||
class Node;
|
||||
class NodeParam;
|
||||
class NodeInput;
|
||||
class NodeOutput;
|
||||
|
||||
#include "project/item/footage/stream.h"
|
||||
|
||||
#define XMLAttributeLoop(reader, item) \
|
||||
QXmlStreamAttributes __attributes = reader->attributes(); \
|
||||
foreach (const QXmlStreamAttribute& item, __attributes)
|
||||
@@ -28,14 +29,23 @@ struct XMLNodeData {
|
||||
quintptr footage;
|
||||
};
|
||||
|
||||
struct BlockLink {
|
||||
Block* block;
|
||||
quintptr link;
|
||||
};
|
||||
|
||||
QHash<quintptr, NodeOutput*> output_ptrs;
|
||||
QList<SerializedConnection> desired_connections;
|
||||
QHash<quintptr, StreamPtr> footage_ptrs;
|
||||
QList<FootageConnection> footage_connections;
|
||||
QList<BlockLink> block_links;
|
||||
|
||||
};
|
||||
|
||||
void XMLConnectNodes(const QHash<quintptr, NodeOutput *> &output_ptrs, const QList<XMLNodeData::SerializedConnection> &desired_connections, QUndoCommand* command = nullptr);
|
||||
void XMLConnectNodes(const XMLNodeData& xml_node_data, QUndoCommand* command = nullptr);
|
||||
|
||||
bool XMLReadNextStartElement(QXmlStreamReader* reader);
|
||||
|
||||
void XMLLinkBlocks(const XMLNodeData& xml_node_data);
|
||||
|
||||
#endif // XMLREADLOOP_H
|
||||
|
||||
Reference in New Issue
Block a user