SL-12287 FIXED [Project Copy/Paste] Unable to paste texture from "local" storage

master
maxim_productengine 2019-11-15 17:58:32 +02:00
parent 0afe586856
commit 4fcf31e203
3 changed files with 25 additions and 2 deletions

View File

@ -1038,6 +1038,20 @@ LLUUID LLLocalBitmapMgr::getWorldID(LLUUID tracking_id)
return world_id;
}
bool LLLocalBitmapMgr::isLocalBitmap(LLUUID texture_id)
{
for (local_list_iter iter = mBitmapList.begin(); iter != mBitmapList.end(); iter++)
{
LLLocalBitmap* unit = *iter;
if (unit->getWorldID() == texture_id)
{
return true;
}
}
return false;
}
std::string LLLocalBitmapMgr::getFilename(LLUUID tracking_id)
{
std::string filename = "";

View File

@ -122,6 +122,8 @@ public:
LLUUID getWorldID(LLUUID tracking_id);
std::string getFilename(LLUUID tracking_id);
bool isLocalBitmap(LLUUID texture_id);
void feedScrollList(LLScrollListCtrl* ctrl);
void doUpdates();
void setNeedsRebake();

View File

@ -2923,8 +2923,15 @@ void LLPanelFace::onCopyFaces()
// Doesn't support local images!
if (id.isNull() || !LLPanelObject::canCopyTexture(id))
{
te_data["te"].erase("imageid");
te_data["te"]["imageid"] = LLUUID(gSavedSettings.getString( "DefaultObjectTexture" ));
if (LLLocalBitmapMgr::getInstance()->isLocalBitmap(id))
{
te_data["te"]["imageid"] = id;
}
else
{
te_data["te"].erase("imageid");
te_data["te"]["imageid"] = LLUUID(gSavedSettings.getString("DefaultObjectTexture"));
}
te_data["te"]["itemfullperm"] = true;
}
else