# Conflicts:
#	indra/newview/llfloaterdisplayname.cpp
#	indra/newview/lllogininstance.cpp
#	indra/newview/lloutfitslist.cpp
#	indra/newview/llpanelprofile.cpp
#	indra/newview/skins/default/xui/en/panel_profile_firstlife.xml
#	indra/newview/skins/default/xui/en/panel_profile_secondlife.xml
master
Ansariel 2025-09-27 11:39:25 +02:00
commit 2756f190b4
19 changed files with 426 additions and 357 deletions

View File

@ -1054,6 +1054,7 @@ void LLShaderMgr::clearShaderCache()
LL_INFOS("ShaderMgr") << "Removing shader cache at " << shader_cache << LL_ENDL;
const std::string mask = "*";
gDirUtilp->deleteFilesInDir(shader_cache, mask);
LLFile::rmdir(shader_cache);
mShaderBinaryCache.clear();
}

View File

@ -303,8 +303,11 @@ void LLAccordionCtrl::ctrlSetLeftTopAndSize(LLView* panel, S32 left, S32 top, S3
return;
LLRect panel_rect = panel->getRect();
panel_rect.setLeftTopAndSize( left, top, width, height);
panel->reshape( width, height, 1);
panel->setRect(panel_rect);
if (panel->getRect() != panel_rect)
{
panel->reshape( width, height, 1);
panel->setRect(panel_rect);
}
}
void LLAccordionCtrl::ctrlShiftVertical(LLView* panel, S32 delta)
@ -494,6 +497,7 @@ void LLAccordionCtrl::arrangeMultiple()
void LLAccordionCtrl::arrange()
{
LL_PROFILE_ZONE_SCOPED;
updateNoTabsHelpTextVisibility();
if (mAccordionTabs.empty())

View File

@ -248,10 +248,22 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw()
void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::reshape(S32 width, S32 height, bool called_from_parent /* = true */)
{
S32 header_height = mHeaderTextbox->getTextPixelHeight();
LLRect old_header_rect = mHeaderTextbox->getRect();
LLRect textboxRect(HEADER_TEXT_LEFT_OFFSET, (height + header_height) / 2, width, (height - header_height) / 2);
mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight());
mHeaderTextbox->setRect(textboxRect);
if (old_header_rect.getHeight() != textboxRect.getHeight()
|| old_header_rect.mLeft != textboxRect.mLeft
|| old_header_rect.mTop != textboxRect.mTop
|| old_header_rect.getWidth() > textboxRect.getWidth() // reducing header's width
|| (old_header_rect.getWidth() < textboxRect.getWidth() && old_header_rect.getWidth() < mHeaderTextbox->getTextPixelWidth()))
{
// Expensive text reflow
// Update if position or height changes
// Update if width reduces
// But do not update if text already fits and width increases (arguably LLTextBox::reshape should be smarter, not Accordion)
mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight());
mHeaderTextbox->setRect(textboxRect);
}
if (mHeaderTextbox->getTextPixelWidth() > mHeaderTextbox->getRect().getWidth())
{
@ -416,8 +428,11 @@ void LLAccordionCtrlTab::reshape(S32 width, S32 height, bool called_from_parent
LLRect headerRect;
headerRect.setLeftTopAndSize(0, height, width, HEADER_HEIGHT);
mHeader->setRect(headerRect);
mHeader->reshape(headerRect.getWidth(), headerRect.getHeight());
if (mHeader->getRect() != headerRect)
{
mHeader->setRect(headerRect);
mHeader->reshape(headerRect.getWidth(), headerRect.getHeight());
}
if (!mDisplayChildren)
return;
@ -932,7 +947,7 @@ void LLAccordionCtrlTab::adjustContainerPanel(const LLRect& child_rect)
show_hide_scrollbar(child_rect);
updateLayout(child_rect);
}
else
else if (mContainerPanel->getRect() != child_rect)
{
mContainerPanel->reshape(child_rect.getWidth(), child_rect.getHeight());
mContainerPanel->setRect(child_rect);

View File

@ -390,14 +390,17 @@ void LLEmojiDictionary::loadEmojis()
continue;
}
std::string category;
std::list<std::string> categories = loadCategories(sd);
if (categories.empty())
{
LL_WARNS() << "Skipping invalid emoji descriptor (no categories)" << LL_ENDL;
continue;
// Should already have a localization for "other symbols"
category = "other symbols";
}
else
{
category = categories.front();
}
std::string category = categories.front();
if (std::find(mSkipCategories.begin(), mSkipCategories.end(), category) != mSkipCategories.end())
{

View File

@ -1594,6 +1594,8 @@ void LLTextBase::reshape(S32 width, S32 height, bool called_from_parent)
// up-to-date mVisibleTextRect
updateRects();
// Todo: This might be wrong. updateRects already sets needsReflow conditionaly.
// Reflow is expensive and doing it at any twith can be too much.
needsReflow();
}
}

