diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-08-19 20:19:23 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-08-19 20:19:23 +0300 |
commit | 43a9b3e4e490202837086f577f303b33315346db (patch) | |
tree | 78d1b4eed77decd81de6344c0a2b14ceb80780d3 /indra/newview/llvoavatar.cpp | |
parent | 6717f4a609e4c158b78069353c0a43fe2fe79af7 (diff) |
SL-17990 Give user a popup warning when they attach a rigged mesh object to an HUD
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c7afd3193c..1f7596807b 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -10665,7 +10665,7 @@ void LLVOAvatar::updateVisualComplexity() // with an avatar. This will be either an attached object or an animated // object. void LLVOAvatar::accountRenderComplexityForObject( - const LLViewerObject *attached_object, + LLViewerObject *attached_object, const F32 max_attachment_complexity, LLVOVolume::texture_cost_t& textures, U32& cost, @@ -10737,7 +10737,7 @@ void LLVOAvatar::accountRenderComplexityForObject( && attached_object->mDrawable) { textures.clear(); - + BOOL is_rigged_mesh = attached_object->isRiggedMesh(); mAttachmentSurfaceArea += attached_object->recursiveGetScaledSurfaceArea(); const LLVOVolume* volume = attached_object->mDrawable->getVOVolume(); @@ -10758,6 +10758,7 @@ void LLVOAvatar::accountRenderComplexityForObject( iter != child_list.end(); ++iter) { LLViewerObject* childp = *iter; + is_rigged_mesh |= childp->isRiggedMesh(); const LLVOVolume* chld_volume = dynamic_cast<LLVOVolume*>(childp); if (chld_volume) { @@ -10766,6 +10767,16 @@ void LLVOAvatar::accountRenderComplexityForObject( hud_object_complexity.objectsCount++; } } + if (is_rigged_mesh && !attached_object->mRiggedAttachedWarned) + { + LLSD args; + LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getAttachmentItemID()); + args["NAME"] = itemp ? itemp->getName() : LLTrans::getString("Unknown"); + args["POINT"] = LLTrans::getString(getTargetAttachmentPoint(attached_object)->getName()); + LLNotificationsUtil::add("RiggedMeshAttachedToHUD", args); + + attached_object->mRiggedAttachedWarned = true; + } hud_object_complexity.texturesCount += textures.size(); @@ -10870,7 +10881,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() attachment_iter != attachment->mAttachedObjects.end(); ++attachment_iter) { - const LLViewerObject* attached_object = attachment_iter->get(); + LLViewerObject* attached_object = attachment_iter->get(); accountRenderComplexityForObject(attached_object, max_attachment_complexity, textures, cost, hud_complexity_list); } |