Allow exporting sculpts you created even with no metadata present

Cinders 2013-10-01 17:36:20 -06:00
parent 9750f48b14
commit 2b02fc2a57
1 changed files with 20 additions and 2 deletions

View File

@ -104,8 +104,26 @@ bool FSExportPermsCheck::canExportNode(LLSelectNode* node)
else if (sculpt_params)
{
LLViewerFetchedTexture* imagep = LLViewerTextureManager::getFetchedTexture(sculpt_params->getSculptTexture());
exportable = (imagep->mComment.find("a") != imagep->mComment.end()
&& LLUUID(imagep->mComment["a"]) == gAgentID);
if (imagep->mComment.find("a") != imagep->mComment.end())
{
exportable = (LLUUID(imagep->mComment["a"]) == gAgentID);
}
if (!exportable)
{
LLUUID asset_id = sculpt_params->getSculptTexture();
LLViewerInventoryCategory::cat_array_t cats;
LLViewerInventoryItem::item_array_t items;
LLAssetIDMatches asset_id_matches(asset_id);
gInventory.collectDescendentsIf(LLUUID::null, cats, items,
LLInventoryModel::INCLUDE_TRASH,
asset_id_matches);
for (S32 i = 0; i < items.count(); ++i)
{
const LLPermissions perms = items[i]->getPermissions();
exportable = perms.getCreator() == gAgentID;
}
}
if (!exportable)
LL_INFOS("export") << "Sculpt map has failed permissions check." << LL_ENDL;
}