mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 06:50:07 +00:00
add sprite user data when exporting documents
This commit is contained in:
parent
5900605549
commit
b0e5db7fb3
@ -1434,6 +1434,31 @@ void DocExporter::createDataFile(const Samples& samples,
|
||||
<< "\"h\": " << texture->height() << " },\n"
|
||||
<< " \"scale\": \"1\"";
|
||||
|
||||
{
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user