summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2017-06-20 15:04:11 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2017-06-20 15:04:11 +0100
commit4907e437c1a9523e3b3d098403da8c780c6345f9 (patch)
tree063ca27101f1317ec0ff850931d7b06a451d79bb /indra/newview/llvoavatar.cpp
parente0d6a6a40192caa5b9d62165da5f23a5ade6e4b0 (diff)
SL-731 - control avatar has pointer back to associated volume. Can use this link to find associated inventory item name for an animation in debug display.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index c1331bf521..c1b0f42c84 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3426,8 +3426,27 @@ void LLVOAvatar::updateDebugText()
if (motionp->getMinPixelArea() < getPixelArea())
{
std::string output;
- if (motionp->getName().empty())
+ std::string motion_name = motionp->getName();
+ if (motion_name.empty())
{
+ if (isControlAvatar())
+ {
+ LLControlAvatar *control_av = dynamic_cast<LLControlAvatar*>(this);
+ // Try to get name from inventory of associated object
+ LLVOVolume *volp = control_av->mVolp;
+ if (volp)
+ {
+ volp->requestInventory(); // AXON should be a no-op if already requested or fetched?
+ LLViewerInventoryItem* item = volp->getInventoryItemByAsset(motionp->getID());
+ if (item)
+ {
+ motion_name = item->getName();
+ }
+ }
+ }
+ }
+ if (motion_name.empty())
+ {
output = llformat("%s - %d",
gAgent.isGodlikeWithoutAdminMenuFakery() ?
motionp->getID().asString().c_str() :
@@ -3437,8 +3456,8 @@ void LLVOAvatar::updateDebugText()
else
{
output = llformat("%s - %d",
- motionp->getName().c_str(),
- (U32)motionp->getPriority());
+ motion_name.c_str(),
+ (U32)motionp->getPriority());
}
addDebugText(output);
}