diff --git a/src/app/doc_exporter.cpp b/src/app/doc_exporter.cpp index 9eb62541a..9fae4748e 100644 --- a/src/app/doc_exporter.cpp +++ b/src/app/doc_exporter.cpp @@ -1434,6 +1434,31 @@ void DocExporter::createDataFile(const Samples& samples, << "\"h\": " << texture->height() << " },\n" << " \"scale\": \"1\""; + { + bool firstDoc = true; + + std::set includedSprites; + + for (auto& item : m_documents) { + if (firstDoc) + firstDoc = false; + else + os << ","; + + Doc* doc = item.doc; + Sprite* sprite = doc->sprite(); + + // Avoid including the same document more than once + if (includedSprites.find(sprite->id()) != includedSprites.end()) + continue; + includedSprites.insert(sprite->id()); + + os << "\n { \"name\": \"" << doc->name() << "\"" << sprite->userData() << " }"; + } + + os << "\n ]"; + } + // meta.frameTags if (m_listTags) { os << ",\n"