diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-19 15:53:14 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2018-06-19 15:53:14 +0100 |
commit | 02c371e2cc0365c9051e37c50ec0fa028af39b6e (patch) | |
tree | 609dfefd4a17b92fa8b5c18d94aa5ebe890d7422 /indra/newview | |
parent | 389357994877bce18037bae716f77d472f2c635f (diff) |
MAINT-8766 - fix for appearance to XML crash, plus enablement logic
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6f6bf8678b..0fa7878258 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1629,6 +1629,11 @@ class LLAdvancedEnableAppearanceToXML : public view_listener_t { return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); } + else if (obj && obj->isAvatar()) + { + // This has to be a non-control avatar, because control avs are invisible and unclickable. + return gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + } else { return false; @@ -1642,12 +1647,33 @@ class LLAdvancedAppearanceToXML : public view_listener_t { std::string emptyname; LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); - LLVOAvatar* avatar = obj->getAvatar(); - if (!avatar) - { + LLVOAvatar *avatar = NULL; + if (obj) + { + if (obj->isAvatar()) + { + avatar = obj->asAvatar(); + } + else + { + // If there is a selection, find the associated + // avatar. Normally there's only one obvious choice. But + // what should be returned if the object is in an attached + // animated object? getAvatar() will give the skeleton of + // the animated object. getAvatarAncestor() will give the + // actual human-driven avatar. + avatar = obj->getAvatar(); + } + } + else + { + // If no selection, use the self avatar. avatar = gAgentAvatarp; - } - avatar->dumpArchetypeXML(emptyname); + } + if (avatar) + { + avatar->dumpArchetypeXML(emptyname); + } return true; } }; |