From 7f2cf1fa9cf7c09af8eeab3aa077eb0a9922d631 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Thu, 30 May 2013 17:44:51 -0400 Subject: SH-4147 FIX Macro avatar hover gets reset on relog Hover minimum enforcement was getting triggered on relog for macro avatars before the joint offsets were applied when loading the avatar. Added code to verify that all attachments in COF have been rezzed, and all attached objects are not in the process of being rebuilt to the enforcement code. This should verify that we only apply the hover value enforcement when all rigged meshes are actually loaded before enforcing minimum hover value --- indra/newview/llappearancemgr.cpp | 9 +++++++ indra/newview/llappearancemgr.h | 2 ++ indra/newview/llviewerobject.cpp | 22 +++++++++++++++ indra/newview/llviewerobject.h | 1 + indra/newview/llvoavatar.cpp | 56 ++++++++++++++++++++++++++++++++------- 5 files changed, 80 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 30b6169b46..d817f10aee 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3250,6 +3250,15 @@ void LLAppearanceMgr::incrementCofVersion(LLHTTPClient::ResponderPtr responder_p LLHTTPClient::get(url, body, responder_ptr, headers, 30.0f); } +U32 LLAppearanceMgr::getNumAttachmentsInCOF() +{ + const LLUUID cof = getCOF(); + LLInventoryModel::item_array_t obj_items; + getDescendentsOfAssetType(cof, obj_items, LLAssetType::AT_OBJECT); + return obj_items.size(); +} + + std::string LLAppearanceMgr::getAppearanceServiceURL() const { if (gSavedSettings.getString("DebugAvatarAppearanceServiceURLOverride").empty()) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 3fb470ef14..b63e883426 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -206,6 +206,8 @@ public: void incrementCofVersion(LLHTTPClient::ResponderPtr responder_ptr = NULL); + U32 getNumAttachmentsInCOF(); + // *HACK Remove this after server side texture baking is deployed on all sims. void incrementCofVersionLegacy(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 064e96e394..63de1ab77a 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5038,6 +5038,28 @@ void LLViewerObject::clearDrawableState(U32 state, BOOL recursive) } } +BOOL LLViewerObject::isDrawableState(U32 state, BOOL recursive) const +{ + BOOL matches = FALSE; + if (mDrawable) + { + matches = mDrawable->isState(state); + } + if (recursive) + { + for (child_list_t::const_iterator iter = mChildList.begin(); + (iter != mChildList.end()) && matches; iter++) + { + LLViewerObject* child = *iter; + matches &= child->isDrawableState(state, recursive); + } + } + + return matches; +} + + + //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // RN: these functions assume a 2-level hierarchy //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 316dbce7d0..0390cbc5b0 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -394,6 +394,7 @@ public: void setDrawableState(U32 state, BOOL recursive = TRUE); void clearDrawableState(U32 state, BOOL recursive = TRUE); + BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const; // Called when the drawable shifts virtual void onShift(const LLVector4a &shift_vector) { } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6df5fab42b..310ff47cf5 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5220,24 +5220,60 @@ void LLVOAvatar::computeBodySize() LLAvatarAppearance::computeBodySize(); // Certain configurations of avatars can force the overall height (with offset) to go negative. - // Enforce a constraint to make sure we don't go below 0.1 meters. + // Enforce a constraint to make sure we don't go below 1.1 meters (server-enforced limit) // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground + const LLViewerObject * last_object = NULL; if (isSelf() && getWearableData() && isFullyLoaded() && !LLApp::isQuitting()) { - LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); - if (shape && !shape->getVolitile()) + // Do not force a hover parameter change while we have pending attachments, which may be mesh-based with + // joint offsets. + if (LLAppearanceMgr::instance().getNumAttachmentsInCOF() == getNumAttachments()) { - F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); - if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) + LLViewerWearable* shape = (LLViewerWearable*)getWearableData()->getWearable(LLWearableType::WT_SHAPE, 0); + BOOL loaded = TRUE; + for (attachment_map_t::const_iterator points_iter = mAttachmentPoints.begin(); + points_iter != mAttachmentPoints.end() && loaded; + ++points_iter) { - hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. - llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); + const LLViewerJointAttachment *attachment_pt = (*points_iter).second; + if (attachment_pt) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator attach_iter = attachment_pt->mAttachedObjects.begin(); attach_iter != attachment_pt->mAttachedObjects.end(); attach_iter++) + { + const LLViewerObject* object = (LLViewerObject*)*attach_iter; + if (object) + { + last_object = object; + llwarns << "attachment at point: " << (*points_iter).first << " object exists: " << object->getAttachmentItemID() << llendl; + loaded &=!object->isDrawableState(LLDrawable::REBUILD_ALL); + if (!loaded && shape && !shape->getVolitile()) + { + llwarns << "caught unloaded attachment! skipping enforcement" << llendl; + } + } + } + } + } - hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. + if (last_object) + { + LL_DEBUGS("Avatar") << "scanned at least one object!" << LL_ENDL; + } + if (loaded && shape && !shape->getVolitile()) + { + F32 hover_value = shape->getVisualParamWeight(AVATAR_HOVER); + if (hover_value < 0.0f && (mBodySize.mV[VZ] + hover_value < 1.1f)) + { + hover_value = -(mBodySize.mV[VZ] - 1.1f); // avoid floating point rounding making the above check continue to fail. + llassert(mBodySize.mV[VZ] + hover_value >= 1.1f); + + hover_value = llmin(hover_value, 0.0f); // don't force the hover value to be greater than 0. - mAvatarOffset.mV[VZ] = hover_value; - shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); + LL_DEBUGS("Avatar") << "changed hover value to: " << hover_value << " from: " << mAvatarOffset.mV[VZ] << LL_ENDL; + mAvatarOffset.mV[VZ] = hover_value; + shape->setVisualParamWeight(AVATAR_HOVER,hover_value, FALSE); + } } } } -- cgit v1.2.3 From c81b685b4217b3c321815e1993d39fb0b479a767 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 3 Jun 2013 16:10:46 -0400 Subject: Fix for sh-4221 Sometimes ctrl+q needed to be hit twice --- indra/newview/llfloatersidepanelcontainer.cpp | 15 ++++++++++----- indra/newview/llfloatersidepanelcontainer.h | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.cpp b/indra/newview/llfloatersidepanelcontainer.cpp index 13a9ba1695..02216420da 100755 --- a/indra/newview/llfloatersidepanelcontainer.cpp +++ b/indra/newview/llfloatersidepanelcontainer.cpp @@ -40,7 +40,8 @@ const std::string LLFloaterSidePanelContainer::sMainPanelName("main_panel"); LLFloaterSidePanelContainer::LLFloaterSidePanelContainer(const LLSD& key, const Params& params) -: LLFloater(key, params) +: LLFloater(key, params) +, mAppQuiting( false ) { // Prevent transient floaters (e.g. IM windows) from hiding // when this floater is clicked. @@ -56,7 +57,8 @@ BOOL LLFloaterSidePanelContainer::postBuild() } void LLFloaterSidePanelContainer::onConfirmationClose( const LLSD &confirm ) -{ +{ + mAppQuiting = confirm.asBoolean(); onClickCloseBtn(); } @@ -69,10 +71,12 @@ LLFloaterSidePanelContainer::~LLFloaterSidePanelContainer() void LLFloaterSidePanelContainer::onOpen(const LLSD& key) { getChild(sMainPanelName)->onOpen(key); + mAppQuiting = false; } -void LLFloaterSidePanelContainer::onClose(bool app_quitting) -{ - mForceCloseAfterVerify = true; + +void LLFloaterSidePanelContainer::onClose( bool app_quitting ) +{ + if (! mAppQuiting ) { mForceCloseAfterVerify = true; } LLSidepanelAppearance* panel = getSidePanelAppearance(); if ( panel ) { @@ -80,6 +84,7 @@ void LLFloaterSidePanelContainer::onClose(bool app_quitting) panel->onCloseFromAppearance( this ); } } + void LLFloaterSidePanelContainer::onClickCloseBtn() { LLSidepanelAppearance* panel = getSidePanelAppearance(); diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index dc85570f7e..f543cfd5c4 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -89,6 +89,8 @@ public: private: LLSidepanelAppearance* getSidePanelAppearance(); +private: + bool mAppQuiting; }; #endif // LL_LLFLOATERSIDEPANELCONTAINER_H -- cgit v1.2.3 From c5c2e7b405bbbcc3d1c1756e34c3069611f0e4a1 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 3 Jun 2013 18:08:48 -0400 Subject: SH-4035 spec change. If you revert after quiting, SL shutsdown. --- indra/newview/llfloatersidepanelcontainer.h | 3 ++- indra/newview/llsidepanelappearance.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersidepanelcontainer.h b/indra/newview/llfloatersidepanelcontainer.h index f543cfd5c4..b276821805 100755 --- a/indra/newview/llfloatersidepanelcontainer.h +++ b/indra/newview/llfloatersidepanelcontainer.h @@ -89,7 +89,8 @@ public: private: LLSidepanelAppearance* getSidePanelAppearance(); -private: + +public: bool mAppQuiting; }; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 70da576c83..775c148ea1 100755 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -151,11 +151,17 @@ bool LLSidepanelAppearance::callBackExitWithoutSaveViaClose(const LLSD& notifica toggleWearableEditPanel(FALSE); showOutfitEditPanel(); LLVOAvatarSelf::onCustomizeEnd( FALSE ); - mRevertSet = true; + if ( !mLLFloaterSidePanelContainer->mAppQuiting ) + { + mRevertSet = true; + } + else + { + mLLFloaterSidePanelContainer->closeFloater( true ); + } return false; } mLLFloaterSidePanelContainer->mForceCloseAfterVerify = false; - //mRevertSet = true; return false; } -- cgit v1.2.3