View File

@ -7220,7 +7220,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>40.0</real>
<real>90.0</real>
</map>
<key>LogMessages</key>
<map>

View File

@ -5340,6 +5340,7 @@ void LLAppViewer::purgeCache()
LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
LLVOCache::getInstance()->removeCache(LL_PATH_CACHE);
LLViewerShaderMgr::instance()->clearShaderCache();
purgeCefStaleCaches();
gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*");
}

View File

@ -56,6 +56,7 @@ private:
void onCacheSetName(bool success,
const std::string& reason,
const LLSD& content);
bool mIsLockedOut = false;
};
LLFloaterDisplayName::LLFloaterDisplayName(const LLSD& key) :
@ -72,8 +73,8 @@ void LLFloaterDisplayName::onOpen(const LLSD& key)
LLAvatarNameCache::get(gAgent.getID(), &av_name);
F64 now_secs = LLDate::now().secondsSinceEpoch();
if (now_secs < av_name.mNextUpdate)
mIsLockedOut = now_secs < av_name.mNextUpdate;
if (mIsLockedOut)
{
// ...can't update until some time in the future
// <FS:Ansariel> Display lock out date in SLT
@ -172,18 +173,19 @@ void LLFloaterDisplayName::onReset()
//}
//getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getUserName());
//if (getChild<LLUICtrl>("display_name_editor")->getEnabled())
//if (mIsLockedOut)
//{
// // UI is enabled, fill the first field
// getChild<LLUICtrl>("display_name_confirm")->clear();
// getChild<LLUICtrl>("display_name_confirm")->setFocus(true);
// // UI is disabled.
// // We should allow resetting even if user already
// // set a display name, enable save button
// getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName());
// getChild<LLUICtrl>("save_btn")->setEnabled(true);
//}
//else
//{
// // UI is disabled, looks like we should allow resetting
// // even if user already set a display name, enable save button
// getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName());
// getChild<LLUICtrl>("save_btn")->setEnabled(true);
// // UI is enabled, focus on the confirm field
// getChild<LLUICtrl>("display_name_confirm")->clear();
// getChild<LLUICtrl>("display_name_confirm")->setFocus(true);
//}
if (LLAvatarNameCache::getInstance()->hasNameLookupURL())
{

View File

@ -40,6 +40,10 @@
#include "llinventorymodel.h"
#include "llviewerinventory.h"
bool LLInventoryItemsList::sListIdleRegistered = false;
LLInventoryItemsList::all_list_t LLInventoryItemsList::sAllLists;
LLInventoryItemsList::all_list_t::iterator LLInventoryItemsList::sAllListIter;
LLInventoryItemsList::Params::Params()
{}
@ -55,13 +59,39 @@ LLInventoryItemsList::LLInventoryItemsList(const LLInventoryItemsList::Params& p
setNoFilteredItemsMsg(LLTrans::getString("InventoryNoMatchingItems"));
gIdleCallbacks.addFunction(idle, this);
sAllLists.push_back(this);
sAllListIter = sAllLists.begin();
if (!sListIdleRegistered)
{
sAllListIter = sAllLists.begin();
gIdleCallbacks.addFunction(idle, nullptr);
LLEventPumps::instance().obtain("LLApp").listen(
"LLInventoryItemsList",
[](const LLSD& stat)
{
std::string status(stat["status"]);
if (status != "running")
{
// viewer is starting shutdown
gIdleCallbacks.deleteFunction(idle, nullptr);
}
return false;
});
sListIdleRegistered = true;
}
}
// virtual
LLInventoryItemsList::~LLInventoryItemsList()
{
gIdleCallbacks.deleteFunction(idle, this);
auto it = std::find(sAllLists.begin(), sAllLists.end(), this);
if (it != sAllLists.end())
{
sAllLists.erase(it);
sAllListIter = sAllLists.begin();
}
}
void LLInventoryItemsList::refreshList(const LLInventoryModel::item_array_t item_array)
@ -111,25 +141,55 @@ void LLInventoryItemsList::updateSelection()
mSelectTheseIDs.clear();
}
void LLInventoryItemsList::doIdle()
bool LLInventoryItemsList::doIdle()
{
if (mRefreshState == REFRESH_COMPLETE) return;
if (mRefreshState == REFRESH_COMPLETE) return true; // done
if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty())
{
refresh();
mRefreshCompleteSignal(this, LLSD());
return false; // keep going
}
return true; // done
}
//static
void LLInventoryItemsList::idle(void* user_data)
{
LLInventoryItemsList* self = static_cast<LLInventoryItemsList*>(user_data);
if ( self )
{ // Do the real idle
self->doIdle();
if (sAllLists.empty())
return;
LL_PROFILE_ZONE_SCOPED;
using namespace std::chrono;
auto start = steady_clock::now();
const milliseconds time_limit = milliseconds(3);
const auto end_time = start + time_limit;
S32 max_update_count = 50;
if (sAllListIter == sAllLists.end())
{
sAllListIter = sAllLists.begin();
}
S32 updated = 0;
while (steady_clock::now() < end_time
&& updated < max_update_count
&& sAllListIter != sAllLists.end())
{
LLInventoryItemsList* list = *sAllListIter;
// Refresh is split into multiple separate parts,
// so keep repeating it while there is time, until done.
// Todo: refresh() split is pointless now?
// Or still useful for large folders?
if (list->doIdle())
{
// Item is done
++sAllListIter;
updated++;
}
}
}
@ -141,6 +201,7 @@ void LLInventoryItemsList::refresh()
{
case REFRESH_ALL:
{
LL_PROFILE_ZONE_NAMED("items_refresh_all");
mAddedItems.clear();
mRemovedItems.clear();
computeDifference(getIDs(), mAddedItems, mRemovedItems);
@ -163,6 +224,7 @@ void LLInventoryItemsList::refresh()
}
case REFRESH_LIST_ERASE:
{
LL_PROFILE_ZONE_NAMED("items_refresh_erase");
uuid_vec_t::const_iterator it = mRemovedItems.begin();
for (; mRemovedItems.end() != it; ++it)
{
@ -175,6 +237,7 @@ void LLInventoryItemsList::refresh()
}
case REFRESH_LIST_APPEND:
{
LL_PROFILE_ZONE_NAMED("items_refresh_append");
static const unsigned ADD_LIMIT = 25; // Note: affects perfomance
unsigned int nadded = 0;
@ -239,6 +302,7 @@ void LLInventoryItemsList::refresh()
}
case REFRESH_LIST_SORT:
{
LL_PROFILE_ZONE_NAMED("items_refresh_sort");
// Filter, sort, rearrange and notify parent about shape changes
filterItems(true, true);
@ -255,7 +319,10 @@ void LLInventoryItemsList::refresh()
break;
}
default:
break;
{
mRefreshState = REFRESH_COMPLETE;
break;
}
}
setForceRefresh(mRefreshState != REFRESH_COMPLETE);

View File

@ -59,7 +59,10 @@ public:
* Sets the flag indicating that the list needs to be refreshed even if it is
* not currently visible.
*/
void setForceRefresh(bool force_refresh) { mForceRefresh = force_refresh; }
void setForceRefresh(bool force_refresh)
{
mForceRefresh = force_refresh;
}
/**
* If refreshes when invisible.
@ -76,7 +79,7 @@ public:
* This is needed for example to filter items of the list hidden by closed
* accordion tab.
*/
virtual void doIdle(); // Real idle routine
bool doIdle(); // Real idle routine
static void idle(void* user_data); // static glue to doIdle()
protected:
@ -126,6 +129,12 @@ private:
bool mForceRefresh;
commit_signal_t mRefreshCompleteSignal;
// Update synchronization
typedef std::vector<LLInventoryItemsList*> all_list_t;
static all_list_t sAllLists;
static all_list_t::iterator sAllListIter;
static bool sListIdleRegistered;
};
#endif //LL_LLINVENTORYITEMSLIST_H

View File

@ -62,7 +62,7 @@
const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login
const F32 LOGIN_SRV_TIMEOUT_MIN = 10.f;
const F32 LOGIN_SRV_TIMEOUT_MAX = 120.f;
const F32 LOGIN_SRV_TIMEOUT_MAX = 180.f;
const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9f; // make DNS wait shorter then retry time
class LLLoginInstance::Disposable {

View File

@ -2677,7 +2677,7 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_
return MESH_OK;
}
LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, const LLMeshUploadThread::lod_sources_map_t& sources_list,
LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list_t& data, const LLMeshUploadThread::lod_sources_map_t& sources_list,
LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
const std::string & upload_url, LLUUID destination_folder_id, bool do_upload,
@ -2759,7 +2759,7 @@ void LLMeshUploadThread::DecompRequest::completed()
void LLMeshUploadThread::preStart()
{
//build map of LLModel refs to instances for callbacks
for (instance_list::iterator iter = mInstanceList.begin(); iter != mInstanceList.end(); ++iter)
for (instance_list_t::iterator iter = mInstanceList.begin(); iter != mInstanceList.end(); ++iter)
{
mInstance[iter->mModel].push_back(*iter);
}
@ -2808,6 +2808,179 @@ LLSD llsd_from_file(std::string filename)
return result;
}
void LLMeshUploadThread::packModelIntance(
LLModel* model,
LLMeshUploadThread::instance_list_t& instance_list,
std::string& model_name,
LLSD& res,
S32& mesh_num,
S32& texture_num,
S32& instance_num,
std::unordered_set<LLViewerTexture* >& textures,
std::unordered_map<LLViewerTexture*, S32> texture_index,
std::unordered_map<LLModel*, S32>& mesh_index,
std::vector<std::string>& texture_list_dest,
bool include_textures
)
{
LLMeshUploadData data;
data.mBaseModel = model;
LLModelInstance& first_instance = *(instance_list.begin());
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = first_instance.mLOD[i];
}
if (mesh_index.find(data.mBaseModel) == mesh_index.end())
{
// Have not seen this model before - create a new mesh_list entry for it.
if (model_name.empty())
{
model_name = data.mBaseModel->getName();
}
std::stringstream ostr;
LLModel::Decomposition& decomp =
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
decomp.mBaseHull = mHullMap[data.mBaseModel];
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints,
mLockScaleIfJointPosition,
LLModel::WRITE_BINARY,
false,
data.mBaseModel->mSubmodelID);
data.mAssetData = ostr.str();
std::string str = ostr.str();
res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(), str.end());
mesh_index[data.mBaseModel] = mesh_num;
mesh_num++;
}
// For all instances that use this model
for (instance_list_t::iterator instance_iter = instance_list.begin();
instance_iter != instance_list.end();
++instance_iter)
{
LLModelInstance& instance = *instance_iter;
LLSD instance_entry;
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = instance.mLOD[i];
}
LLVector3 pos, scale;
LLQuaternion rot;
LLMatrix4 transformation = instance.mTransform;
decomposeMeshMatrix(transformation, pos, rot, scale);
instance_entry["position"] = ll_sd_from_vector3(pos);
instance_entry["rotation"] = ll_sd_from_quaternion(rot);
instance_entry["scale"] = ll_sd_from_vector3(scale);
instance_entry["material"] = LL_MCODE_WOOD;
if (model->mSubmodelID)
{
// Should it really be different?
instance_entry["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_NONE);
}
else
{
instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
}
instance_entry["mesh"] = mesh_index[data.mBaseModel];
instance_entry["mesh_name"] = instance.mLabel;
instance_entry["face_list"] = LLSD::emptyArray();
// We want to be able to allow more than 8 materials...
//
S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), instance.mModel->getNumVolumeFaces());
for (S32 face_num = 0; face_num < end; face_num++)
{
// multiple faces can reuse the same material
LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
LLSD face_entry = LLSD::emptyMap();
LLViewerFetchedTexture* texture = NULL;
if (material.mDiffuseMapFilename.size())
{
texture = FindViewerTexture(material);
}
if ((texture != NULL) &&
(textures.find(texture) == textures.end()))
{
textures.insert(texture);
}
std::stringstream texture_str;
if (texture != NULL && include_textures && mUploadTextures)
{
if (texture->hasSavedRawImage())
{
LLImageDataLock lock(texture->getSavedRawImage());
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid())
{
texture_str.write((const char*)upload_file->getData(), upload_file->getDataSize());
}
}
}
if (texture != NULL &&
mUploadTextures &&
texture_index.find(texture) == texture_index.end())
{
texture_index[texture] = texture_num;
std::string str = texture_str.str();
res["texture_list"][texture_num] = LLSD::Binary(str.begin(), str.end());
// store indexes for error handling;
texture_list_dest.push_back(material.mDiffuseMapFilename);
texture_num++;
}
// Subset of TextureEntry fields.
if (texture != NULL && mUploadTextures)
{
face_entry["image"] = texture_index[texture];
face_entry["scales"] = 1.0;
face_entry["scalet"] = 1.0;
face_entry["offsets"] = 0.0;
face_entry["offsett"] = 0.0;
face_entry["imagerot"] = 0.0;
}
face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor);
face_entry["fullbright"] = material.mFullbright;
instance_entry["face_list"][face_num] = face_entry;
}
res["instance_list"][instance_num] = instance_entry;
instance_num++;
}
}
void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures)
{
LLSD result;
@ -2841,6 +3014,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>&
}
S32 mesh_num = 0;
S32 texture_num = 0;
S32 instance_num = 0;
std::unordered_set<LLViewerTexture* > textures;
std::unordered_map<LLViewerTexture*,S32> texture_index;
@ -2848,7 +3022,34 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>&
std::unordered_map<LLModel*,S32> mesh_index;
std::string model_name;
S32 instance_num = 0;
// If server gets a m1, m2, m3, m4 list, m1 becomes the root
// and the rest go as m4, m3, m2
// to counter that mInstance is sorted as m4, m3, m2, m1
// and we grab m1 from the end and send it first
LLModel* root_model = nullptr;
for (instance_map_t::reverse_iterator iter = mInstance.rbegin(); iter != mInstance.rend(); ++iter)
{
if (iter->first->mSubmodelID)
{
// Submodel can't be root
continue;
}
root_model = iter->first;
packModelIntance(
iter->first,
iter->second,
model_name,
res,
mesh_num,
texture_num,
instance_num,
textures,
texture_index,
mesh_index,
texture_list_dest,
include_textures);
break;
}
// Handle models, ignore submodels for now.
// Probably should pre-sort by mSubmodelID instead of running twice.
@ -2856,319 +3057,53 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>&
// deterministic order.
for (auto& iter : mInstance)
{
LLMeshUploadData data;
data.mBaseModel = iter.first;
if (data.mBaseModel->mSubmodelID)
if (iter.first->mSubmodelID)
{
// These are handled below to insure correct parenting order on creation
// due to map walking being based on model address (aka random)
continue;
}
LLModelInstance& first_instance = *(iter.second.begin());
for (S32 i = 0; i < 5; i++)
if (root_model == iter.first)
{
data.mModel[i] = first_instance.mLOD[i];
}
if (mesh_index.find(data.mBaseModel) == mesh_index.end())
{
// Have not seen this model before - create a new mesh_list entry for it.
if (model_name.empty())
{
model_name = data.mBaseModel->getName();
}
std::stringstream ostr;
LLModel::Decomposition& decomp =
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
decomp.mBaseHull = mHullMap[data.mBaseModel];
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints,
mLockScaleIfJointPosition,
LLModel::WRITE_BINARY,
false,
data.mBaseModel->mSubmodelID);
data.mAssetData = ostr.str();
std::string str = ostr.str();
res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(),str.end());
mesh_index[data.mBaseModel] = mesh_num;
mesh_num++;
}
// For all instances that use this model
for (instance_list::iterator instance_iter = iter.second.begin();
instance_iter != iter.second.end();
++instance_iter)
{
LLModelInstance& instance = *instance_iter;
LLSD instance_entry;
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = instance.mLOD[i];
}
LLVector3 pos, scale;
LLQuaternion rot;
LLMatrix4 transformation = instance.mTransform;
decomposeMeshMatrix(transformation,pos,rot,scale);
instance_entry["position"] = ll_sd_from_vector3(pos);
instance_entry["rotation"] = ll_sd_from_quaternion(rot);
instance_entry["scale"] = ll_sd_from_vector3(scale);
instance_entry["material"] = LL_MCODE_WOOD;
instance_entry["physics_shape_type"] = data.mModel[LLModel::LOD_PHYSICS].notNull() ? (U8)(LLViewerObject::PHYSICS_SHAPE_PRIM) : (U8)(LLViewerObject::PHYSICS_SHAPE_CONVEX_HULL);
instance_entry["mesh"] = mesh_index[data.mBaseModel];
instance_entry["mesh_name"] = instance.mLabel;
instance_entry["face_list"] = LLSD::emptyArray();
// We want to be able to allow more than 8 materials...
//
S32 end = llmin((S32)data.mBaseModel->mMaterialList.size(), instance.mModel->getNumVolumeFaces()) ;
for (S32 face_num = 0; face_num < end; face_num++)
{
// multiple faces can reuse the same material
LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
LLSD face_entry = LLSD::emptyMap();
LLViewerFetchedTexture *texture = NULL;
if (material.mDiffuseMapFilename.size())
{
texture = FindViewerTexture(material);
}
if ((texture != NULL) &&
(textures.find(texture) == textures.end()))
{
textures.insert(texture);
}
std::stringstream texture_str;
if (texture != NULL && include_textures && mUploadTextures)
{
if (texture->hasSavedRawImage())
{
LLImageDataLock lock(texture->getSavedRawImage());
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid())
{
texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
}
}
}
if (texture != NULL &&
mUploadTextures &&
texture_index.find(texture) == texture_index.end())
{
texture_index[texture] = texture_num;
std::string str = texture_str.str();
res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end());
// store indexes for error handling;
texture_list_dest.push_back(material.mDiffuseMapFilename);
texture_num++;
}
// Subset of TextureEntry fields.
if (texture != NULL && mUploadTextures)
{
face_entry["image"] = texture_index[texture];
face_entry["scales"] = 1.0;
face_entry["scalet"] = 1.0;
face_entry["offsets"] = 0.0;
face_entry["offsett"] = 0.0;
face_entry["imagerot"] = 0.0;
}
face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor);
face_entry["fullbright"] = material.mFullbright;
instance_entry["face_list"][face_num] = face_entry;
}
res["instance_list"][instance_num] = instance_entry;
instance_num++;
// Reached root, root was already packed and is last non-submodel
break;
}
packModelIntance(
iter.first,
iter.second,
model_name,
res,
mesh_num,
texture_num,
instance_num,
textures,
texture_index,
mesh_index,
texture_list_dest,
include_textures);
}
// Now handle the submodels.
for (auto& iter : mInstance)
{
LLMeshUploadData data;
data.mBaseModel = iter.first;
if (!data.mBaseModel->mSubmodelID)
if (!iter.first->mSubmodelID)
{
// These were handled above already...
//
continue;
}
LLModelInstance& first_instance = *(iter.second.begin());
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = first_instance.mLOD[i];
}
if (mesh_index.find(data.mBaseModel) == mesh_index.end())
{
// Have not seen this model before - create a new mesh_list entry for it.
if (model_name.empty())
{
model_name = data.mBaseModel->getName();
}
std::stringstream ostr;
LLModel::Decomposition& decomp =
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
decomp.mBaseHull = mHullMap[data.mBaseModel];
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints,
mLockScaleIfJointPosition,
LLModel::WRITE_BINARY,
false,
data.mBaseModel->mSubmodelID);
data.mAssetData = ostr.str();
std::string str = ostr.str();
res["mesh_list"][mesh_num] = LLSD::Binary(str.begin(),str.end());
mesh_index[data.mBaseModel] = mesh_num;
mesh_num++;
}
// For all instances that use this model
for (instance_list::iterator instance_iter = iter.second.begin();
instance_iter != iter.second.end();
++instance_iter)
{
LLModelInstance& instance = *instance_iter;
LLSD instance_entry;
for (S32 i = 0; i < 5; i++)
{
data.mModel[i] = instance.mLOD[i];
}
LLVector3 pos, scale;
LLQuaternion rot;
LLMatrix4 transformation = instance.mTransform;
decomposeMeshMatrix(transformation,pos,rot,scale);
instance_entry["position"] = ll_sd_from_vector3(pos);
instance_entry["rotation"] = ll_sd_from_quaternion(rot);
instance_entry["scale"] = ll_sd_from_vector3(scale);
instance_entry["material"] = LL_MCODE_WOOD;
instance_entry["physics_shape_type"] = (U8)(LLViewerObject::PHYSICS_SHAPE_NONE);
instance_entry["mesh"] = mesh_index[data.mBaseModel];
instance_entry["face_list"] = LLSD::emptyArray();
// We want to be able to allow more than 8 materials...
//
S32 end = llmin((S32)instance.mMaterial.size(), instance.mModel->getNumVolumeFaces()) ;
for (S32 face_num = 0; face_num < end; face_num++)
{
LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]];
LLSD face_entry = LLSD::emptyMap();
LLViewerFetchedTexture *texture = NULL;
if (material.mDiffuseMapFilename.size())
{
texture = FindViewerTexture(material);
}
if ((texture != NULL) &&
(textures.find(texture) == textures.end()))
{
textures.insert(texture);
}
std::stringstream texture_str;
if (texture != NULL && include_textures && mUploadTextures)
{
if (texture->hasSavedRawImage())
{
LLImageDataLock lock(texture->getSavedRawImage());
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
if (!upload_file.isNull() && upload_file->getDataSize())
{
texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
}
}
}
if (texture != NULL &&
mUploadTextures &&
texture_index.find(texture) == texture_index.end())
{
texture_index[texture] = texture_num;
std::string str = texture_str.str();
res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end());
texture_num++;
}
// Subset of TextureEntry fields.
if (texture != NULL && mUploadTextures)
{
face_entry["image"] = texture_index[texture];
face_entry["scales"] = 1.0;
face_entry["scalet"] = 1.0;
face_entry["offsets"] = 0.0;
face_entry["offsett"] = 0.0;
face_entry["imagerot"] = 0.0;
}
face_entry["diffuse_color"] = ll_sd_from_color4(material.mDiffuseColor);
face_entry["fullbright"] = material.mFullbright;
instance_entry["face_list"][face_num] = face_entry;
}
res["instance_list"][instance_num] = instance_entry;
instance_num++;
}
packModelIntance(
iter.first,
iter.second,
model_name,
res,
mesh_num,
texture_num,
instance_num,
textures,
texture_index,
mesh_index,
texture_list_dest,
include_textures);
}
if (model_name.empty()) model_name = "mesh model";
@ -3184,7 +3119,7 @@ void LLMeshUploadThread::generateHulls()
{
bool has_valid_requests = false ;
for (instance_map::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
for (instance_map_t::iterator iter = mInstance.begin(); iter != mInstance.end(); ++iter)
{
LLMeshUploadData data;
data.mBaseModel = iter->first;

View File

@ -696,11 +696,11 @@ public:
LLPointer<DecompRequest> mFinalDecomp;
volatile bool mPhysicsComplete;
typedef std::map<LLPointer<LLModel>, std::vector<LLVector3> > hull_map;
hull_map mHullMap;
typedef std::map<LLPointer<LLModel>, std::vector<LLVector3> > hull_map_t;
hull_map_t mHullMap;
typedef std::vector<LLModelInstance> instance_list;
instance_list mInstanceList;
typedef std::vector<LLModelInstance> instance_list_t;
instance_list_t mInstanceList;
// Upload should happen in deterministic order, so sort instances by model name.
struct LLUploadModelInstanceLess
@ -714,11 +714,11 @@ public:
}
// Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid
// running over the list twice in wholeModelToLLSD.
return a->mLabel < b->mLabel;
return a->mLabel > b->mLabel;
}
};
typedef std::map<LLPointer<LLModel>, instance_list, LLUploadModelInstanceLess> instance_map;
instance_map mInstance;
typedef std::map<LLPointer<LLModel>, instance_list_t, LLUploadModelInstanceLess> instance_map_t;
instance_map_t mInstance;
typedef std::map<std::string, std::string> lod_sources_map_t;
lod_sources_map_t mLodSources;
@ -737,7 +737,7 @@ public:
std::string mWholeModelUploadURL;
LLUUID mDestinationFolderId;
LLMeshUploadThread(instance_list& data, const lod_sources_map_t& sources_list,
LLMeshUploadThread(instance_list_t& data, const lod_sources_map_t& sources_list,
LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
const std::string & upload_url,
@ -773,6 +773,22 @@ public:
static LLViewerFetchedTexture* FindViewerTexture(const LLImportMaterial& material);
protected:
void packModelIntance(
LLModel* model,
LLMeshUploadThread::instance_list_t& instance_list,
std::string& model_name,
LLSD& res,
S32& mesh_num,
S32& texture_num,
S32& instance_num,
std::unordered_set<LLViewerTexture* > &textures,
std::unordered_map<LLViewerTexture*, S32> texture_index,
std::unordered_map<LLModel*, S32>& mesh_index,
std::vector<std::string>& texture_list_dest,
bool include_textures
);
private:
LLHandle<LLWholeModelFeeObserver> mFeeObserverHandle;
LLHandle<LLWholeModelUploadObserver> mUploadObserverHandle;

View File

@ -797,7 +797,7 @@ void LLModelPreview::rebuildUploadData()
for (U32 model_ind = 0; model_ind < mModel[lod].size(); ++model_ind)
{
bool found_model = false;
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
LLModelInstance& instance = *iter;
if (instance.mLOD[lod] == mModel[lod][model_ind])
@ -3069,7 +3069,7 @@ void LLModelPreview::updateStatusMessages()
total_submeshes[i] = 0;
}
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
LLModelInstance& instance = *iter;
@ -4609,7 +4609,7 @@ bool LLModelPreview::render()
if (!show_skin_weight)
{
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
LLModelInstance& instance = *iter;
@ -4709,7 +4709,7 @@ bool LLModelPreview::render()
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
LLModelInstance& instance = *iter;
@ -4840,7 +4840,7 @@ bool LLModelPreview::render()
// gGL.diffuseColor4f(1.f, 0.f, 0.f, 1.f); // <FS:Beq/> restore proper functionality
const LLVector4a scale(0.5f);
for (LLMeshUploadThread::instance_list::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
for (LLMeshUploadThread::instance_list_t::iterator iter = mUploadData.begin(); iter != mUploadData.end(); ++iter)
{
LLModelInstance& instance = *iter;

View File

@ -337,7 +337,7 @@ protected:
// Amount of triangles in original(base) model
U32 mMaxTriangleLimit;
LLMeshUploadThread::instance_list mUploadData;
LLMeshUploadThread::instance_list_t mUploadData;
std::set<LLViewerFetchedTexture * > mTextureSet;
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList;

View File

@ -818,6 +818,7 @@ void LLOutfitGallery::getCurrentCategories(uuid_vec_t& vcur)
void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
{
LL_PROFILE_ZONE_SCOPED;
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) return;

View File

@ -189,6 +189,7 @@ void LLOutfitsList::onOpen(const LLSD& info)
void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
{
LL_PROFILE_ZONE_SCOPED;
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) return;
@ -260,7 +261,9 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
if (AISAPI::isAvailable() && LLInventoryModelBackgroundFetch::instance().folderFetchActive())
{
// for reliability just fetch it whole, linked items included
// For reliability just fetch it whole, linked items included
// Todo: list is not warrantied to exist once callback arrives
// Fix it!
LLInventoryModelBackgroundFetch::instance().fetchFolderAndLinks(cat_id, [cat_id, list]
{
if (list)
@ -1153,6 +1156,7 @@ void LLOutfitListBase::onIdle(void* userdata)
void LLOutfitListBase::onIdleRefreshList()
{
LL_PROFILE_ZONE_SCOPED;
if (LLAppViewer::instance()->quitRequested())
{
mRefreshListState.CategoryUUID.setNull();
@ -1167,8 +1171,8 @@ void LLOutfitListBase::onIdleRefreshList()
}
// <FS:PP> Scale MAX_TIME with FPS to avoid overloading the viewer with function calls at low frame rates
// const F64 MAX_TIME = 0.05f;
F64 MAX_TIME = 0.05f;
// const F64 MAX_TIME = 0.005f;
F64 MAX_TIME = 0.005f;
constexpr F64 min_time = 0.001f;
constexpr F64 threshold_fps = 30.0;
const auto current_fps = LLTrace::get_frame_recording().getPeriodMedianPerSec(LLStatViewer::FPS, 1);

View File

@ -1026,7 +1026,7 @@ void LLPanelProfileSecondLife::resetData()
// Set default image and 1:1 dimensions for it
// <FS:Ansariel> Retain texture picker for profile images
//mSecondLifePic->setValue("Generic_Person_Large");
//mSecondLifePic->setValue(LLUUID());
mSecondLifePic->setImageAssetID(LLUUID::null);
mImageId = LLUUID::null;

View File

@ -1419,10 +1419,19 @@ bool LLTextureFetchWorker::doWork(S32 param)
else
{
mCanUseCapability = false;
mRegionRetryAttempt++;
mRegionRetryTimer.setTimerExpirySec(CAP_MISSING_EXPIRATION_DELAY);
// ex: waiting for caps
LL_INFOS_ONCE(LOG_TXT) << "Texture not available via HTTP: empty URL." << LL_ENDL;
if (gDisconnected)
{
// We lost connection or are shutting down.
mCanUseHTTP = false;
return true; // abort
}
else
{
// Ex: waiting for caps
mRegionRetryAttempt++;
mRegionRetryTimer.setTimerExpirySec(CAP_MISSING_EXPIRATION_DELAY);
LL_INFOS_ONCE(LOG_TXT) << "Texture not available via HTTP: empty URL." << LL_ENDL;
}
}
}
else