Merge 6015ddb79d7431bf9f5c3b3585a6c10061010d13 into f2b870a17f2a3a6c1b00e341b2b1d0216db0dc3b

This commit is contained in:
Michele Caini 2025-02-20 21:43:29 +01:00 committed by GitHub
commit bec1ada006
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1387,6 +1387,34 @@ void DocExporter::createDataFile(const Samples& samples, std::ostream& os, doc::
<< "\"h\": " << texture->height() << " },\n"
<< " \"scale\": \"1\"";
{
os << ",\n"
<< " \"documents\": [";
bool firstDoc = true;
std::set<doc::ObjectId> 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"