Hi @samodostal,
There are a few (potential) problems with this. While it’s feasible to “serialize” the contents (from the root node down) one file (and theoretically transfer this serialized version to another file by using some storage solution like xd-storage-helper
), you’ll encounter problems as soon as you try to “paste” your contents back in. This is because – due to the edit context restrictions – you won’t be able to insert nodes that are deeply nested. Since there’s no (realistic) way “around” these restrictions, I think that it is – unfortunately – not possible (at the moment) to fulfill your requirement with a plugin.
Apart from the edit context limitations, however, it should be relatively easy to achieve it:
- Serialize the scenegraph in file A – cf. Serialize scenegraph data to JSON?
- Save it to plugin storage – e.g., with the
xd-storage-helper
, cf. Helper library for key-value-based storage - Load said data in another file (again, via the helper)
- “Insert” or overwrite scenegraph with the serialized scenegraph (this is where the edit context will stop you)
Although this probably isn’t the answer you’ve hoped for, I still hope it helps,
Happy Coding,
Pablo