From 490cd8e5332e07836791baa3c8d0d02c39adceed Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sun, 3 Mar 2024 21:10:36 -0500 Subject: [PATCH] Remove pile of janky viewer side baking code to fix several crashes --- indra/llappearance/llavatarappearance.cpp | 21 +- indra/llappearance/llavatarappearance.h | 11 +- indra/llappearance/lldriverparam.cpp | 28 +- indra/llappearance/lldriverparam.h | 8 +- indra/llappearance/llpolymorph.cpp | 2 +- .../llappearance/llpolyskeletaldistortion.cpp | 2 +- indra/llappearance/lltexglobalcolor.cpp | 4 +- indra/llappearance/lltexglobalcolor.h | 2 +- indra/llappearance/lltexlayer.cpp | 2 +- indra/llappearance/lltexlayer.h | 2 +- indra/llappearance/lltexlayerparams.cpp | 37 +- indra/llappearance/lltexlayerparams.h | 14 +- indra/llappearance/llviewervisualparam.cpp | 2 +- indra/llappearance/llwearable.cpp | 16 +- indra/llappearance/llwearable.h | 6 +- indra/llcharacter/llcharacter.cpp | 14 +- indra/llcharacter/llcharacter.h | 7 +- indra/llcharacter/llvisualparam.cpp | 18 +- indra/llcharacter/llvisualparam.h | 8 +- indra/newview/CMakeLists.txt | 2 - indra/newview/llagent.cpp | 335 +----------- indra/newview/llagent.h | 27 - indra/newview/llagentwearables.cpp | 437 +--------------- indra/newview/llagentwearables.h | 40 +- indra/newview/llagentwearablesfetch.cpp | 233 --------- indra/newview/llagentwearablesfetch.h | 73 --- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llemote.cpp | 12 +- indra/newview/lllocalbitmaps.cpp | 2 +- indra/newview/llpaneleditwearable.cpp | 25 +- indra/newview/llphysicsmotion.cpp | 4 +- indra/newview/llscrollingpanelparam.cpp | 6 +- indra/newview/llscrollingpanelparambase.cpp | 2 +- indra/newview/llstartup.cpp | 26 +- indra/newview/lltextureview.cpp | 9 - indra/newview/lltoolmorph.cpp | 8 +- indra/newview/llviewermessage.cpp | 4 - indra/newview/llviewerobject.cpp | 2 +- indra/newview/llviewerregion.cpp | 45 +- indra/newview/llviewerregion.h | 2 - indra/newview/llviewertexlayer.cpp | 488 +----------------- indra/newview/llviewertexlayer.h | 51 +- indra/newview/llviewertexture.cpp | 3 +- indra/newview/llviewerwearable.cpp | 14 +- indra/newview/llviewerwearable.h | 4 +- indra/newview/llvoavatar.cpp | 237 +++------ indra/newview/llvoavatar.h | 12 +- indra/newview/llvoavatarself.cpp | 366 +------------ indra/newview/llvoavatarself.h | 30 +- indra/newview/rlvhandler.cpp | 2 +- 50 files changed, 263 insertions(+), 2444 deletions(-) delete mode 100644 indra/newview/llagentwearablesfetch.cpp delete mode 100644 indra/newview/llagentwearablesfetch.h diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 6d865804534..c9bb0f76e70 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -526,10 +526,7 @@ void LLAvatarAppearance::computeBodySize() F32 old_offset = mAvatarOffset.mV[VZ]; -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) - mAvatarOffset.mV[VZ] = getAvatarOffset(); -// [/RLVa:KB] -// mAvatarOffset.mV[VZ] = getVisualParamWeight(AVATAR_HOVER); + mAvatarOffset.mV[VZ] = getVisualParamWeight(AVATAR_HOVER); mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] - knee.mV[VZ] * hip_scale.mV[VZ] - @@ -556,7 +553,6 @@ void LLAvatarAppearance::computeBodySize() if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ]) { mBodySize = new_body_size; - bodySizeChanged(); #ifdef SHOW_DEBUG compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState); @@ -564,13 +560,6 @@ void LLAvatarAppearance::computeBodySize() } } -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -F32 LLAvatarAppearance::getAvatarOffset() /*const*/ -{ - return getVisualParamWeight(AVATAR_HOVER); -} -// [/RLVa:KB] - //----------------------------------------------------------------------------- // parseSkeletonFile() //----------------------------------------------------------------------------- @@ -1482,14 +1471,14 @@ BOOL LLAvatarAppearance::teToColorParams( ETextureIndex te, U32 *param_name ) return TRUE; } -void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color, bool upload_bake ) +void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_color) { U32 param_name[3]; if( teToColorParams( te, param_name ) ) { - setVisualParamWeight( param_name[0], new_color.mV[VX], upload_bake ); - setVisualParamWeight( param_name[1], new_color.mV[VY], upload_bake ); - setVisualParamWeight( param_name[2], new_color.mV[VZ], upload_bake ); + setVisualParamWeight( param_name[0], new_color.mV[VX]); + setVisualParamWeight( param_name[1], new_color.mV[VY]); + setVisualParamWeight( param_name[2], new_color.mV[VZ]); } } diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index f0cab4fa15c..1ba66d4a43b 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -110,7 +110,6 @@ class LLAvatarAppearance : public LLCharacter public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent virtual BOOL isValid() const; - virtual BOOL isUsingServerBakes() const = 0; virtual BOOL isUsingLocalAppearance() const = 0; virtual BOOL isEditingAppearance() const = 0; @@ -163,10 +162,6 @@ class LLAvatarAppearance : public LLCharacter static BOOL parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree); virtual void buildCharacter(); virtual BOOL loadAvatar(); -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) - virtual F32 getAvatarOffset() /*const*/; -// [/RLVa:KB] - virtual void bodySizeChanged() = 0; BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL allocateCharacterJoints(U32 num); @@ -255,7 +250,7 @@ class LLAvatarAppearance : public LLCharacter // Composites //-------------------------------------------------------------------- public: - virtual void invalidateComposite(LLTexLayerSet* layerset, bool upload_result) = 0; + virtual void invalidateComposite(LLTexLayerSet* layerset) = 0; /******************************************************************************** ** ** @@ -290,7 +285,7 @@ class LLAvatarAppearance : public LLCharacter // Clothing colors (convenience functions to access visual parameters) //-------------------------------------------------------------------- public: - void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color, bool upload_bake); + void setClothesColor(LLAvatarAppearanceDefines::ETextureIndex te, const LLColor4& new_color); LLColor4 getClothesColor(LLAvatarAppearanceDefines::ETextureIndex te); static BOOL teToColorParams(LLAvatarAppearanceDefines::ETextureIndex te, U32 *param_name); @@ -299,7 +294,7 @@ class LLAvatarAppearance : public LLCharacter //-------------------------------------------------------------------- public: LLColor4 getGlobalColor(const std::string& color_name ) const; - virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) = 0; + virtual void onGlobalColorChanged(const LLTexGlobalColor* global_color) = 0; protected: LLTexGlobalColor* mTexSkinColor; LLTexGlobalColor* mTexHairColor; diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 11cdda5806c..1c7c4907fa1 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -192,7 +192,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) mID = info->mID; info->mDriverParam = this; - setWeight(getDefaultWeight(), false); + setWeight(getDefaultWeight()); return TRUE; } @@ -203,7 +203,7 @@ BOOL LLDriverParam::setInfo(LLDriverParamInfo *info) return new LLDriverParam(*this); } -void LLDriverParam::setWeight(F32 weight, bool upload_bake) +void LLDriverParam::setWeight(F32 weight) { F32 min_weight = getMinWeight(); F32 max_weight = getMaxWeight(); @@ -262,7 +262,7 @@ void LLDriverParam::setWeight(F32 weight, bool upload_bake) driven_weight = driven_min; } - setDrivenWeight(drivenp,driven_weight,upload_bake); + setDrivenWeight(drivenp,driven_weight); continue; } else @@ -286,13 +286,13 @@ void LLDriverParam::setWeight(F32 weight, bool upload_bake) driven_weight = driven_min; } - setDrivenWeight(drivenp,driven_weight,upload_bake); + setDrivenWeight(drivenp,driven_weight); continue; } } driven_weight = getDrivenWeight(drivenp, mCurWeight); - setDrivenWeight(drivenp,driven_weight,upload_bake); + setDrivenWeight(drivenp,driven_weight); } } @@ -433,9 +433,9 @@ const LLViewerVisualParam* LLDriverParam::getDrivenParam(S32 index) const //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake ) +void LLDriverParam::setAnimationTarget( F32 target_value) { - LLVisualParam::setAnimationTarget(target_value, upload_bake); + LLVisualParam::setAnimationTarget(target_value); for(LLDrivenEntry& driven : mDriven) { @@ -444,16 +444,16 @@ void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake ) // this isn't normally necessary, as driver params handle interpolation of their driven params // but texture params need to know to assume their final value at beginning of interpolation - drivenp->mParam->setAnimationTarget(driven_weight, upload_bake); + drivenp->mParam->setAnimationTarget(driven_weight); } } //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLDriverParam::stopAnimating(bool upload_bake) +void LLDriverParam::stopAnimating() { - LLVisualParam::stopAnimating(upload_bake); + LLVisualParam::stopAnimating(); for(LLDrivenEntry& driven : mDriven) { @@ -529,7 +529,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) LLWearable *wearable = mAvatarAppearance->getWearableData()->getTopWearable(driver_type); if (wearable) { - wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID), false); + wearable->setVisualParamWeight(mID, wearable->getVisualParamWeight(mID)); } } } @@ -592,7 +592,7 @@ F32 LLDriverParam::getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight return driven_weight; } -void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake) +void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight) { bool use_self = false; if(mWearablep && @@ -609,10 +609,10 @@ void LLDriverParam::setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bo if (use_self) { // call setWeight through LLVOAvatarSelf so other wearables can be updated with the correct values - mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight, upload_bake); + mAvatarAppearance->setVisualParamWeight( (LLVisualParam*)driven->mParam, driven_weight); } else { - driven->mParam->setWeight( driven_weight, upload_bake); + driven->mParam->setWeight( driven_weight); } } diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h index 2305e45756b..93c94327df2 100644 --- a/indra/llappearance/lldriverparam.h +++ b/indra/llappearance/lldriverparam.h @@ -101,9 +101,9 @@ class alignas(16) LLDriverParam final : public LLViewerVisualParam // LLVisualParam Virtual functions /*virtual*/ void apply( ESex sex ) override {} // apply is called separately for each driven param. - /*virtual*/ void setWeight(F32 weight, bool upload_bake) override; - /*virtual*/ void setAnimationTarget( F32 target_value, bool upload_bake) override; - /*virtual*/ void stopAnimating(bool upload_bake) override; + /*virtual*/ void setWeight(F32 weight) override; + /*virtual*/ void setAnimationTarget( F32 target_value) override; + /*virtual*/ void stopAnimating() override; /*virtual*/ BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) override; /*virtual*/ void resetDrivenParams() override; /*virtual*/ bool isDriverParam() override { return true; } @@ -126,7 +126,7 @@ class alignas(16) LLDriverParam final : public LLViewerVisualParam protected: LLDriverParam(const LLDriverParam& pOther); F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight); - void setDrivenWeight(LLDrivenEntry *driven, F32 driven_weight, bool upload_bake); + void setDrivenWeight(LLDrivenEntry* driven, F32 driven_weight); LL_ALIGN_16(LLVector4a mDefaultVec); // temp holder diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index f49c534add7..b94abb3ac09 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -360,7 +360,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), false); + setWeight(getDefaultWeight()); LLAvatarAppearance* avatarp = mMesh->getAvatar(); for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList) diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 6cff2f8ac7f..20285ee437b 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -121,7 +121,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) } mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), false); + setWeight(getDefaultWeight()); for (LLPolySkeletalBoneInfo& bone_info : getInfo()->mBoneInfoList) { diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index b85bedd5578..caa29a5b4f2 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -96,9 +96,9 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) return new LLTexParamGlobalColor(*this); } -void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) +void LLTexParamGlobalColor::onGlobalColorChanged() { - mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake); + mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor); } //----------------------------------------------------------------------------- diff --git a/indra/llappearance/lltexglobalcolor.h b/indra/llappearance/lltexglobalcolor.h index 629ef22bf37..c10d022f161 100644 --- a/indra/llappearance/lltexglobalcolor.h +++ b/indra/llappearance/lltexglobalcolor.h @@ -79,7 +79,7 @@ class LLTexParamGlobalColor final : public LLTexLayerParamColor /*virtual*/ LLViewerVisualParam* cloneParam(LLWearable* wearable) const override; protected: LLTexParamGlobalColor(const LLTexParamGlobalColor& pOther) = default; - /*virtual*/ void onGlobalColorChanged(bool upload_bake) override; + /*virtual*/ void onGlobalColorChanged() override; private: LLTexGlobalColor* mTexGlobalColor; }; diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index a035abf2ce6..a947d69f0cf 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -149,7 +149,7 @@ BOOL LLTexLayerSetBuffer::renderTexLayerSet(LLRenderTarget* bound_target) getCompositeWidth(), getCompositeHeight(), bound_target ); gGL.flush(); - midRenderTexLayerSet(success, bound_target); + midRenderTexLayerSet(success); gAlphaMaskProgram.unbind(); diff --git a/indra/llappearance/lltexlayer.h b/indra/llappearance/lltexlayer.h index e5aefae2487..00084c7f640 100644 --- a/indra/llappearance/lltexlayer.h +++ b/indra/llappearance/lltexlayer.h @@ -274,7 +274,7 @@ class LLTexLayerSetBuffer : public virtual LLRefCount void pushProjection() const; void popProjection() const; virtual void preRenderTexLayerSet(); - virtual void midRenderTexLayerSet(BOOL success, LLRenderTarget* bound_target) {} + virtual void midRenderTexLayerSet(BOOL success) {} virtual void postRenderTexLayerSet(BOOL success); virtual S32 getCompositeOriginX() const = 0; virtual S32 getCompositeOriginY() const = 0; diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index c039df3ea53..fdc7462012e 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -174,7 +174,7 @@ BOOL LLTexLayerParamAlpha::getMultiplyBlend() const return ((LLTexLayerParamAlphaInfo *)getInfo())->mMultiplyBlend; } -void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake) +void LLTexLayerParamAlpha::setWeight(F32 weight) { if (mIsAnimating || mTexLayer == NULL) { @@ -192,35 +192,35 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, bool upload_bake) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake); + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); mTexLayer->invalidateMorphMasks(); } } } -void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, bool upload_bake) +void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value) { // do not animate dummy parameters if (mIsDummy) { - setWeight(target_value, upload_bake); + setWeight(target_value); return; } mTargetWeight = target_value; - setWeight(target_value, upload_bake); + setWeight(target_value); mIsAnimating = TRUE; if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } -void LLTexLayerParamAlpha::animate(F32 delta, bool upload_bake) +void LLTexLayerParamAlpha::animate(F32 delta) { if (mNext) { - mNext->animate(delta, upload_bake); + mNext->animate(delta); } } @@ -285,7 +285,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) if (mStaticImageTGA.isNull()) { // Don't load the image file until we actually need it the first time. Like now. - mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName); + mStaticImageTGA = LLTexLayerStaticImageList::getInstance()->getImageTGA(info->mStaticImageFileName); // We now have something in one of our caches LLTexLayerSet::sHasCaches |= mStaticImageTGA.notNull() ? TRUE : FALSE; @@ -321,7 +321,7 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mStaticImageRaw = NULL; mStaticImageRaw = new LLImageRaw; mStaticImageTGA->decodeAndProcess(mStaticImageRaw, info->mDomain, effective_weight); - mNeedsCreateTexture = TRUE; + mNeedsCreateTexture = TRUE; #ifdef SHOW_DEBUG LL_DEBUGS() << "Built Cached Alpha: " << info->mStaticImageFileName << ": (" << mStaticImageRaw->getWidth() << ", " << mStaticImageRaw->getHeight() << ") " << "Domain: " << info->mDomain << " Weight: " << effective_weight << LL_ENDL; #endif @@ -423,6 +423,7 @@ LLTexLayerParamColor::LLTexLayerParamColor(LLAvatarAppearance *appearance) { } + /*virtual*/ LLViewerVisualParam* LLTexLayerParamColor::cloneParam(LLWearable* wearable) const { return new LLTexLayerParamColor(*this); @@ -457,7 +458,7 @@ LLColor4 LLTexLayerParamColor::getNetColor() const } -void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake) +void LLTexLayerParamColor::setWeight(F32 weight) { if (mIsAnimating) { @@ -483,10 +484,10 @@ void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake) if ((mAvatarAppearance->getSex() & getSex()) && (mAvatarAppearance->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { - onGlobalColorChanged(upload_bake); + onGlobalColorChanged(); if (mTexLayer) { - mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet(), upload_bake); + mAvatarAppearance->invalidateComposite(mTexLayer->getTexLayerSet()); } } @@ -494,23 +495,23 @@ void LLTexLayerParamColor::setWeight(F32 weight, bool upload_bake) } } -void LLTexLayerParamColor::setAnimationTarget(F32 target_value, bool upload_bake) +void LLTexLayerParamColor::setAnimationTarget(F32 target_value) { // set value first then set interpolating flag to ignore further updates mTargetWeight = target_value; - setWeight(target_value, upload_bake); + setWeight(target_value); mIsAnimating = TRUE; if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } -void LLTexLayerParamColor::animate(F32 delta, bool upload_bake) +void LLTexLayerParamColor::animate(F32 delta) { if (mNext) { - mNext->animate(delta, upload_bake); + mNext->animate(delta); } } diff --git a/indra/llappearance/lltexlayerparams.h b/indra/llappearance/lltexlayerparams.h index e410d317258..664899dff80 100644 --- a/indra/llappearance/lltexlayerparams.h +++ b/indra/llappearance/lltexlayerparams.h @@ -76,9 +76,9 @@ class alignas(16) LLTexLayerParamAlpha final : public LLTexLayerParam // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) override {} - /*virtual*/ void setWeight(F32 weight, bool upload_bake) override; - /*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake) override; - /*virtual*/ void animate(F32 delta, bool upload_bake) override; + /*virtual*/ void setWeight(F32 weight) override; + /*virtual*/ void setAnimationTarget(F32 target_value) override; + /*virtual*/ void animate(F32 delta) override; // LLViewerVisualParam Virtual functions /*virtual*/ F32 getTotalDistortion() override { return 1.f; } @@ -159,9 +159,9 @@ class alignas(16) LLTexLayerParamColor : public LLTexLayerParam // LLVisualParam Virtual functions ///*virtual*/ BOOL parseData(LLXmlTreeNode* node); /*virtual*/ void apply( ESex avatar_sex ) override {} - /*virtual*/ void setWeight(F32 weight, bool upload_bake) override; - /*virtual*/ void setAnimationTarget(F32 target_value, bool upload_bake) override; - /*virtual*/ void animate(F32 delta, bool upload_bake) override; + /*virtual*/ void setWeight(F32 weight) override; + /*virtual*/ void setAnimationTarget(F32 target_value) override; + /*virtual*/ void animate(F32 delta) override; // LLViewerVisualParam Virtual functions @@ -177,7 +177,7 @@ class alignas(16) LLTexLayerParamColor : public LLTexLayerParam protected: LLTexLayerParamColor(const LLTexLayerParamColor& pOther) = default; - virtual void onGlobalColorChanged(bool upload_bake) {} + virtual void onGlobalColorChanged() {} private: LLVector4a mAvgDistortionVec; }; diff --git a/indra/llappearance/llviewervisualparam.cpp b/indra/llappearance/llviewervisualparam.cpp index cc9a9c6356d..8df32b7b48c 100644 --- a/indra/llappearance/llviewervisualparam.cpp +++ b/indra/llappearance/llviewervisualparam.cpp @@ -134,7 +134,7 @@ BOOL LLViewerVisualParam::setInfo(LLViewerVisualParamInfo *info) return FALSE; mInfo = info; mID = info->mID; - setWeight(getDefaultWeight(), false); + setWeight(getDefaultWeight()); return TRUE; } diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index dcb557d98dc..c9915990814 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -552,7 +552,7 @@ void LLWearable::revertValues() if(param) { F32 value = vp_pair.second; - setVisualParamWeight(id, value, true); + setVisualParamWeight(id, value); mSavedVisualParamMap[id] = param->getWeight(); } } @@ -645,13 +645,13 @@ void LLWearable::addVisualParam(LLVisualParam *param) } -void LLWearable::setVisualParamWeight(S32 param_index, F32 value, bool upload_bake) +void LLWearable::setVisualParamWeight(S32 param_index, F32 value) { auto iter = mVisualParamIndexMap.find(param_index); if(iter != mVisualParamIndexMap.end()) { LLVisualParam *wearable_param = iter->second; - wearable_param->setWeight(value, upload_bake); + wearable_param->setWeight(value); } else { @@ -690,12 +690,12 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) } } -void LLWearable::animateParams(F32 delta, bool upload_bake) +void LLWearable::animateParams(F32 delta) { for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { LLVisualParam *param = (LLVisualParam*)vp_pair.second; - param->animate(delta, upload_bake); + param->animate(delta); } } @@ -713,14 +713,14 @@ LLColor4 LLWearable::getClothesColor(S32 te) const return color; } -void LLWearable::setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake) +void LLWearable::setClothesColor( S32 te, const LLColor4& new_color) { U32 param_name[3]; if( LLAvatarAppearance::teToColorParams( (LLAvatarAppearanceDefines::ETextureIndex)te, param_name ) ) { for( U8 index = 0; index < 3; index++ ) { - setVisualParamWeight(param_name[index], new_color.mV[index], upload_bake); + setVisualParamWeight(param_name[index], new_color.mV[index]); } } } @@ -739,7 +739,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) S32 param_id = param->getID(); F32 weight = getVisualParamWeight(param_id); - avatarp->setVisualParamWeight( param_id, weight, false); + avatarp->setVisualParamWeight( param_id, weight); } } } diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h index 6080bb4d09e..561ab668962 100644 --- a/indra/llappearance/llwearable.h +++ b/indra/llappearance/llwearable.h @@ -95,14 +95,14 @@ class LLWearable void setLocalTextureObject(S32 index, LLLocalTextureObject <o); void addVisualParam(LLVisualParam *param); - void setVisualParamWeight(S32 index, F32 value, bool upload_bake); + void setVisualParamWeight(S32 index, F32 value); F32 getVisualParamWeight(S32 index) const; LLVisualParam* getVisualParam(S32 index) const; void getVisualParams(visual_param_vec_t &list); - void animateParams(F32 delta, bool upload_bake); + void animateParams(F32 delta); LLColor4 getClothesColor(S32 te) const; - void setClothesColor( S32 te, const LLColor4& new_color, bool upload_bake); + void setClothesColor( S32 te, const LLColor4& new_color); virtual void revertValues(); virtual void saveValues(); diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index c304816a08c..bc96d26ca68 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -287,13 +287,13 @@ void LLCharacter::removeAnimationData(std::string_view name) //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight, bool upload_bake) +BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 weight) { S32 index = which_param->getID(); auto index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { - index_iter->second->setWeight(weight, upload_bake); + index_iter->second->setWeight(weight); return TRUE; } return FALSE; @@ -302,7 +302,7 @@ BOOL LLCharacter::setVisualParamWeight(const LLVisualParam* which_param, F32 wei //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake) +BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight) { std::string tname(param_name); LLStringUtil::toLower(tname); @@ -310,7 +310,7 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool visual_param_name_map_t::iterator name_iter = mVisualParamNameMap.find(tableptr); if (name_iter != mVisualParamNameMap.end()) { - name_iter->second->setWeight(weight, upload_bake); + name_iter->second->setWeight(weight); return TRUE; } LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter: " << param_name << LL_ENDL; @@ -320,12 +320,12 @@ BOOL LLCharacter::setVisualParamWeight(const char* param_name, F32 weight, bool //----------------------------------------------------------------------------- // setVisualParamWeight() //----------------------------------------------------------------------------- -BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight, bool upload_bake) +BOOL LLCharacter::setVisualParamWeight(S32 index, F32 weight) { auto index_iter = mVisualParamIndexMap.find(index); if (index_iter != mVisualParamIndexMap.end()) { - index_iter->second->setWeight(weight, upload_bake); + index_iter->second->setWeight(weight); return TRUE; } LL_WARNS() << "LLCharacter::setVisualParamWeight() Invalid visual parameter index: " << index << LL_ENDL; @@ -394,7 +394,7 @@ void LLCharacter::clearVisualParamWeights() LLVisualParam* param = param_pair.second; if (param->isTweakable()) { - param->setWeight( param->getDefaultWeight(), false); + param->setWeight( param->getDefaultWeight()); } } } diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 00959dabff0..50389cb81c9 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -193,10 +193,9 @@ class LLCharacter void addVisualParam(LLVisualParam *param); void addSharedVisualParam(LLVisualParam *param); - virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake = false ); - virtual BOOL setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake = false); - virtual BOOL setVisualParamWeight(S32 index, F32 weight, bool upload_bake = false); - + virtual BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight); + virtual BOOL setVisualParamWeight(const char* param_name, F32 weight); + virtual BOOL setVisualParamWeight(S32 index, F32 weight); // get visual param weight by param or name F32 getVisualParamWeight(LLVisualParam *distortion); diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 9afd53d1077..9ce56b1f607 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -220,7 +220,7 @@ BOOL LLVisualParam::parseData(LLXmlTreeNode *node) //----------------------------------------------------------------------------- // setWeight() //----------------------------------------------------------------------------- -void LLVisualParam::setWeight(F32 weight, bool upload_bake) +void LLVisualParam::setWeight(F32 weight) { if (mIsAnimating) { @@ -238,19 +238,19 @@ void LLVisualParam::setWeight(F32 weight, bool upload_bake) if (mNext) { - mNext->setWeight(weight, upload_bake); + mNext->setWeight(weight); } } //----------------------------------------------------------------------------- // setAnimationTarget() //----------------------------------------------------------------------------- -void LLVisualParam::setAnimationTarget(F32 target_value, bool upload_bake) +void LLVisualParam::setAnimationTarget(F32 target_value) { // don't animate dummy parameters if (mIsDummy) { - setWeight(target_value, upload_bake); + setWeight(target_value); mTargetWeight = mCurWeight; return; } @@ -270,7 +270,7 @@ void LLVisualParam::setAnimationTarget(F32 target_value, bool upload_bake) if (mNext) { - mNext->setAnimationTarget(target_value, upload_bake); + mNext->setAnimationTarget(target_value); } } @@ -295,24 +295,24 @@ void LLVisualParam::clearNextParam() //----------------------------------------------------------------------------- // animate() //----------------------------------------------------------------------------- -void LLVisualParam::animate( F32 delta, bool upload_bake) +void LLVisualParam::animate( F32 delta) { if (mIsAnimating) { F32 new_weight = ((mTargetWeight - mCurWeight) * delta) + mCurWeight; - setWeight(new_weight, upload_bake); + setWeight(new_weight); } } //----------------------------------------------------------------------------- // stopAnimating() //----------------------------------------------------------------------------- -void LLVisualParam::stopAnimating(bool upload_bake) +void LLVisualParam::stopAnimating() { if (mIsAnimating && isTweakable()) { mIsAnimating = FALSE; - setWeight(mTargetWeight, upload_bake); + setWeight(mTargetWeight); } } diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 5525285184f..27c8ba2e6d9 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -120,10 +120,10 @@ class LLVisualParam //virtual BOOL parseData( LLXmlTreeNode *node ) = 0; virtual void apply( ESex avatar_sex ) = 0; // Default functions - virtual void setWeight(F32 weight, bool upload_bake); - virtual void setAnimationTarget( F32 target_value, bool upload_bake); - virtual void animate(F32 delta, bool upload_bake); - virtual void stopAnimating(bool upload_bake); + virtual void setWeight(F32 weight); + virtual void setAnimationTarget( F32 target_value); + virtual void animate(F32 delta); + virtual void stopAnimating(); virtual BOOL linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params); virtual void resetDrivenParams(); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c81b247e858..49fa4980db2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -114,7 +114,6 @@ set(viewer_SOURCE_FILES fslslpreproc.cpp fslslpreprocviewer.cpp groupchatlistener.cpp - llagentwearablesfetch.cpp llaccountingcostmanager.cpp lladdgridhandler.cpp llaisapi.cpp @@ -851,7 +850,6 @@ set(viewer_HEADER_FILES fslslpreprocviewer.h groupchatlistener.h llaccountingcost.h - llagentwearablesfetch.h llaccountingcostmanager.h lladdgridhandler.h llaisapi.h diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 647b50b940c..c4abb95d701 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -481,9 +481,6 @@ LLAgent::LLAgent() : mCrouch(false), mVoiceConnected(false), -#if OPENSIM - mAppearanceSerialNum(0), -#endif mMouselookModeInSignal(NULL), mMouselookModeOutSignal(NULL) { @@ -1044,28 +1041,6 @@ void LLAgent::standUp() // [/RLVa:KB] } -void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) -{ - LL_INFOS() << "called" << LL_ENDL; - - // Old-style appearance entering a server-bake region. - if (isAgentAvatarValid() && - !gAgentAvatarp->isUsingServerBakes() && - (mRegionp->getCentralBakeVersion()>0)) - { - LL_INFOS() << "update requested due to region transition" << LL_ENDL; - LLAppearanceMgr::instance().requestServerAppearanceUpdate(); - } - // new-style appearance entering a non-bake region, - // need to check for existence of the baking service. - else if (isAgentAvatarValid() && - gAgentAvatarp->isUsingServerBakes() && - mRegionp->getCentralBakeVersion()==0) - { - gAgentAvatarp->checkForUnsupportedServerBakeAppearance(); - } -} - void LLAgent::changeParcels() { LL_DEBUGS("AgentLocation") << "Calling ParcelChanged callbacks" << LL_ENDL; @@ -1096,6 +1071,7 @@ void LLAgent::capabilityReceivedCallback(const LLUUID ®ion_id, LLViewerRegion } } + //----------------------------------------------------------------------------- // setRegion() //----------------------------------------------------------------------------- @@ -1200,16 +1176,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp) // [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a LLFloaterMove::sUpdateMovementStatus(); // [/RLVa:KB] - // server. - if (mRegionp->capabilitiesReceived()) - { - handleServerBakeRegionTransition(mRegionp->getRegionID()); - } - else - { - // Need to handle via callback after caps arrive. - mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1)); - } LL_DEBUGS("AgentLocation") << "Calling RegionChanged callbacks" << LL_ENDL; mRegionChangedSignal(); @@ -4153,82 +4119,6 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **) } */ -//static -void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data) -{ - gAgentQueryManager.mNumPendingQueries--; - if (gAgentQueryManager.mNumPendingQueries == 0) - { - selfStopPhase("fetch_texture_cache_entries"); - } - - if (!isAgentAvatarValid() || gAgentAvatarp->isDead()) - { - LL_WARNS() << "No avatar for user in cached texture update!" << LL_ENDL; - return; - } - - if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) - { - // ignore baked textures when in customize mode - return; - } - - S32 query_id; - mesgsys->getS32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, query_id); - - S32 num_texture_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_WearableData); - - - S32 num_results = 0; - for (S32 texture_block = 0; texture_block < num_texture_blocks; texture_block++) - { - LLUUID texture_id; - U8 texture_index; - - mesgsys->getUUIDFast(_PREHASH_WearableData, _PREHASH_TextureID, texture_id, texture_block); - mesgsys->getU8Fast(_PREHASH_WearableData, _PREHASH_TextureIndex, texture_index, texture_block); - - - if ((S32)texture_index < TEX_NUM_INDICES ) - { - const LLAvatarAppearanceDictionary::TextureEntry *texture_entry = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)texture_index); - if (texture_entry) - { - EBakedTextureIndex baked_index = texture_entry->mBakedTextureIndex; - - if (gAgentQueryManager.mActiveCacheQueries[baked_index] == query_id) - { - if (texture_id.notNull()) - { - //LL_INFOS() << "Received cached texture " << (U32)texture_index << ": " << texture_id << LL_ENDL; - gAgentAvatarp->setCachedBakedTexture((ETextureIndex)texture_index, texture_id); - //gAgentAvatarp->setTETexture( LLVOAvatar::sBakedTextureIndices[texture_index], texture_id ); - gAgentQueryManager.mActiveCacheQueries[baked_index] = 0; - num_results++; - } - else - { - // no cache of this bake. request upload. - gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index), true); - } - } - } - } - } - LL_INFOS() << "Received cached texture response for " << num_results << " textures." << LL_ENDL; - gAgentAvatarp->outputRezTiming("Fetched agent wearables textures from cache. Will now load them"); - - gAgentAvatarp->updateMeshTextures(); - - if (gAgentQueryManager.mNumPendingQueries == 0) - { - // RN: not sure why composites are disabled at this point - gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); - gAgent.sendAgentSetAppearance(); - } -} - BOOL LLAgent::anyControlGrabbed() const { for (U32 i = 0; i < TOTAL_CONTROLS; i++) @@ -5130,213 +5020,6 @@ void LLAgent::requestLeaveGodMode() sendReliableMessage(); } -// For debugging, trace agent state at times appearance message are sent out. -void LLAgent::dumpSentAppearance(const std::string& dump_prefix) -{ - std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml"); - - LLAPRFile outfile; - std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename); - outfile.open(fullpath, LL_APR_WB ); - apr_file_t* file = outfile.getFileHandle(); - if (!file) - { - return; - } - else - { - LL_DEBUGS("Avatar") << "dumping sent appearance message to " << fullpath << LL_ENDL; - } - - LLVisualParam* appearance_version_param = gAgentAvatarp->getVisualParam(11000); - if (appearance_version_param) - { - F32 value = appearance_version_param->getWeight(); - dump_visual_param(file, appearance_version_param, value); - } - for (const auto& iter : LLAvatarAppearance::getDictionary()->getTextures()) - { - const ETextureIndex index = iter.first; - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter.second; - if (texture_dict->mIsBakedTexture) - { - LLTextureEntry* entry = gAgentAvatarp->getTE((U8) index); - const LLUUID& uuid = entry->getID(); - apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", index, uuid.asString().c_str()); - } - } -} - -//----------------------------------------------------------------------------- -// sendAgentSetAppearance() -//----------------------------------------------------------------------------- -void LLAgent::sendAgentSetAppearance() -{ -#if OPENSIM - if (gAgentQueryManager.mNumPendingQueries > 0) - { - return; - } - - LLViewerRegion* region = getRegion(); - if (!isAgentAvatarValid() || gAgentAvatarp->isEditingAppearance() - || (region && region->getCentralBakeVersion())) - { - return; - } - // At this point we have a complete appearance to send and are in a non-baking region. - // DRANO FIXME - //gAgentAvatarp->setIsUsingServerBakes(FALSE); - S32 sb_count, host_count, both_count, neither_count; - gAgentAvatarp->bakedTextureOriginCounts(sb_count, host_count, both_count, neither_count); - if (both_count != 0 || neither_count != 0) - { - LL_WARNS() << "bad bake texture state " << sb_count << "," << host_count << "," << both_count << "," << neither_count << LL_ENDL; - } - if (sb_count != 0 && host_count == 0) - { - gAgentAvatarp->setIsUsingServerBakes(true); - } - else if (sb_count == 0 && host_count != 0) - { - gAgentAvatarp->setIsUsingServerBakes(false); - } - else if (sb_count + host_count > 0) - { - LL_WARNS() << "unclear baked texture state, not sending appearance" << LL_ENDL; - return; - } - - - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; - //dumpAvatarTEs( "sendAgentSetAppearance()" ); - - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_AgentSetAppearance); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, getID()); - msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); - - // correct for the collision tolerance (to make it look like the - // agent is actually walking on the ground/object) - // NOTE -- when we start correcting all of the other Havok geometry - // to compensate for the COLLISION_TOLERANCE ugliness we will have - // to tweak this number again - LLVector3 body_size = gAgentAvatarp->mBodySize; - if (region && region->simulatorFeaturesReceived() && region->avatarHoverHeightEnabled()) { - body_size += gAgentAvatarp->mAvatarOffset; - } - msg->addVector3Fast(_PREHASH_Size, body_size); - - // To guard against out of order packets - // Note: always start by sending 1. This resets the server's count. 0 on the server means "uninitialized" - mAppearanceSerialNum++; - msg->addU32Fast(_PREHASH_SerialNum, mAppearanceSerialNum ); - - // is texture data current relative to wearables? - // KLW - TAT this will probably need to check the local queue. - BOOL textures_current = gAgentAvatarp->areTexturesCurrent(); - - if(textures_current) - { - for(U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++ ) - { - const ETextureIndex texture_index = LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - // if we're not wearing a skirt, we don't need the texture to be baked - if (texture_index == TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) - { - continue; - } - // if we're not wearing a universal - if ( (texture_index >= TEX_LEFT_ARM_BAKED && texture_index <= TEX_AUX3_BAKED) && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_UNIVERSAL)) - { - continue; // ignore universal that is also optional - } - // IMG_DEFAULT_AVATAR means not baked. 0 index should be ignored for baked textures - if (!gAgentAvatarp->isTextureDefined(texture_index, 0)) - { - LL_DEBUGS("Avatar") << "texture not current for baked " << (S32)baked_index << " local " << (S32)texture_index << LL_ENDL; - textures_current = FALSE; - break; - } - } - } - - // only update cache entries if we have all our baked textures - - // FIXME DRANO need additional check for not in appearance editing - // mode, if still using local composites need to set using local - // composites to false, and update mesh textures. - if (textures_current) - { - bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); - std::string dump_prefix = gAgentAvatarp->getFullname() + "_sent_appearance"; - if (enable_verbose_dumps) - { - dumpSentAppearance(dump_prefix); - } - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; - for (U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++) - { - BOOL generate_valid_hash = TRUE; - if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLAvatarAppearanceDefines::EBakedTextureIndex)baked_index)) - { - generate_valid_hash = FALSE; - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; - } - - if (baked_index == BAKED_SKIRT && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) - { - LL_DEBUGS("Avatar") << "Not caching baked texture for unworn skirt." << LL_ENDL; - generate_valid_hash = FALSE; - } - - const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); - if (hash.notNull()) - { - ETextureIndex texture_index = LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex((EBakedTextureIndex) baked_index); - msg->nextBlockFast(_PREHASH_WearableData); - msg->addUUIDFast(_PREHASH_CacheID, hash); - msg->addU8Fast(_PREHASH_TextureIndex, (U8)texture_index); - } - } - msg->nextBlockFast(_PREHASH_ObjectData); - gAgentAvatarp->sendAppearanceMessage( gMessageSystem ); - } - else - { - // If the textures aren't baked, send NULL for texture IDs - // This means the baked texture IDs on the server will be untouched. - // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs - msg->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, nullptr, 0); - } - - - S32 transmitted_params = 0; - for (LLViewerVisualParam* param = (LLViewerVisualParam*)gAgentAvatarp->getFirstVisualParam(); - param; - param = (LLViewerVisualParam*)gAgentAvatarp->getNextVisualParam()) - { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE || - param->getGroup() == VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT - { - msg->nextBlockFast(_PREHASH_VisualParam ); - - // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. - const F32 param_value = param->getWeight(); - const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); - msg->addU8Fast(_PREHASH_ParamValue, new_weight ); - transmitted_params++; - } - } - - LL_INFOS() << "Avatar XML num VisualParams transmitted = " << transmitted_params << LL_ENDL; - sendReliableMessage(); -#endif -} - void LLAgent::sendAgentDataUpdateRequest() { gMessageSystem->newMessageFast(_PREHASH_AgentDataUpdateRequest); @@ -5644,22 +5327,6 @@ void LLAgent::renderAutoPilotTarget() } /********************************************************************************/ -LLAgentQueryManager gAgentQueryManager; - -LLAgentQueryManager::LLAgentQueryManager() : - mWearablesCacheQueryID(0), - mNumPendingQueries(0), - mUpdateSerialNum(0) -{ - for (U32 i = 0; i < BAKED_NUM_INDICES; i++) - { - mActiveCacheQueries[i] = 0; - } -} - -LLAgentQueryManager::~LLAgentQueryManager() -{ -} //----------------------------------------------------------------------------- // LLTeleportRequest diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index adb1c27e486..cb50c96cf2c 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -738,7 +738,6 @@ class LLAgent final : public LLOldEvents::LLObservable void handleTeleportFinished(); void handleTeleportFailed(); - void handleServerBakeRegionTransition(const LLUUID& region_id); static void addTPNearbyChatSeparator(); static void onCapabilitiesReceivedAfterTeleport(); @@ -877,9 +876,6 @@ class LLAgent final : public LLOldEvents::LLObservable private: BOOL mShowAvatar; // Should we render the avatar? -#if OPENSIM - U32 mAppearanceSerialNum; -#endif //-------------------------------------------------------------------- // Rendering state bitmap helpers @@ -981,8 +977,6 @@ class LLAgent final : public LLOldEvents::LLObservable public: void sendMessage(); // Send message to this agent's region void sendReliableMessage(); - void dumpSentAppearance(const std::string& dump_prefix); - void sendAgentSetAppearance(); void sendAgentDataUpdateRequest(); void sendAgentUserInfoRequest(); @@ -1004,7 +998,6 @@ class LLAgent final : public LLOldEvents::LLObservable static void processAgentGroupDataUpdate(LLMessageSystem *msg, void **); static void processAgentDropGroup(LLMessageSystem *msg, void **); static void processScriptControlChange(LLMessageSystem *msg, void **); - static void processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data); /** Messaging ** ** @@ -1051,24 +1044,4 @@ inline bool operator==(const LLGroupData &a, const LLGroupData &b) return (a.mID == b.mID); } -class LLAgentQueryManager -{ - friend class LLAgent; - friend class LLAgentWearables; - -public: - LLAgentQueryManager(); - virtual ~LLAgentQueryManager(); - - BOOL hasNoPendingQueries() const { return getNumPendingQueries() == 0; } - S32 getNumPendingQueries() const { return mNumPendingQueries; } -private: - S32 mNumPendingQueries; - S32 mWearablesCacheQueryID; - U32 mUpdateSerialNum; - S32 mActiveCacheQueries[LLAvatarAppearanceDefines::BAKED_NUM_INDICES]; -}; - -extern LLAgentQueryManager gAgentQueryManager; - #endif diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index a354be336dc..d3f2f230904 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -56,8 +56,6 @@ #include "rlvlocks.h" // [/RLVa:KB] -#include "llagentwearablesfetch.h" -#include "llviewernetwork.h" LLAgentWearables gAgentWearables; BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; @@ -229,13 +227,6 @@ void LLAgentWearables::initClass() void LLAgentWearables::setAvatarObject(LLVOAvatarSelf *avatar) { llassert(avatar); -#ifdef OPENSIM - if (!LLGridManager::getInstance()->isInSecondlife()) - { - avatar->outputRezTiming("Sending wearables request"); - sendAgentWearablesRequest(); - } -#endif setAvatarAppearance(avatar); } @@ -268,24 +259,9 @@ void LLAgentWearables::AddWearableToAgentInventoryCallback::fire(const LLUUID& i gAgentWearables.addWearabletoAgentInventoryDone(mType, mIndex, inv_item, mWearable); - if (mTodo & CALL_UPDATE) - { - gAgentWearables.sendAgentWearablesUpdate(); - } - if (mTodo & CALL_RECOVERDONE) - { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.recoverMissingWearableDone(); - } - /* * Do this for every one in the loop */ - if (mTodo & CALL_CREATESTANDARDDONE) - { - LLAppearanceMgr::instance().addCOFItemLink(inv_item); - gAgentWearables.createStandardWearablesDone(mType, mIndex); - } if (mTodo & CALL_MAKENEWOUTFITDONE) { gAgentWearables.makeNewOutfitDone(mType, mIndex); @@ -341,7 +317,7 @@ void LLAgentWearables::addWearabletoAgentInventoryDone(const LLWearableType::ETy gInventory.notifyObservers(); } -void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, +void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name) { LLViewerWearable* old_wearable = getViewerWearable(type, index); @@ -388,11 +364,6 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 { // Add a new inventory item (shouldn't ever happen here) U32 todo = AddWearableToAgentInventoryCallback::CALL_NONE; - if (send_update) - { - todo |= AddWearableToAgentInventoryCallback::CALL_UPDATE; - } - LLPointer<LLInventoryCallback> cb = new AddWearableToAgentInventoryCallback( LLPointer<LLRefCount>(NULL), @@ -404,12 +375,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 return; } - gAgentAvatarp->wearableUpdated(type, true); - - if (send_update) - { - sendAgentWearablesUpdate(); - } + gAgentAvatarp->wearableUpdated(type); } } @@ -486,8 +452,6 @@ void LLAgentWearables::revertWearable(const LLWearableType::EType type, const U3 { wearable->revertValues(); } - - gAgent.sendAgentSetAppearance(); } void LLAgentWearables::saveAllWearables() @@ -500,10 +464,8 @@ void LLAgentWearables::saveAllWearables() for (S32 i=0; i < LLWearableType::WT_COUNT; i++) { for (U32 j=0; j < getWearableCount((LLWearableType::EType)i); j++) - saveWearable((LLWearableType::EType)i, j, FALSE); + saveWearable((LLWearableType::EType)i, j); } - - gAgent.sendAgentSetAppearance(); } // Called when the user changes the name of a wearable inventory item that is currently being worn. @@ -532,7 +494,6 @@ void LLAgentWearables::setWearableName(const LLUUID& item_id, const std::string& old_wearable->setName(old_name); setWearable((LLWearableType::EType)i,j,new_wearable); - sendAgentWearablesUpdate(); break; } } @@ -674,8 +635,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) { if (isAgentAvatarValid()) { - const bool upload_result = (bool)removed; - gAgentAvatarp->wearableUpdated(wearable->getType(), upload_result); + gAgentAvatarp->wearableUpdated(wearable->getType()); } LLWearableData::wearableUpdated(wearable, removed); @@ -697,7 +657,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) { LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL; wearable->setDefinitionVersion(22); - saveWearable(wearable->getType(),index, TRUE); + saveWearable(wearable->getType(),index); } } @@ -1035,7 +995,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { eraseWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } // clearWearableType(type); @@ -1051,14 +1011,10 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { eraseWearable(old_wearable); - old_wearable->removeFromAvatar(TRUE); + old_wearable->removeFromAvatar(); } } - queryWearableCache(); - - // Update the server - updateServer(); gInventory.notifyObservers(); } @@ -1083,16 +1039,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LLPointer<LLInventoryItem> new_item = items[i]; const LLWearableType::EType type = new_wearable->getType(); - if(!gAgent.getRegion()->bakesOnMeshEnabled()) - { - if(type == LLWearableType::WT_UNIVERSAL) - { - LL_DEBUGS("Avatar") << "Universal wearable not supported on this region - ignoring." << LL_ENDL; - mismatched++; - continue; - } - } - if (type < 0 || type>=LLWearableType::WT_COUNT) { LL_WARNS() << "invalid type " << type << LL_ENDL; @@ -1223,7 +1169,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; - checkWearablesLoaded(); // [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-09-22 (Catznip-2.2) if (!mInitialWearablesLoaded) { @@ -1239,9 +1184,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Then update the avatar based on the copied params. gAgentAvatarp->updateVisualParams(); - queryWearableCache(); - updateServer(); - gAgentAvatarp->dumpAvatarTEs("setWearableOutfit"); LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL; @@ -1367,11 +1309,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // LL_INFOS() << "Replaced current element 0 for type " << type // << " size is now " << getWearableCount(type) << LL_ENDL; // } -// -// //LL_INFOS() << "LLVOAvatar::setWearableItem()" << LL_ENDL; -// queryWearableCache(); -// -// updateServer(); //} // User has picked "remove from avatar" from a menu. @@ -1573,8 +1510,6 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra // [/RLVa:KB] } - - // Returns false if the given wearable is already topmost/bottommost // (depending on closer_to_body parameter). bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_body) const @@ -1591,7 +1526,6 @@ bool LLAgentWearables::canMoveWearable(const LLUUID& item_id, bool closer_to_bod BOOL LLAgentWearables::areWearablesLoaded() const { - checkWearablesLoaded(); return mWearablesLoaded; } @@ -1604,7 +1538,7 @@ bool LLAgentWearables::canWearableBeRemoved(const LLViewerWearable* wearable) co return !(((type == LLWearableType::WT_SHAPE) || (type == LLWearableType::WT_SKIN) || (type == LLWearableType::WT_HAIR) || (type == LLWearableType::WT_EYES)) && (getWearableCount(type) <= 1) ); } -void LLAgentWearables::animateAllWearableParams(F32 delta, bool upload_bake) +void LLAgentWearables::animateAllWearableParams(F32 delta) { for( S32 type = 0; type < LLWearableType::WT_COUNT; ++type ) { @@ -1614,7 +1548,7 @@ void LLAgentWearables::animateAllWearableParams(F32 delta, bool upload_bake) llassert(wearable); if (wearable) { - wearable->animateParams(delta, upload_bake); + wearable->animateParams(delta); } } } @@ -1814,357 +1748,4 @@ void LLAgentWearables::notifyLoadingFinished() mCOFChangeInProgress = false; mLoadedSignal(); } -void LLAgentWearables::sendAgentWearablesUpdate() -{ - // First make sure that we have inventory items for each wearable - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - for (U32 index=0; index < getWearableCount((LLWearableType::EType)type); ++index) - { - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type,index); - if (wearable) - { - if (wearable->getItemID().isNull()) - { - LLPointer<LLInventoryCallback> cb = - new AddWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - (LLWearableType::EType)type, - index, - wearable, - AddWearableToAgentInventoryCallback::CALL_NONE); - addWearableToAgentInventory(cb, wearable); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, - wearable->getItemID()); - } - } - } - } - - // Then make sure the inventory is in sync with the avatar. - gInventory.notifyObservers(); - - // Send the AgentIsNowWearing - gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); - - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - - LL_DEBUGS() << "sendAgentWearablesUpdate()" << LL_ENDL; - // MULTI-WEARABLE: DEPRECATED: HACK: index to 0- server database tables don't support concept of multiwearables. - for (S32 type=0; type < LLWearableType::WT_COUNT; ++type) - { - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - - U8 type_u8 = (U8)type; - gMessageSystem->addU8Fast(_PREHASH_WearableType, type_u8); - - LLViewerWearable* wearable = getViewerWearable((LLWearableType::EType)type, 0); - if (wearable) - { - //LL_INFOS() << "Sending wearable " << wearable->getName() << LL_ENDL; - LLUUID item_id = wearable->getItemID(); - const LLViewerInventoryItem *item = gInventory.getItem(item_id); - if (item && item->getIsLinkType()) - { - // Get the itemID that this item points to. i.e. make sure - // we are storing baseitems, not their links, in the database. - item_id = item->getLinkedUUID(); - } - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); - } - else - { - //LL_INFOS() << "Not wearing wearable type " << LLWearableType::getTypeName((LLWearableType::EType)i) << LL_ENDL; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, LLUUID::null); - } - - LL_DEBUGS() << " " << LLWearableType::getInstance()->getTypeLabel((LLWearableType::EType)type) << ": " << (wearable ? wearable->getAssetID() : LLUUID::null) << LL_ENDL; - } - gAgent.sendReliableMessage(); -} - -void LLAgentWearables::sendAgentWearablesRequest() -{ - gMessageSystem->newMessageFast(_PREHASH_AgentWearablesRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gAgent.sendReliableMessage(); -} - -BOOL LLAgentWearables::itemUpdatePending(const LLUUID& item_id) const -{ - return mItemsAwaitingWearableUpdate.find(item_id) != mItemsAwaitingWearableUpdate.end(); -} - -U32 LLAgentWearables::itemUpdatePendingCount() const -{ - return mItemsAwaitingWearableUpdate.size(); -} - -// MULTI-WEARABLE: DEPRECATED (see backwards compatibility) -// static -// ! BACKWARDS COMPATIBILITY ! When we stop supporting viewer1.23, we can assume -// that viewers have a Current Outfit Folder and won't need this message, and thus -// we can remove/ignore this whole function. EXCEPT gAgentWearables.notifyLoadingStarted -void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data) -{ - // We should only receive this message a single time. Ignore subsequent AgentWearablesUpdates - // that may result from AgentWearablesRequest having been sent more than once. - if (mInitialWearablesUpdateReceived) - return; - - if (isAgentAvatarValid()) - { - gAgentAvatarp->startPhase("process_initial_wearables_update"); - gAgentAvatarp->outputRezTiming("Received initial wearables update"); - } - - // notify subscribers that wearables started loading. See EXT-7777 - // *TODO: find more proper place to not be called from deprecated method. - // Seems such place is found: LLInitialWearablesFetch::processContents() - gAgentWearables.notifyLoadingStarted(); - - mInitialWearablesUpdateReceived = true; - - LLUUID agent_id; - gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); - - if (isAgentAvatarValid() && (agent_id == gAgentAvatarp->getID())) - { - gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum); - - const S32 NUM_BODY_PARTS = 4; - S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData); - if (num_wearables < NUM_BODY_PARTS) - { - // Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin). - // The fact that they don't have any here (only a dummy is sent) implies that either: - // 1. This account existed before we had wearables - // 2. The database has gotten messed up - // 3. This is the account's first login (i.e. the wearables haven't been generated yet). - return; - } - - // Get the UUID of the current outfit folder (will be created if it doesn't exist) - const LLUUID current_outfit_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); - LLInitialWearablesFetch* outfit = new LLInitialWearablesFetch(current_outfit_id); - - //LL_DEBUGS() << "processAgentInitialWearablesUpdate()" << LL_ENDL; - // Add wearables - // MULTI-WEARABLE: DEPRECATED: Message only supports one wearable per type, will be ignored in future. - gAgentWearables.mItemsAwaitingWearableUpdate.clear(); - for (S32 i = 0; i < num_wearables; i++) - { - // Parse initial wearables data from message system - U8 type_u8 = 0; - gMessageSystem->getU8Fast(_PREHASH_WearableData, _PREHASH_WearableType, type_u8, i); - if (type_u8 >= LLWearableType::WT_COUNT) - { - continue; - } - const LLWearableType::EType type = (LLWearableType::EType) type_u8; - - LLUUID item_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_ItemID, item_id, i); - - LLUUID asset_id; - gMessageSystem->getUUIDFast(_PREHASH_WearableData, _PREHASH_AssetID, asset_id, i); - if (asset_id.isNull()) - { - LLViewerWearable::removeFromAvatar(type, FALSE); - } - else - { - LLAssetType::EType asset_type = LLWearableType::getInstance()->getAssetType(type); - if (asset_type == LLAssetType::AT_NONE) - { - continue; - } - - // MULTI-WEARABLE: DEPRECATED: this message only supports one wearable per type. Should be ignored in future versions - - // Store initial wearables data until we know whether we have the current outfit folder or need to use the data. - LLInitialWearablesFetch::InitialWearableData wearable_data(type, item_id, asset_id); - outfit->add(wearable_data); - } - - LL_DEBUGS() << " " << LLWearableType::getInstance()->getTypeLabel(type) << LL_ENDL; - } - - // Get the complete information on the items in the inventory and set up an observer - // that will trigger when the complete information is fetched. - outfit->startFetch(); - if (outfit->isFinished()) - { - // everything is already here - call done. - outfit->done(); - } - else - { - // it's all on it's way - add an observer, and the inventory - // will call done for us when everything is here. - gInventory.addObserver(outfit); - } - - } -} - -// Normally, all wearables referred to "AgentWearablesUpdate" will correspond to actual assets in the -// database. If for some reason, we can't load one of those assets, we can try to reconstruct it so that -// the user isn't left without a shape, for example. (We can do that only after the inventory has loaded.) -void LLAgentWearables::recoverMissingWearable(const LLWearableType::EType type, U32 index) -{ - // Try to recover by replacing missing wearable with a new one. - LLNotificationsUtil::add("ReplacedMissingWearable"); - LL_DEBUGS() << "Wearable " << LLWearableType::getInstance()->getTypeLabel(type) << " could not be downloaded. Replaced inventory item with default wearable." << LL_ENDL; - LLViewerWearable* new_wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp); - - setWearable(type,index,new_wearable); - //new_wearable->writeToAvatar(TRUE); - - // Add a new one in the lost and found folder. - // (We used to overwrite the "not found" one, but that could potentially - // destory content.) JC - const LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - LLPointer<LLInventoryCallback> cb = - new AddWearableToAgentInventoryCallback( - LLPointer<LLRefCount>(NULL), - type, - index, - new_wearable, - AddWearableToAgentInventoryCallback::CALL_RECOVERDONE); - addWearableToAgentInventory(cb, new_wearable, lost_and_found_id, TRUE); -} - -void LLAgentWearables::recoverMissingWearableDone() -{ - // Have all the wearables that the avatar was wearing at log-in arrived or been fabricated? - updateWearablesLoaded(); - if (areWearablesLoaded()) - { - // Make sure that the server's idea of the avatar's wearables actually match the wearables. - gAgent.sendAgentSetAppearance(); - } - else - { - gInventory.addChangedMask(LLInventoryObserver::LABEL, LLUUID::null); - gInventory.notifyObservers(); - } -} - -void LLAgentWearables::createStandardWearablesDone(S32 type, U32 index) -{ - LL_INFOS() << "type " << type << " index " << index << LL_ENDL; - - if (!isAgentAvatarValid()) return; - gAgentAvatarp->updateVisualParams(); -} - -void LLAgentWearables::createStandardWearablesAllDone() -{ - // ... because sendAgentWearablesUpdate will notify inventory - // observers. - LL_INFOS() << "all done?" << LL_ENDL; - - mWearablesLoaded = TRUE; - checkWearablesLoaded(); - notifyLoadingFinished(); - - updateServer(); - - // Treat this as the first texture entry message, if none received yet - gAgentAvatarp->onFirstTEMessageReceived(); -} - -void LLAgentWearables::queryWearableCache() -{ -#if OPENSIM - if (!areWearablesLoaded() || (gAgent.getRegion() && gAgent.getRegion()->getCentralBakeVersion())) - { - return; - } - gAgentAvatarp->setIsUsingServerBakes(false); - - // Look up affected baked textures. - // If they exist: - // disallow updates for affected layersets (until dataserver responds with cache request.) - // If cache miss, turn updates back on and invalidate composite. - // If cache hit, modify baked texture entries. - // - // Cache requests contain list of hashes for each baked texture entry. - // Response is list of valid baked texture assets. (same message) - - gMessageSystem->newMessageFast(_PREHASH_AgentCachedTexture); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - gMessageSystem->addS32Fast(_PREHASH_SerialNum, gAgentQueryManager.mWearablesCacheQueryID); - - S32 num_queries = 0; - for (U8 baked_index = 0; baked_index < gAgentAvatarp->getNumBakes(); baked_index++) - { - LLUUID hash_id = computeBakedTextureHash((EBakedTextureIndex) baked_index); - if (hash_id.notNull()) - { - num_queries++; - // *NOTE: make sure at least one request gets packed - - ETextureIndex te_index = LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex((EBakedTextureIndex)baked_index); - - //LL_INFOS() << "Requesting texture for hash " << hash << " in baked texture slot " << baked_index << LL_ENDL; - gMessageSystem->nextBlockFast(_PREHASH_WearableData); - gMessageSystem->addUUIDFast(_PREHASH_ID, hash_id); - gMessageSystem->addU8Fast(_PREHASH_TextureIndex, (U8)te_index); - } - - gAgentQueryManager.mActiveCacheQueries[baked_index] = gAgentQueryManager.mWearablesCacheQueryID; - } - //VWR-22113: gAgent.getRegion() can return null if invalid, seen here on logout - if(gAgent.getRegion()) - { - if (isAgentAvatarValid()) - { - selfStartPhase("fetch_texture_cache_entries"); - gAgentAvatarp->outputRezTiming("Fetching textures from cache"); - } - - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; - gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); - gAgentQueryManager.mNumPendingQueries++; - gAgentQueryManager.mWearablesCacheQueryID++; - } -#endif -} - -// MULTI-WEARABLE: DEPRECATED: item pending count relies on old messages that don't support multi-wearables. do not trust to be accurate -void LLAgentWearables::updateWearablesLoaded() -{ - mWearablesLoaded = (itemUpdatePendingCount()==0); - if (mWearablesLoaded) - { - notifyLoadingFinished(); - } -} - -void LLAgentWearables::updateServer() -{ - sendAgentWearablesUpdate(); - gAgent.sendAgentSetAppearance(); -} -void LLAgentWearables::checkWearablesLoaded() const -{ -#ifdef SHOW_ASSERT - U32 item_pend_count = itemUpdatePendingCount(); - if (mWearablesLoaded) - { - llassert(item_pend_count==0); - } -#endif -} // EOF diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 20de8895c72..024d9fbcd29 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -43,7 +43,6 @@ class LLInventoryItem; class LLVOAvatarSelf; class LLViewerWearable; -class LLInitialWearablesFetch; class LLViewerObject; class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearableData @@ -52,7 +51,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable // Constructors / destructors / Initializers //-------------------------------------------------------------------- public: - friend class LLInitialWearablesFetch; LLAgentWearables(); virtual ~LLAgentWearables(); @@ -63,9 +61,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable // LLInitClass interface static void initClass(); -protected: - void createStandardWearablesDone(S32 type, U32 index/* = 0*/); - void createStandardWearablesAllDone(); //-------------------------------------------------------------------- // Queries @@ -92,7 +87,7 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable // Note: False for shape, skin, eyes, and hair, unless you have MORE than 1. bool canWearableBeRemoved(const LLViewerWearable* wearable) const; - void animateAllWearableParams(F32 delta, bool upload_bake); + void animateAllWearableParams(F32 delta); //-------------------------------------------------------------------- // Accessors @@ -166,21 +161,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable void removeWearableFinal(const LLWearableType::EType type, bool do_remove_all /*= false*/, U32 index /*= 0*/); protected: static bool onRemoveWearableDialog(const LLSD& notification, const LLSD& response); - - //-------------------------------------------------------------------- - // Server Communication - //-------------------------------------------------------------------- -public: - // Processes the initial wearables update message (if necessary, since the outfit folder makes it redundant) - static void processAgentInitialWearablesUpdate(LLMessageSystem* mesgsys, void** user_data); - -protected: - - void sendAgentWearablesUpdate(); - void sendAgentWearablesRequest(); - void queryWearableCache(); - void updateServer(); - static void onInitialWearableAssetArrived(LLViewerWearable* wearable, void* userdata); //-------------------------------------------------------------------- // Outfits @@ -193,7 +173,7 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable //-------------------------------------------------------------------- public: void saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, BOOL save_in_lost_and_found); - void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE, + void saveWearable(const LLWearableType::EType type, const U32 index, const std::string new_name = ""); void saveAllWearables(); void revertWearable(const LLWearableType::EType type, const U32 index); @@ -219,9 +199,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); - BOOL itemUpdatePending(const LLUUID& item_id) const; - U32 itemUpdatePendingCount() const; - static llvo_vec_t getTempAttachments(); //-------------------------------------------------------------------- @@ -262,7 +239,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable static bool mInitialAttachmentsRequested; // [/RLVa:KB] BOOL mWearablesLoaded; - std::set<LLUUID> mItemsAwaitingWearableUpdate; /** * True if agent's outfit is being changed now. @@ -274,18 +250,6 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable // Support classes //-------------------------------------------------------------------------------- private: - - class createStandardWearablesAllDoneCallback final : public LLRefCount - { - protected: - ~createStandardWearablesAllDoneCallback(); - }; - class sendAgentWearablesUpdateCallback final : public LLRefCount - { - protected: - ~sendAgentWearablesUpdateCallback(); - }; - class AddWearableToAgentInventoryCallback : public LLInventoryCallback { public: diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp deleted file mode 100644 index b0fcecb6651..00000000000 --- a/indra/newview/llagentwearablesfetch.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file llagentwearablesfetch.cpp - * @brief LLAgentWearblesFetch class implementation - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llagentwearablesfetch.h" - -#include "llagent.h" -#include "llagentwearables.h" -#include "llappearancemgr.h" -#include "llinventoryfunctions.h" -#include "llstartup.h" -#include "llvoavatarself.h" - - -void order_my_outfits_cb() -{ - if (!LLApp::isRunning()) - { - LL_WARNS() << "called during shutdown, skipping" << LL_ENDL; - return; - } - - const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); - if (my_outfits_id.isNull()) return; - - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - gInventory.getDirectDescendentsOf(my_outfits_id, cats, items); - if (!cats) return; - - //My Outfits should at least contain saved initial outfit and one another outfit - if (cats->size() < 2) - { - LL_WARNS() << "My Outfits category was not populated properly" << LL_ENDL; - return; - } - - LL_INFOS() << "Starting updating My Outfits with wearables ordering information" << LL_ENDL; - - for (LLInventoryModel::cat_array_t::iterator outfit_iter = cats->begin(); - outfit_iter != cats->end(); ++outfit_iter) - { - const LLUUID& cat_id = (*outfit_iter)->getUUID(); - if (cat_id.isNull()) continue; - - // saved initial outfit already contains wearables ordering information - if (cat_id == LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) continue; - - LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(cat_id); - } - - LL_INFOS() << "Finished updating My Outfits with wearables ordering information" << LL_ENDL; -} - -LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : - LLInventoryFetchDescendentsObserver(cof_id) -{ - if (isAgentAvatarValid()) - { - gAgentAvatarp->startPhase("initial_wearables_fetch"); - gAgentAvatarp->outputRezTiming("Initial wearables fetch started"); - } -} - -LLInitialWearablesFetch::~LLInitialWearablesFetch() -{ -} - -// virtual -void LLInitialWearablesFetch::done() -{ - // Delay processing the actual results of this so it's not handled within - // gInventory.notifyObservers. The results will be handled in the next - // idle tick instead. - gInventory.removeObserver(this); - doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); - if (isAgentAvatarValid()) - { - gAgentAvatarp->stopPhase("initial_wearables_fetch"); - gAgentAvatarp->outputRezTiming("Initial wearables fetch done"); - } -} - -void LLInitialWearablesFetch::add(InitialWearableData &data) - -{ - mAgentInitialWearables.push_back(data); -} - -void LLInitialWearablesFetch::processContents() -{ - if(!gAgentAvatarp) //no need to process wearables if the agent avatar is deleted. - { - delete this; - return ; - } - - // Fetch the wearable items from the Current Outfit Folder - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t wearable_array; - LLFindWearables is_wearable; - llassert_always(!mComplete.empty()); - gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, - LLInventoryModel::EXCLUDE_TRASH, is_wearable); - - LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); - if (!wearable_array.empty()) - { - gAgentWearables.notifyLoadingStarted(); - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - } - else - { - // if we're constructing the COF from the wearables message, we don't have a proper outfit link - LLAppearanceMgr::instance().setOutfitDirty(true); - processWearablesMessage(); - } - delete this; -} - -class LLFetchAndLinkObserver: public LLInventoryFetchItemsObserver -{ -public: - LLFetchAndLinkObserver(uuid_vec_t& ids): - LLInventoryFetchItemsObserver(ids) - { - } - ~LLFetchAndLinkObserver() - { - } - - void done() override - { - gInventory.removeObserver(this); - - // Link to all fetched items in COF. - LLPointer<LLInventoryCallback> link_waiter = new LLUpdateAppearanceOnDestroy; - LLInventoryObject::const_object_list_t item_array; - for (auto& id : mIDs) - { - LLConstPointer<LLInventoryObject> item = gInventory.getItem(id); - if (!item) - { - LL_WARNS() << "fetch failed for item " << id << "!" << LL_ENDL; - continue; - } - - item_array.push_back(item); - } - link_inventory_array(LLAppearanceMgr::instance().getCOF(), item_array, link_waiter); - } -}; - -void LLInitialWearablesFetch::processWearablesMessage() -{ - if (!mAgentInitialWearables.empty()) // We have an empty current outfit folder, use the message data instead. - { - (void) LLAppearanceMgr::instance().getCOF(); - uuid_vec_t ids; - for (const auto& wearable_data : mAgentInitialWearables) - { - // Populate the current outfit folder with links to the wearables passed in the message - if (wearable_data.mAssetID.notNull()) - { - ids.push_back(wearable_data.mItemID); - } - else - { - LL_INFOS() << "Invalid wearable, type " << wearable_data.mType << " itemID " - << wearable_data.mItemID << " assetID " << wearable_data.mAssetID << LL_ENDL; - } - } - - // Add all current attachments to the requested items as well. - if (isAgentAvatarValid()) - { - for (LLVOAvatar::attachment_map_t::const_iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); - iter != gAgentAvatarp->mAttachmentPoints.end(); ++iter) - { - LLViewerJointAttachment* attachment = iter->second; - if (!attachment) continue; - for (LLViewerObject* attached_object : attachment->mAttachedObjects) - { - if (!attached_object) continue; - const LLUUID& item_id = attached_object->getAttachmentItemID(); - if (item_id.isNull()) continue; - ids.push_back(item_id); - } - } - } - - // Need to fetch the inventory items for ids, then create links to them after they arrive. - LLFetchAndLinkObserver *fetcher = new LLFetchAndLinkObserver(ids); - fetcher->startFetch(); - // If no items to be fetched, done will never be triggered. - // TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition. - if (fetcher->isFinished()) - { - fetcher->done(); - } - else - { - gInventory.addObserver(fetcher); - } - } - else - { - LL_WARNS("Wearables") << "No current outfit folder items found and no initial wearables fallback message received." << LL_ENDL; - } -} diff --git a/indra/newview/llagentwearablesfetch.h b/indra/newview/llagentwearablesfetch.h deleted file mode 100644 index f82d6373146..00000000000 --- a/indra/newview/llagentwearablesfetch.h +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @file llagentwearablesinitialfetch.h - * @brief LLAgentWearablesInitialFetch class header file - * - * $LicenseInfo:firstyear=2000&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLAGENTWEARABLESINITIALFETCH_H -#define LL_LLAGENTWEARABLESINITIALFETCH_H - -#include "llinventoryobserver.h" -#include "llwearabletype.h" -#include "lluuid.h" - -//-------------------------------------------------------------------- -// InitialWearablesFetch -// -// This grabs contents from the COF and processes them. -// The processing is handled in idle(), i.e. outside of done(), -// to avoid gInventory.notifyObservers recursion. -//-------------------------------------------------------------------- -class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver -{ - LOG_CLASS(LLInitialWearablesFetch); - -public: - LLInitialWearablesFetch(const LLUUID& cof_id); - ~LLInitialWearablesFetch(); - void done() override; - - struct InitialWearableData - { - LLWearableType::EType mType; - LLUUID mItemID; - LLUUID mAssetID; - InitialWearableData(LLWearableType::EType type, LLUUID& itemID, LLUUID& assetID) : - mType(type), - mItemID(itemID), - mAssetID(assetID) - {} - }; - - void add(InitialWearableData &data); - -protected: - void processWearablesMessage(); - void processContents(); - -private: - typedef std::vector<InitialWearableData> initial_wearable_data_vec_t; - initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg -}; - -#endif // LL_AGENTWEARABLESINITIALFETCH_H diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index ecdb0c91a6a..5ac65e5b903 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -4688,7 +4688,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b bool result = false; if ((result = gAgentWearables.moveWearable(item, closer_to_body))) { - gAgentAvatarp->wearableUpdated(item->getWearableType(), false); + gAgentAvatarp->wearableUpdated(item->getWearableType()); } setOutfitDirty(true); diff --git a/indra/newview/llemote.cpp b/indra/newview/llemote.cpp index 0aae4ca84ba..b9ef297c005 100644 --- a/indra/newview/llemote.cpp +++ b/indra/newview/llemote.cpp @@ -79,13 +79,13 @@ BOOL LLEmote::onActivate() LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); if( default_param ) { - default_param->setWeight( default_param->getMaxWeight(), false); + default_param->setWeight( default_param->getMaxWeight()); } mParam = mCharacter->getVisualParam(mName.c_str()); if (mParam) { - mParam->setWeight(0.f, false); + mParam->setWeight(0.f); mCharacter->updateVisualParams(); } @@ -101,7 +101,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) if( mParam ) { F32 weight = mParam->getMinWeight() + mPose.getWeight() * (mParam->getMaxWeight() - mParam->getMinWeight()); - mParam->setWeight(weight, false); + mParam->setWeight(weight); // Cross fade against the default parameter LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); @@ -110,7 +110,7 @@ BOOL LLEmote::onUpdate(F32 time, U8* joint_mask) F32 default_param_weight = default_param->getMinWeight() + (1.f - mPose.getWeight()) * ( default_param->getMaxWeight() - default_param->getMinWeight() ); - default_param->setWeight( default_param_weight, false); + default_param->setWeight( default_param_weight); } mCharacter->updateVisualParams(); @@ -127,13 +127,13 @@ void LLEmote::onDeactivate() { if( mParam ) { - mParam->setWeight( mParam->getDefaultWeight(), false); + mParam->setWeight( mParam->getDefaultWeight()); } LLVisualParam* default_param = mCharacter->getVisualParam( "Express_Closed_Mouth" ); if( default_param ) { - default_param->setWeight( default_param->getMaxWeight(), false); + default_param->setWeight( default_param->getMaxWeight()); } mCharacter->updateVisualParams(); diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index c9a90296d24..37452f4ccbe 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -636,7 +636,7 @@ void LLLocalBitmap::updateUserLayers(LLUUID old_id, LLUUID new_id, LLWearableTyp if (gAgentWearables.getWearableIndex(wearable,index)) { gAgentAvatarp->setLocalTexture(reg_texind, gTextureList.getImage(new_id), FALSE, index); - gAgentAvatarp->wearableUpdated(type, false); + gAgentAvatarp->wearableUpdated(type); /* telling the manager to rebake once update cycle is fully done */ LLLocalBitmapMgr::getInstance()->setNeedsRebake(); } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index fe002e869d4..280e41c3480 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -721,8 +721,7 @@ BOOL LLPanelEditWearable::postBuild() mBtnBack->setClickedCallback(boost::bind(&LLPanelEditWearable::onBackButtonClicked, this)); - getChild<LLButton>("import_btn")->setClickedCallback(boost::bind(&LLPanelEditWearable::onClickedImportBtn, this)); - + getChild<LLButton>("import_btn")->setClickedCallback(boost::bind(&LLPanelEditWearable::onClickedImportBtn, this)); mNameEditor = getChild<LLLineEditor>("description"); @@ -948,11 +947,11 @@ void LLPanelEditWearable::onCommitSexChange() LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, index); if (wearable) { - wearable->setVisualParamWeight(param->getID(), is_new_sex_male, false); + wearable->setVisualParamWeight(param->getID(), is_new_sex_male); } - param->setWeight( is_new_sex_male, FALSE); + param->setWeight( is_new_sex_male); - gAgentAvatarp->updateSexDependentLayerSets(FALSE); + gAgentAvatarp->updateSexDependentLayerSets(); gAgentAvatarp->updateVisualParams(); showWearable(mWearablePtr, TRUE, TRUE); @@ -989,7 +988,7 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl) { gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index); LLVisualParamHint::requestHintUpdates(); - gAgentAvatarp->wearableUpdated(type, false); + gAgentAvatarp->wearableUpdated(type); } else { @@ -1018,9 +1017,9 @@ void LLPanelEditWearable::onColorSwatchCommit(const LLUICtrl* ctrl) const LLColor4& new_color = LLColor4(ctrl->getValue()); if( old_color != new_color ) { - getWearable()->setClothesColor(entry->mTextureIndex, new_color, true); + getWearable()->setClothesColor(entry->mTextureIndex, new_color); LLVisualParamHint::requestHintUpdates(); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), false); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } } else @@ -1121,7 +1120,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // Remove old link remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } - gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name); + gAgentWearables.saveWearable(mWearablePtr->getType(), index, new_name); } @@ -1139,7 +1138,7 @@ void LLPanelEditWearable::revertChanges() mNameEditor->setText(mWearableItem->getName()); updatePanelPickerControls(mWearablePtr->getType()); updateTypeSpecificControls(mWearablePtr->getType()); - gAgentAvatarp->wearableUpdated(mWearablePtr->getType(), false); + gAgentAvatarp->wearableUpdated(mWearablePtr->getType()); } void LLPanelEditWearable::showWearable(LLViewerWearable* wearable, BOOL show, BOOL disable_camera_switch) @@ -1620,7 +1619,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE ); gAgentAvatarp->setLocalTexture(te, image, FALSE, index); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), false); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } else { @@ -1636,7 +1635,7 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL if (!image) return; gAgentAvatarp->setLocalTexture(te, image, FALSE, index); - gAgentAvatarp->wearableUpdated(getWearable()->getType(), false); + gAgentAvatarp->wearableUpdated(getWearable()->getType()); } updatePanelPickerControls(getWearable()->getType()); @@ -1721,7 +1720,7 @@ void LLPanelEditWearable::onClickedImportBtnCallback(const std::vector<std::stri { LLVisualParam* visual_param = getWearable()->getVisualParam(id); if (visual_param) - visual_param->setWeight(value, FALSE); + visual_param->setWeight(value); } else { diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index b474c3e498f..a06f9735366 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -670,7 +670,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) if ((driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE) && (driver_param->getGroup() != VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT)) { - mCharacter->setVisualParamWeight(driver_param, 0, false); + mCharacter->setVisualParamWeight(driver_param, 0); } S32 num_driven = driver_param->getDrivenParamsCount(); for (S32 i = 0; i < num_driven; ++i) @@ -770,5 +770,5 @@ void LLPhysicsMotion::setParamValue(const LLViewerVisualParam *param, // Scale from [0,1] to [value_min_local,value_max_local] const F32 new_value_local = value_min_local + (value_max_local-value_min_local) * new_value_rescaled; - mCharacter->setVisualParamWeight(param, new_value_local, false); + mCharacter->setVisualParamWeight(param, new_value_local); } diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 024a6803086..bfa453a0ae1 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -266,7 +266,7 @@ void LLScrollingPanelParam::onHintHeldDown( LLVisualParamHint* hint ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight, false); + mWearable->setVisualParamWeight( hint->getVisualParam()->getID(), new_weight); mWearable->writeToAvatar(gAgentAvatarp); gAgentAvatarp->updateVisualParams(); @@ -299,7 +299,7 @@ void LLScrollingPanelParam::onHintMinMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, false); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); slider->setValue( self->weightToPercent( new_weight ) ); } @@ -333,7 +333,7 @@ void LLScrollingPanelParam::onHintMaxMouseUp( void* userdata ) if (slider->getMinValue() < new_percent && new_percent < slider->getMaxValue()) { - self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight, false); + self->mWearable->setVisualParamWeight(hint->getVisualParam()->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); slider->setValue( self->weightToPercent( new_weight ) ); } diff --git a/indra/newview/llscrollingpanelparambase.cpp b/indra/newview/llscrollingpanelparambase.cpp index 7e208f70139..fe7a3627235 100644 --- a/indra/newview/llscrollingpanelparambase.cpp +++ b/indra/newview/llscrollingpanelparambase.cpp @@ -93,7 +93,7 @@ void LLScrollingPanelParamBase::onSliderMoved(LLUICtrl* ctrl, void* userdata) F32 new_weight = self->percentToWeight( (F32)slider->getValue().asReal() ); if (current_weight != new_weight ) { - self->mWearable->setVisualParamWeight( param->getID(), new_weight, false); + self->mWearable->setVisualParamWeight( param->getID(), new_weight); self->mWearable->writeToAvatar(gAgentAvatarp); gAgentAvatarp->updateVisualParams(); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d49eae816b8..27c83652731 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2346,10 +2346,7 @@ bool idle_startup() { gAgentWearables.notifyLoadingStarted(); gAgent.setOutfitChosen(TRUE); - if (LLGridManager::getInstance()->isInSecondlife()) - { - gAgentWearables.sendDummyAgentWearablesUpdate(); - } + gAgentWearables.sendDummyAgentWearablesUpdate(); callAfterCOFFetch(set_flags_and_update_appearance); } @@ -2422,10 +2419,14 @@ bool idle_startup() && isAgentAvatarValid() && gAgentAvatarp->isFullyLoaded()) { - - LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL; - LLStartUp::setStartupState( STATE_CLEANUP ); - return TRUE; + // wait for avatar to be completely loaded + if (isAgentAvatarValid() + && gAgentAvatarp->isFullyLoaded()) + { + LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL; + LLStartUp::setStartupState( STATE_CLEANUP ); + return TRUE; + } } else { @@ -2750,8 +2751,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation); msg->setHandlerFuncFast(_PREHASH_ObjectAnimation, process_object_animation); msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance); - msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse); - msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures); msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint); msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response); msg->setHandlerFuncFast(_PREHASH_SetFollowCamProperties, process_set_follow_cam_properties); @@ -2825,8 +2824,6 @@ void register_viewer_callbacks(LLMessageSystem* msg) // msg->setHandlerFuncFast(_PREHASH_ReputationIndividualReply, // LLFloaterRate::processReputationIndividualReply); - msg->setHandlerFuncFast(_PREHASH_AgentWearablesUpdate, LLAgentWearables::processAgentInitialWearablesUpdate ); - msg->setHandlerFuncFast(_PREHASH_ScriptControlChange, LLAgent::processScriptControlChange ); @@ -3038,10 +3035,7 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } gAgent.setOutfitChosen(TRUE); - if (LLGridManager::getInstance()->isInSecondlife()) - { - gAgentWearables.sendDummyAgentWearablesUpdate(); - } + gAgentWearables.sendDummyAgentWearablesUpdate(); } std::string& LLStartUp::getInitialOutfitName() diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 747899ea9a8..7060632813c 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -419,15 +419,6 @@ void LLAvatarTexBar::draw() LLColor4 text_color = LLColor4::white; - if (layerset_buffer->uploadNeeded()) - { - text_color = LLColor4::red; - } - if (layerset_buffer->uploadInProgress()) - { - text_color = LLColor4::magenta; - } - std::string text = layerset_buffer->dumpTextureInfo(); LLFontGL::getFontMonospace()->renderUTF8(text, 0, l_offset, v_offset + line_height*line_num, text_color, LLFontGL::LEFT, LLFontGL::TOP); //, LLFontGL::BOLD, LLFontGL::DROP_SHADOW_SOFT); diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 449e2e344a2..bb2863ce7cc 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -154,8 +154,8 @@ void LLVisualParamHint::preRender(BOOL clear_depth) wearable->setVolatile(TRUE); } mLastParamWeight = mVisualParam->getWeight(); - mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, false); - gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, false); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight); + gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight); gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f); gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f); gAgentAvatarp->updateComposites(); @@ -249,8 +249,8 @@ BOOL LLVisualParamHint::render() gGL.flush(); } - gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, false); - mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, false); + gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); + mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight); LLViewerWearable* wearable = (LLViewerWearable*)mWearablePtr; if (wearable) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a756205693e..710e604a318 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3484,10 +3484,6 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) LL_INFOS("Teleport") << "Agent movement complete, setting state to TELEPORT_START_ARRIVAL" << LL_ENDL; gAgent.setTeleportState( LLAgent::TELEPORT_START_ARRIVAL ); - // set the appearance on teleport since the new sim does not; - // know what you look like. - gAgent.sendAgentSetAppearance(); - if (isAgentAvatarValid()) { // Set the new position diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2c1d36b31b5..0eae3f8cd61 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -187,8 +187,8 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco if (!gAgentAvatarp) { gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp); - gAgentWearables.setAvatarObject(gAgentAvatarp); // Set before instance init gAgentAvatarp->initInstance(); + gAgentWearables.setAvatarObject(gAgentAvatarp); } else { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index df785472437..4effe72cccc 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -633,17 +633,6 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mHandle(handle), mTimeDilation(1.0f), mWidthScaleFactor(region_width_meters / REGION_WIDTH_METERS), -#ifndef LL_HAVOK - mMaxBakes(LLGridManager::getInstance()->isInSecondlife()? - LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES: - LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_LEFT_ARM), - mMaxTEs(LLGridManager::getInstance()->isInSecondlife()? - LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES: - LLAvatarAppearanceDefines::ETextureIndex::TEX_HEAD_UNIVERSAL_TATTOO), -#else - mMaxBakes(LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES), - mMaxTEs(LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES), -#endif mName(""), mZoning(""), mIsEstateManager(FALSE), @@ -652,7 +641,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT), - mCentralBakeVersion(0), + mCentralBakeVersion(1), mClassID(0), mCPURatio(0), mColoName("unknown"), @@ -2621,19 +2610,6 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) mAvatarHoverHeightEnabled = (mSimulatorFeatures.has("AvatarHoverHeightEnabled") && mSimulatorFeatures["AvatarHoverHeightEnabled"].asBoolean()); -#ifndef LL_HAVOK - if (!mBakesOnMeshEnabled) - { - mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_LEFT_ARM; - mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_HEAD_UNIVERSAL_TATTOO; - } - else -#endif - { - mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES; - mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES; - } - setSimulatorFeaturesReceived(true); } @@ -3198,25 +3174,6 @@ void LLViewerRegion::unpackRegionHandshake() } mCentralBakeVersion = region_protocols & 1; // was (S32)gSavedSettings.getBOOL("UseServerTextureBaking"); -#ifndef LL_HAVOK - constexpr U64 REGION_SUPPORTS_BOM{ 1ULL << 63ULL }; - if (LLGridManager::instance().isInSecondlife() || (region_protocols & REGION_SUPPORTS_BOM)) // OS sets bit 63 when BOM supported - { - mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES; - mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES; - } - else - { - mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_LEFT_ARM; - mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_HEAD_UNIVERSAL_TATTOO; - } -#else - { - mMaxBakes = LLAvatarAppearanceDefines::EBakedTextureIndex::BAKED_NUM_INDICES; - mMaxTEs = LLAvatarAppearanceDefines::ETextureIndex::TEX_NUM_INDICES; - } -#endif - LLVLComposition *compp = getComposition(); if (compp) { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index ea90ccf3b5d..2de8e5fc531 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -245,8 +245,6 @@ class LLViewerRegion final : public LLCapabilityProvider // implements this inte static void idleCleanup(F32 max_update_time); F32 getWidthScaleFactor() const { return mWidthScaleFactor; } // Scaling for OpenSim VarRegions - S32 getRegionMaxBakes() const { return mMaxBakes; } - S32 getRegionMaxTEs() const { return mMaxTEs; } void idleUpdate(F32 max_update_time); void lightIdleUpdate(); bool addVisibleGroup(LLViewerOctreeGroup* group); diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp index a58a63ac328..7b7c12a4c7a 100644 --- a/indra/newview/llviewertexlayer.cpp +++ b/indra/newview/llviewertexlayer.cpp @@ -28,9 +28,6 @@ #include "llviewertexlayer.h" -#include "llfilesystem.h" -#include "llsdutil.h" - #include "llagent.h" #include "llimagej2c.h" #include "llnotificationsutil.h" @@ -38,32 +35,11 @@ #include "llglslshader.h" #include "llvoavatarself.h" #include "pipeline.h" -#include "llviewerassetupload.h" #include "llviewercontrol.h" -#include "llviewerstats.h" - -static const S32 BAKE_UPLOAD_ATTEMPTS = 7; -static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt // runway consolidate extern std::string self_av_string(); - -//----------------------------------------------------------------------------- -// LLBakedUploadData() -//----------------------------------------------------------------------------- -LLBakedUploadData::LLBakedUploadData(const LLVOAvatarSelf* avatar, - LLViewerTexLayerSet* layerset, - const LLUUID& id, - bool highest_res) : - mID(id), - mAvatar(avatar), - mTexLayerSet(layerset), - mStartTime(LLFrameTimer::getTotalTime()), // Record starting time - mIsHighestRes(highest_res) -{ -} - //----------------------------------------------------------------------------- // LLViewerTexLayerSetBuffer // The composite image that a LLViewerTexLayerSet writes to. Each LLViewerTexLayerSet has one. @@ -77,17 +53,12 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner, // ORDER_LAST => must render these after the hints are created. LLTexLayerSetBuffer(owner), LLViewerDynamicTexture(width, height, 4, LLViewerDynamicTexture::ORDER_LAST, FALSE), - mNeedsUpload(FALSE), // Not used for any logic here, just to sync sending of updates - mNumLowresUploads(0), - mUploadPending(FALSE), - mUploadFailCount(0), mNeedsUpdate(TRUE), mNumLowresUpdates(0) { mGLTexturep->setNeedsAlphaAndPickMask(FALSE); LLViewerTexLayerSetBuffer::sGLByteCount += getSize(); - mNeedsUploadTimer.start(); mNeedsUpdateTimer.start(); } @@ -130,33 +101,6 @@ void LLViewerTexLayerSetBuffer::requestUpdate() restartUpdateTimer(); mNeedsUpdate = TRUE; mNumLowresUpdates = 0; - // If we're in the middle of uploading a baked texture, we don't care about it any more. - // When it's downloaded, ignore it. - mUploadID.setNull(); -} - -void LLViewerTexLayerSetBuffer::requestUpload() -{ - conditionalRestartUploadTimer(); - mNeedsUpload = TRUE; - mNumLowresUploads = 0; - mUploadPending = TRUE; -} - -void LLViewerTexLayerSetBuffer::conditionalRestartUploadTimer() -{ - // If we requested a new upload but haven't even uploaded - // a low res version of our last upload request, then - // keep the timer ticking instead of resetting it. - if (mNeedsUpload && (mNumLowresUploads == 0)) - { - mNeedsUploadTimer.unpause(); - } - else - { - mNeedsUploadTimer.reset(); - mNeedsUploadTimer.start(); - } } void LLViewerTexLayerSetBuffer::restartUpdateTimer() @@ -165,25 +109,16 @@ void LLViewerTexLayerSetBuffer::restartUpdateTimer() mNeedsUpdateTimer.start(); } -void LLViewerTexLayerSetBuffer::cancelUpload() -{ - mNeedsUpload = FALSE; - mUploadPending = FALSE; - mNeedsUploadTimer.pause(); - mUploadRetryTimer.reset(); -} - // virtual BOOL LLViewerTexLayerSetBuffer::needsRender() { llassert(mTexLayerSet->getAvatarAppearance() == gAgentAvatarp); if (!isAgentAvatarValid()) return FALSE; - const BOOL upload_now = mNeedsUpload && isReadyToUpload(); const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); // Don't render if we don't want to (or aren't ready to) update. - if (!(update_now || upload_now)) + if (!update_now) { return FALSE; } @@ -198,7 +133,6 @@ BOOL LLViewerTexLayerSetBuffer::needsRender() if (gAgentAvatarp->getBakedTE(getViewerTexLayerSet()) == LLAvatarAppearanceDefines::TEX_SKIRT_BAKED && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT)) { - cancelUpload(); return FALSE; } @@ -224,46 +158,9 @@ void LLViewerTexLayerSetBuffer::postRenderTexLayerSet(BOOL success) } // virtual -void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success, LLRenderTarget* bound_target) +void LLViewerTexLayerSetBuffer::midRenderTexLayerSet(BOOL success) { - // do we need to upload, and do we have sufficient data to create an uploadable composite? - // TODO: When do we upload the texture if gAgent.mNumPendingQueries is non-zero? - const BOOL upload_now = mNeedsUpload && isReadyToUpload(); const BOOL update_now = mNeedsUpdate && isReadyToUpdate(); - - if(upload_now) - { - if (!success) - { - LL_INFOS() << "Failed attempt to bake " << mTexLayerSet->getBodyRegionName() << LL_ENDL; - mUploadPending = FALSE; - } - else - { - LLViewerTexLayerSet* layer_set = getViewerTexLayerSet(); - if (layer_set->isVisible()) - { - auto bakedTexIdx = layer_set->getBakedTexIndex(); - if(bakedTexIdx <= layer_set->getAvatar()->getNumBakes()) - { - layer_set->getAvatar()->debugBakedTextureUpload(bakedTexIdx, FALSE); // FALSE for start of upload, TRUE for finish. - doUpload(bound_target); - } - else - { - LL_DEBUGS("Avatar") << "Skipping bake for unsupported layer on this region" << LL_ENDL; - } - } - else - { - mUploadPending = FALSE; - mNeedsUpload = FALSE; - mNeedsUploadTimer.pause(); - layer_set->getAvatar()->setNewBakedTexture(layer_set->getBakedTexIndex(),IMG_INVISIBLE); - } - } - } - if (update_now) { doUpdate(); @@ -279,60 +176,6 @@ BOOL LLViewerTexLayerSetBuffer::isInitialized(void) const return mGLTexturep.notNull() && mGLTexturep->isGLTextureCreated(); } -BOOL LLViewerTexLayerSetBuffer::uploadPending() const -{ - return mUploadPending; -} - -BOOL LLViewerTexLayerSetBuffer::uploadNeeded() const -{ - return mNeedsUpload; -} - -BOOL LLViewerTexLayerSetBuffer::uploadInProgress() const -{ - return !mUploadID.isNull(); -} - -BOOL LLViewerTexLayerSetBuffer::isReadyToUpload() const -{ - if (!gAgentQueryManager.hasNoPendingQueries()) return FALSE; // Can't upload if there are pending queries. - if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance()) return FALSE; // Don't upload if avatar is being edited. - - BOOL ready = FALSE; - if (getViewerTexLayerSet()->isLocalTextureDataFinal()) - { - // If we requested an upload and have the final LOD ready, upload (or wait a while if this is a retry) - if (mUploadFailCount == 0) - { - ready = TRUE; - } - else - { - ready = mUploadRetryTimer.getElapsedTimeF32() >= BAKE_UPLOAD_RETRY_DELAY * (1 << (mUploadFailCount - 1)); - } - } - else - { - // Upload if we've hit a timeout. Upload is a pretty expensive process so we need to make sure - // we aren't doing uploads too frequently. - const U32 texture_timeout = gSavedSettings.getU32("AvatarBakedTextureUploadTimeout"); - if (texture_timeout != 0) - { - // The timeout period increases exponentially between every lowres upload in order to prevent - // spamming the server with frequent uploads. - const U32 texture_timeout_threshold = texture_timeout*(1 << mNumLowresUploads); - - // If we hit our timeout and have textures available at even lower resolution, then upload. - const BOOL is_upload_textures_timeout = mNeedsUploadTimer.getElapsedTimeF32() >= texture_timeout_threshold; - const BOOL has_lower_lod = getViewerTexLayerSet()->isLocalTextureDataAvailable(); - ready = has_lower_lod && is_upload_textures_timeout; - } - } - - return ready; -} - BOOL LLViewerTexLayerSetBuffer::isReadyToUpdate() const { // If we requested an update and have the final LOD ready, then update. @@ -370,230 +213,6 @@ BOOL LLViewerTexLayerSetBuffer::requestUpdateImmediate() return result; } -//========================================================================= -//----------------------------------------------------------------------------- -// Support classes -//----------------------------------------------------------------------------- -class ALTexLayerUploader final : public LLBufferedAssetUploadInfo -{ -public: - ALTexLayerUploader(LLUUID assetId, std::string texture, LLBakedUploadData* baked_upload_data); - ~ALTexLayerUploader(); - - LLSD prepareUpload() override; - LLSD generatePostBody() override; - LLUUID finishUpload(LLSD &result) override; - -private: - LLBakedUploadData* mBakedUploadData; -}; - -ALTexLayerUploader::ALTexLayerUploader(LLUUID assetId, std::string texture, LLBakedUploadData* baked_upload_data) : - LLBufferedAssetUploadInfo(LLUUID::null, LLAssetType::AT_TEXTURE, texture, NULL, nullptr), - mBakedUploadData(baked_upload_data) -{ - setAssetId(assetId); -} - -ALTexLayerUploader::~ALTexLayerUploader() -{ - delete_and_clear(mBakedUploadData); -} - -LLSD ALTexLayerUploader::prepareUpload() -{ - return LLSD().with("success", LLSD::Boolean(true)); -} - -LLSD ALTexLayerUploader::generatePostBody() -{ - return LLBufferedAssetUploadInfo::generatePostBody(); -} - -LLUUID ALTexLayerUploader::finishUpload(LLSD &result) -{ - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]); - - LLUUID new_id = LLUUID(); - - if (status.getType() == HTTP_OK) - { - new_id = result["new_asset"].asUUID(); - std::string state = result["state"].asString(); - - LL_INFOS() << "result: " << state << " new_id: " << new_id << LL_ENDL; - if (state == "complete" - && mBakedUploadData != NULL) - { // Invoke - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, static_cast<void*>(mBakedUploadData), 0, LLExtStat::NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - return new_id; - } - } - - LL_WARNS() << "Baked texture upload resulted in: " << status.getType() << ll_pretty_print_sd(result) << LL_ENDL; - // Invoke the original callback with an error result - LLViewerTexLayerSetBuffer::onTextureUploadComplete(new_id, static_cast<void*>(mBakedUploadData), -1, LLExtStat::NONE); - mBakedUploadData = NULL; // deleted in onTextureUploadComplete() - return new_id; -} - -// Create the baked texture, send it out to the server, then wait for it to come -// back so we can switch to using it. -void LLViewerTexLayerSetBuffer::doUpload(LLRenderTarget* bound_target) -{ - LLViewerTexLayerSet* layer_set = getViewerTexLayerSet(); - LL_INFOS() << "Uploading baked " << layer_set->getBodyRegionName() << LL_ENDL; - add(LLStatViewer::TEX_BAKES, 1); - - // Don't need caches since we're baked now. (note: we won't *really* be baked - // until this image is sent to the server and the Avatar Appearance message is received.) - layer_set->deleteCaches(); - - // Get the COLOR information from our texture - U8* baked_color_data = new U8[ mFullWidth * mFullHeight * 4 ]; - glReadPixels(mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, GL_RGBA, GL_UNSIGNED_BYTE, baked_color_data ); - stop_glerror(); - - // Get the MASK information from our texture - LLGLSUIDefault gls_ui; - LLPointer<LLImageRaw> baked_mask_image = new LLImageRaw(mFullWidth, mFullHeight, 1 ); - U8* baked_mask_data = baked_mask_image->getData(); - layer_set->gatherMorphMaskAlpha(baked_mask_data, - mOrigin.mX, mOrigin.mY, - mFullWidth, mFullHeight, bound_target); - - - // Create the baked image from our color and mask information - const S32 baked_image_components = 5; // red green blue [bump] clothing - LLPointer<LLImageRaw> baked_image = new LLImageRaw( mFullWidth, mFullHeight, baked_image_components ); - U8* baked_image_data = baked_image->getData(); - S32 i = 0; - for (S32 u=0; u < mFullWidth; u++) - { - for (S32 v=0; v < mFullHeight; v++) - { - baked_image_data[5*i + 0] = baked_color_data[4*i + 0]; - baked_image_data[5*i + 1] = baked_color_data[4*i + 1]; - baked_image_data[5*i + 2] = baked_color_data[4*i + 2]; - baked_image_data[5*i + 3] = baked_color_data[4*i + 3]; // alpha should be correct for eyelashes. - baked_image_data[5*i + 4] = baked_mask_data[i]; - i++; - } - } - - LLPointer<LLImageJ2C> compressedImage = new LLImageJ2C; - const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) - if (compressedImage->encode(baked_image, comment_text)) - { - LLTransactionID tid; - tid.generate(); - const LLAssetID asset_id = tid.makeAssetID(gAgent.getSecureSessionID()); - LLFileSystem up_file(asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE); - if (up_file.write(compressedImage->getData(), compressedImage->getDataSize())) - { - // Read back the file and validate. - BOOL valid = FALSE; - std::string asset_data; - { - LLPointer<LLImageJ2C> integrity_test = new LLImageJ2C; - S32 file_size = 0; - LLFileSystem file(asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::READ); - file_size = file.getSize(); - U8* data = integrity_test->allocateData(file_size); - if (data) - { - file.read(data, file_size); - asset_data.append(reinterpret_cast<char const*> (data), file_size); - valid = integrity_test->validate(data, file_size); // integrity_test will delete 'data' - } - else - { - integrity_test->setLastError("Unable to read entire file"); - } - } - - if (valid) - { - const bool highest_lod = layer_set->isLocalTextureDataFinal(); - // Baked_upload_data is owned by the responder and deleted after the request completes. - LLBakedUploadData* baked_upload_data = new LLBakedUploadData(gAgentAvatarp, - layer_set, - asset_id, - highest_lod); - // upload ID is used to avoid overlaps, e.g. when the user rapidly makes two changes outside of Face Edit. - mUploadID = asset_id; - - // Upload the image - const std::string url = gAgent.getRegionCapability("UploadBakedTexture"); - if(!url.empty() - && !LLPipeline::sForceOldBakedUpload // toggle debug setting UploadBakedTexOld to change between the new caps method and old method - && (mUploadFailCount < (BAKE_UPLOAD_ATTEMPTS - 1))) // Try last ditch attempt via asset store if cap upload is failing. - { - // The responder will call LLViewerTexLayerSetBuffer::onTextureUploadComplete() - LLResourceUploadInfo::ptr_t asset_info(new ALTexLayerUploader(mUploadID, asset_data, baked_upload_data)); - LLViewerAssetUpload::EnqueueInventoryUpload(url, asset_info); - LL_INFOS() << "Baked texture upload via capability of " << mUploadID << " to " << url << LL_ENDL; - } - else - { - gAssetStorage->storeAssetData(tid, - LLAssetType::AT_TEXTURE, - LLViewerTexLayerSetBuffer::onTextureUploadComplete, - baked_upload_data, - TRUE, // temp_file - TRUE, // is_priority - TRUE); // store_local - LL_INFOS() << "Baked texture upload via Asset Store." << LL_ENDL; - } - - if (highest_lod) - { - // Sending the final LOD for the baked texture. All done, pause - // the upload timer so we know how long it took. - mNeedsUpload = FALSE; - mNeedsUploadTimer.pause(); - } - else - { - // Sending a lower level LOD for the baked texture. Restart the upload timer. - mNumLowresUploads++; - mNeedsUploadTimer.unpause(); - mNeedsUploadTimer.reset(); - } - - // Print out notification that we uploaded this texture. - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - const std::string lod_str = highest_lod ? "HighRes" : "LowRes"; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)layer_set->getAvatar()->debugGetExistenceTimeElapsedF32()); - args["TIME"] = llformat("%d",(U32)mNeedsUploadTimer.getElapsedTimeF32()); - args["BODYREGION"] = layer_set->getBodyRegionName(); - args["RESOLUTION"] = lod_str; - LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args); - LL_DEBUGS("Avatar") << self_av_string() << "Uploading [ name: " << layer_set->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL; - } - } - else - { - // The read back and validate operation failed. Remove the uploaded file. - mUploadPending = FALSE; - up_file.remove(); - LL_INFOS() << "Unable to create baked upload file (reason: corrupted)." << LL_ENDL; - } - } - } - else - { - // The VFS write file operation failed. - mUploadPending = FALSE; - LL_INFOS() << "Unable to create baked upload file (reason: failed to write file)" << LL_ENDL; - } - - delete [] baked_color_data; -} - // Mostly bookkeeping; don't need to actually "do" anything since // render() will actually do the update. void LLViewerTexLayerSetBuffer::doUpdate() @@ -630,82 +249,6 @@ void LLViewerTexLayerSetBuffer::doUpdate() } } -// static -void LLViewerTexLayerSetBuffer::onTextureUploadComplete(const LLUUID& uuid, - void* userdata, - S32 result, - LLExtStat ext_status) // StoreAssetData callback (not fixed) -{ - LLBakedUploadData* baked_upload_data = (LLBakedUploadData*)userdata; - - if (isAgentAvatarValid() && - !gAgentAvatarp->isDead() && - (baked_upload_data->mAvatar == gAgentAvatarp) && // Sanity check: only the user's avatar should be uploading textures. - (baked_upload_data->mTexLayerSet->hasComposite())) - { - LLViewerTexLayerSetBuffer* layerset_buffer = baked_upload_data->mTexLayerSet->getViewerComposite(); - S32 failures = layerset_buffer->mUploadFailCount; - layerset_buffer->mUploadFailCount = 0; - - if (layerset_buffer->mUploadID.isNull()) - { - // The upload got canceled, we should be in the - // process of baking a new texture so request an - // upload with the new data - - // BAP: does this really belong in this callback, as - // opposed to where the cancellation takes place? - // suspect this does nothing. - layerset_buffer->requestUpload(); - } - else if (baked_upload_data->mID == layerset_buffer->mUploadID) - { - // This is the upload we're currently waiting for. - layerset_buffer->mUploadID.setNull(); - const std::string name(baked_upload_data->mTexLayerSet->getBodyRegionName()); - const std::string resolution = baked_upload_data->mIsHighestRes ? " full res " : " low res "; - if (result >= 0) - { - layerset_buffer->mUploadPending = FALSE; // Allows sending of AgentSetAppearance later - LLAvatarAppearanceDefines::ETextureIndex baked_te = gAgentAvatarp->getBakedTE(layerset_buffer->getViewerTexLayerSet()); - // Update baked texture info with the new UUID - U64 now = LLFrameTimer::getTotalTime(); // Record starting time - LL_INFOS() << "Baked" << resolution << "texture upload for " << name << " took " << (S32)((now - baked_upload_data->mStartTime) / 1000) << " ms" << LL_ENDL; - gAgentAvatarp->setNewBakedTexture(baked_te, uuid); - } - else - { - ++failures; - S32 max_attempts = baked_upload_data->mIsHighestRes ? BAKE_UPLOAD_ATTEMPTS : 1; // only retry final bakes - LL_WARNS() << "Baked" << resolution << "texture upload for " << name << " failed (attempt " << failures << "/" << max_attempts << ")" << LL_ENDL; - if (failures < max_attempts) - { - layerset_buffer->mUploadFailCount = failures; - layerset_buffer->mUploadRetryTimer.start(); - layerset_buffer->requestUpload(); - } - } - } - else - { - LL_INFOS() << "Received baked texture out of date, ignored." << LL_ENDL; - } - - gAgentAvatarp->dirtyMesh(); - } - else - { - // Baked texture failed to upload (in which case since we - // didn't set the new baked texture, it means that they'll try - // and rebake it at some point in the future (after login?)), - // or this response to upload is out of date, in which case a - // current response should be on the way or already processed. - LL_WARNS() << "Baked upload failed" << LL_ENDL; - } - - delete baked_upload_data; -} - //----------------------------------------------------------------------------- // LLViewerTexLayerSet // An ordered set of texture layers that get composited into a single texture. @@ -747,20 +290,6 @@ void LLViewerTexLayerSet::requestUpdate() } } -void LLViewerTexLayerSet::requestUpload() -{ - createComposite(); - getViewerComposite()->requestUpload(); -} - -void LLViewerTexLayerSet::cancelUpload() -{ - if(mComposite) - { - getViewerComposite()->cancelUpload(); - } -} - void LLViewerTexLayerSet::updateComposite() { createComposite(); @@ -813,19 +342,12 @@ const std::string LLViewerTexLayerSetBuffer::dumpTextureInfo() const { if (!isAgentAvatarValid()) return ""; - const BOOL is_high_res = !mNeedsUpload; - const U32 num_low_res = mNumLowresUploads; - const U32 upload_time = (U32)mNeedsUploadTimer.getElapsedTimeF32(); + const BOOL is_high_res = TRUE; + const U32 num_low_res = 0; const std::string local_texture_info = gAgentAvatarp->debugDumpLocalTextureDataInfo(getViewerTexLayerSet()); - std::string status = "CREATING "; - if (!uploadNeeded()) status = "DONE "; - if (uploadInProgress()) status = "UPLOADING"; - - std::string text = llformat("[%s] [HiRes:%d LoRes:%d] [Elapsed:%d] %s", - status.c_str(), + std::string text = llformat("[HiRes:%d LoRes:%d] %s", is_high_res, num_low_res, - upload_time, local_texture_info.c_str()); return text; } diff --git a/indra/newview/llviewertexlayer.h b/indra/newview/llviewertexlayer.h index e549eb90f68..ffba8fbe095 100644 --- a/indra/newview/llviewertexlayer.h +++ b/indra/newview/llviewertexlayer.h @@ -47,8 +47,6 @@ class LLViewerTexLayerSet final : public LLTexLayerSet virtual ~LLViewerTexLayerSet(); /*virtual*/void requestUpdate() override; - void requestUpload(); - void cancelUpload(); BOOL isLocalTextureDataAvailable() const; BOOL isLocalTextureDataFinal() const; void updateComposite(); @@ -97,7 +95,7 @@ class LLViewerTexLayerSetBuffer final : public LLTexLayerSetBuffer, public LLVie // Tex Layer Render //-------------------------------------------------------------------- void preRenderTexLayerSet() override; - void midRenderTexLayerSet(BOOL success, LLRenderTarget* bound_target) override; + void midRenderTexLayerSet(BOOL success) override; void postRenderTexLayerSet(BOOL success) override; S32 getCompositeOriginX() const override { return getOriginX(); } S32 getCompositeOriginY() const override { return getOriginY(); } @@ -114,33 +112,7 @@ class LLViewerTexLayerSetBuffer final : public LLTexLayerSetBuffer, public LLVie void preRender(BOOL clear_depth) override { preRenderTexLayerSet(); } void postRender(BOOL success) override { postRenderTexLayerSet(success); } BOOL render() override { return renderTexLayerSet(mBoundTarget); } - - - //-------------------------------------------------------------------- - // Uploads - //-------------------------------------------------------------------- -public: - void requestUpload(); - void cancelUpload(); - BOOL uploadNeeded() const; // We need to upload a new texture - BOOL uploadInProgress() const; // We have started uploading a new texture and are awaiting the result - BOOL uploadPending() const; // We are expecting a new texture to be uploaded at some point - static void onTextureUploadComplete(const LLUUID& uuid, - void* userdata, - S32 result, LLExtStat ext_status); -protected: - BOOL isReadyToUpload() const; - void doUpload(LLRenderTarget* bound_target); // Does a read back and upload. - void conditionalRestartUploadTimer(); -private: - BOOL mNeedsUpload; // Whether we need to send our baked textures to the server - U32 mNumLowresUploads; // Number of times we've sent a lowres version of our baked textures to the server - BOOL mUploadPending; // Whether we have received back the new baked textures - LLUUID mUploadID; // The current upload process (null if none). - LLFrameTimer mNeedsUploadTimer; // Tracks time since upload was requested and performed. - S32 mUploadFailCount; // Number of consecutive upload failures - LLFrameTimer mUploadRetryTimer; // Tracks time since last upload failure. - + //-------------------------------------------------------------------- // Updates //-------------------------------------------------------------------- @@ -157,24 +129,5 @@ class LLViewerTexLayerSetBuffer final : public LLTexLayerSetBuffer, public LLVie LLFrameTimer mNeedsUpdateTimer; // Tracks time since update was requested and performed. }; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// LLBakedUploadData -// -// Used by LLTexLayerSetBuffer for a callback. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -struct LLBakedUploadData -{ - LLBakedUploadData(const LLVOAvatarSelf* avatar, - LLViewerTexLayerSet* layerset, - const LLUUID& id, - bool highest_res); - ~LLBakedUploadData() = default; - const LLUUID mID; - const LLVOAvatarSelf* mAvatar; // note: backlink only; don't LLPointer - LLViewerTexLayerSet* mTexLayerSet; - const U64 mStartTime; // for measuring baked texture upload time - const bool mIsHighestRes; // whether this is a "final" bake, or intermediate low res -}; #endif // LL_VIEWER_TEXLAYER_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e3b481b23c5..b608cc04a59 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1016,8 +1016,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - //LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL; - mCanUseHTTP = false; + LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL; } generateGLTexture(); mGLTexturep->setNeedsAlphaAndPickMask(TRUE); diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 3a546b6976c..8720ecafc54 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -49,7 +49,7 @@ class LLOverrideBakedTextureUpdate public: LLOverrideBakedTextureUpdate(bool temp_state) { - U32 num_bakes = (U32) gAgentAvatarp->getNumBakes(); + U32 num_bakes = (U32) LLAvatarAppearanceDefines::BAKED_NUM_INDICES; for( U32 index = 0; index < num_bakes; ++index ) { composite_enabled[index] = gAgentAvatarp->isCompositeUpdateEnabled(index); @@ -59,7 +59,7 @@ class LLOverrideBakedTextureUpdate ~LLOverrideBakedTextureUpdate() { - U32 num_bakes = (U32) gAgentAvatarp->getNumBakes(); + U32 num_bakes = (U32)LLAvatarAppearanceDefines::BAKED_NUM_INDICES; for( U32 index = 0; index < num_bakes; ++index ) { gAgentAvatarp->setCompositeUpdatesEnabled(index, composite_enabled[index]); @@ -266,7 +266,7 @@ void LLViewerWearable::setParamsToDefaults() { if( (((LLViewerVisualParam*)param)->getWearableType() == mType ) && (param->isTweakable() ) ) { - setVisualParamWeight(param->getID(),param->getDefaultWeight(), false); + setVisualParamWeight(param->getID(),param->getDefaultWeight()); } } } @@ -351,14 +351,14 @@ void LLViewerWearable::writeToAvatar(LLAvatarAppearance *avatarp) ESex new_sex = avatarp->getSex(); if( old_sex != new_sex ) { - viewer_avatar->updateSexDependentLayerSets(FALSE); + viewer_avatar->updateSexDependentLayerSets(); } } // Updates the user's avatar's appearance, replacing this wearables' parameters and textures with default values. // static -void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, bool upload_bake) +void LLViewerWearable::removeFromAvatar( LLWearableType::EType type) { if (!isAgentAvatarValid()) return; @@ -377,7 +377,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, bool upload if( (((LLViewerVisualParam*)param)->getWearableType() == type) && (param->isTweakable() ) ) { S32 param_id = param->getID(); - gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight(), upload_bake ); + gAgentAvatarp->setVisualParamWeight( param_id, param->getDefaultWeight()); } } @@ -387,7 +387,7 @@ void LLViewerWearable::removeFromAvatar( LLWearableType::EType type, bool upload } gAgentAvatarp->updateVisualParams(); - gAgentAvatarp->wearableUpdated(type, false); + gAgentAvatarp->wearableUpdated(type); } // Does not copy mAssetID. diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index d89d350ef18..24b1323b2be 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -62,8 +62,8 @@ class LLViewerWearable : public LLWearable BOOL isOldVersion() const; /*virtual*/ void writeToAvatar(LLAvatarAppearance *avatarp); - void removeFromAvatar(bool upload_bake ) { LLViewerWearable::removeFromAvatar( mType, upload_bake); } - static void removeFromAvatar( LLWearableType::EType type, bool upload_bake ); + void removeFromAvatar() { LLViewerWearable::removeFromAvatar( mType); } + static void removeFromAvatar( LLWearableType::EType type); /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f9de23c5c36..b699e6a3bf7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -710,7 +710,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), mUseLocalAppearance(FALSE), - mUseServerBakes(FALSE), mLastUpdateRequestCOFVersion(-1), mLastUpdateReceivedCOFVersion(-1), mCachedMuteListUpdateTime(0), @@ -795,29 +794,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mVisuallyMuteSetting = LLVOAvatar::VisualMuteSettings(LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(getID())); } -S32 LLVOAvatar::getNumBakes() const -{ -#ifndef LL_HAVOK - // BAKED_LEFT_ARM is equal to the pre-BOM BAKED_NUM_INDICES - if(LLViewerRegion* regionp = getRegion()) - { - // LL_INFOS("BOMOS") - // << getFullname() - // << "Using avatar region settings [" << getRegion()->getName() << "]" - // << " bakesOnMesh = " << static_cast<const char *>(getRegion()->bakesOnMeshEnabled()?"True":"False") - // << LL_ENDL; - return regionp->getRegionMaxBakes(); - } - // LL_INFOS("BOMOS") - // << " Using fallback settings" - // << " bakesOnMesh = " << static_cast<const char *>(LLGridManager::instance().isInSecondLife()?"True":"False") - // << LL_ENDL; - // fallback, in SL assume BOM, elsewhere assume not. - return LLGridManager::instance().isInSecondlife() ? BAKED_NUM_INDICES : BAKED_LEFT_ARM; -#else - return BAKED_NUM_INDICES; -#endif -} std::string LLVOAvatar::avString() const { if (isControlAvatar()) @@ -916,7 +892,7 @@ BOOL LLVOAvatar::isFullyBaked() if (mIsDummy) return TRUE; if (getNumTEs() == 0) return FALSE; - for (U32 i = 0; i < getNumBakes(); i++) + for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex) && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT)) @@ -1134,7 +1110,7 @@ void LLVOAvatar::restoreGL() gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); for (U32 i = 0; i < gAgentAvatarp->mBakedTextureDatas.size(); i++) { - gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i), false); + gAgentAvatarp->invalidateComposite(gAgentAvatarp->getTexLayerSet(i)); } gAgentAvatarp->updateMeshTextures(); } @@ -2124,7 +2100,7 @@ void LLVOAvatar::applyDefaultParams() U8 value = it->second; F32 newWeight = U8_to_F32(value, param->getMinWeight(), param->getMaxWeight()); - param->setWeight(newWeight, false); // Most likely FALSE is correct here because it's used in resetSkeleton, which is a local operation + param->setWeight(newWeight); } } @@ -2515,20 +2491,15 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU if (!result) { const std::string url = getImageURL(te,uuid); - if (!url.empty()) - { - LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; - result = LLViewerTextureManager::getFetchedTextureFromUrl( - url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); - } - else + + if (url.empty()) { - LL_DEBUGS("Avatar") << avString() << "get old-bake image from host " << uuid << LL_ENDL; - LLHost host = getObjectHost(); - result = LLViewerTextureManager::getFetchedTexture( - uuid, FTT_HOST_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + LL_WARNS() << "unable to determine URL for te " << te << " uuid " << uuid << LL_ENDL; + return NULL; } - + LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; + result = LLViewerTextureManager::getFetchedTextureFromUrl( + url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) { result->setIsMissingAsset(false); @@ -2834,8 +2805,8 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) if ( mLipSyncActive ) { - if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight(), false); - if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight(), false); + if( mOohMorph ) mOohMorph->setWeight(mOohMorph->getMinWeight()); + if( mAahMorph ) mAahMorph->setWeight(mAahMorph->getMinWeight()); mLipSyncActive = false; LLCharacter::updateVisualParams(); @@ -3056,14 +3027,10 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() { if (param->isTweakable()) { - param->stopAnimating(FALSE); + param->stopAnimating(); } } updateVisualParams(); - if (isSelf()) - { - gAgent.sendAgentSetAppearance(); - } } else { @@ -3079,7 +3046,7 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() { if (param->isTweakable()) { - param->animate(morph_amt, FALSE); + param->animate(morph_amt); } } } @@ -3136,7 +3103,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) F32 ooh_weight = mOohMorph->getMinWeight() + ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight()); - mOohMorph->setWeight( ooh_weight, false); + mOohMorph->setWeight( ooh_weight); } if( mAahMorph ) @@ -3144,7 +3111,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) F32 aah_weight = mAahMorph->getMinWeight() + aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight()); - mAahMorph->setWeight( aah_weight, false); + mAahMorph->setWeight( aah_weight); } mLipSyncActive = true; @@ -3962,7 +3929,7 @@ void LLVOAvatar::updateAppearanceMessageDebugText() isSelf() ? (all_local_downloaded ? "L" : "l") : "-", all_baked_downloaded ? "B" : "b", mUseLocalAppearance, mIsEditingAppearance, - mUseServerBakes, central_bake_version); + 1, central_bake_version); std::string origin_string = bakedTextureOriginInfo(); debug_line += " [" + origin_string + "]"; S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); @@ -5531,34 +5498,6 @@ bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() const return allTexturesCompletelyDownloaded(baked_ids); } -void LLVOAvatar::bakedTextureOriginCounts(S32 &sb_count, // server-bake, has origin URL. - S32 &host_count, // host-based bake, has host. - S32 &both_count, // error - both host and URL set. - S32 &neither_count) // error - neither set. -{ - sb_count = host_count = both_count = neither_count = 0; - - std::set<LLUUID> baked_ids; - collectBakedTextureUUIDs(baked_ids); - for (std::set<LLUUID>::const_iterator it = baked_ids.begin(); it != baked_ids.end(); ++it) - { - LLViewerFetchedTexture *imagep = gTextureList.findImage(*it, TEX_LIST_STANDARD); - bool has_url = false, has_host = false; - if (!imagep->getUrl().empty()) - { - has_url = true; - } - if (imagep->getTargetHost().isOk()) - { - has_host = true; - } - if (has_url && !has_host) sb_count++; - else if (has_host && !has_url) host_count++; - else if (has_host && has_url) both_count++; - else if (!has_host && !has_url) neither_count++; - } -} - std::string LLVOAvatar::bakedTextureOriginInfo() { std::string result; @@ -5799,19 +5738,6 @@ void LLVOAvatar::updateTextures() { const S32 boost_level = getAvatarBakedBoostLevel(); imagep = LLViewerTextureManager::staticCastToFetchedTexture(getImage(texture_index,0), TRUE); - // Spam if this is a baked texture, not set to default image, without valid host info - if (isIndexBakedTexture((ETextureIndex)texture_index) - && imagep->getID() != IMG_DEFAULT_AVATAR - && imagep->getID() != IMG_INVISIBLE - && !isUsingServerBakes() - && !imagep->getTargetHost().isOk()) - { - LL_WARNS_ONCE("Texture") << "LLVOAvatar::updateTextures No host for texture " - << imagep->getID() << " for avatar " - << (isSelf() ? "<myself>" : getID().asString()) - << " on host " << getRegion()->getHost() << LL_ENDL; - } - addBakedTextureStats( imagep, mPixelArea, texel_area_ratio, boost_level ); } } @@ -5955,22 +5881,19 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) { llassert(isIndexBakedTexture(ETextureIndex(te))); std::string url = ""; - if (isUsingServerBakes()) + const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL(); + if (appearance_service_url.empty()) { - const std::string& appearance_service_url = LLAppearanceMgr::instance().getAppearanceServiceURL(); - if (appearance_service_url.empty()) - { - // Probably a server-side issue if we get here: - LL_WARNS() << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << LL_ENDL; - return url; - } + // Probably a server-side issue if we get here: + LL_WARNS() << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << LL_ENDL; + return url; + } - const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)te); - if (texture_entry != NULL) - { - url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); - //LL_INFOS() << "baked texture url: " << url << LL_ENDL; - } + const LLAvatarAppearanceDictionary::TextureEntry* texture_entry = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)te); + if (texture_entry != NULL) + { + url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); + //LL_INFOS() << "baked texture url: " << url << LL_ENDL; } return url; } @@ -7496,11 +7419,11 @@ BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) //----------------------------------------------------------------------------- // updateSexDependentLayerSets() //----------------------------------------------------------------------------- -void LLVOAvatar::updateSexDependentLayerSets(bool upload_bake) +void LLVOAvatar::updateSexDependentLayerSets() { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake); - invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake); - invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet); } //----------------------------------------------------------------------------- @@ -8261,7 +8184,7 @@ void LLVOAvatar::rebuildAttachments() // [/SL:KB] // virtual -void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset, bool upload_result) +void LLVOAvatar::invalidateComposite( LLTexLayerSet* layerset) { } @@ -8270,19 +8193,19 @@ void LLVOAvatar::invalidateAll() } // virtual -void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) +void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) { if (global_color == mTexSkinColor) { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake); - invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet, upload_bake); - invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet, upload_bake); + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_UPPER].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_LOWER].mTexLayerSet); } else if (global_color == mTexHairColor) { - invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet, upload_bake); - invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet, upload_bake); - + invalidateComposite( mBakedTextureDatas[BAKED_HEAD].mTexLayerSet); + invalidateComposite( mBakedTextureDatas[BAKED_HAIR].mTexLayerSet); + // ! BACKWARDS COMPATIBILITY ! // Fix for dealing with avatars from viewers that don't bake hair. if (!isTextureDefined(mBakedTextureDatas[BAKED_HAIR].mTextureIndex)) @@ -8292,7 +8215,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, bool for (LLAvatarJointMesh* mesh : mBakedTextureDatas[BAKED_HAIR].mJointMeshes) { if (mesh) - { + { mesh->setColor( color ); } } @@ -8301,7 +8224,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, bool else if (global_color == mTexEyeColor) { // LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; - invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake); + invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); } @@ -8519,7 +8442,7 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); - record["is_using_server_bakes"] = ((bool) isUsingServerBakes()); + record["is_using_server_bakes"] = true; record["is_self"] = isSelf(); if (isAgentAvatarValid()) @@ -8945,7 +8868,7 @@ void LLVOAvatar::updateMeshTextures() mBakedTextureDebugText += llformat("%06d\n",update_counter++); mBakedTextureDebugText += "indx layerset linvld ltda ilb ulkg ltid\n"; - for (U32 i=0; i < getNumBakes(); i++) + for (U32 i=0; i < mBakedTextureDatas.size(); i++) { is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex); LLViewerTexLayerSet* layerset = NULL; @@ -8993,7 +8916,8 @@ void LLVOAvatar::updateMeshTextures() use_lkg_baked_layer[i], last_id_string.c_str()); } - for (U32 i=0; i < getNumBakes(); i++) + + for (U32 i=0; i < mBakedTextureDatas.size(); i++) { debugColorizeSubMeshes(i, LLColor4::white); @@ -9252,7 +9176,7 @@ void LLVOAvatar::releaseComponentTextures() } } - for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++) + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { const LLAvatarAppearanceDictionary::BakedEntry * bakedDicEntry = LLAvatarAppearance::getDictionary()->getBakedTexture((EBakedTextureIndex)baked_index); // skip if this is a skirt and av is not wearing one, or if we don't have a baked texture UUID @@ -9646,13 +9570,13 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { appearance_version = contents.mParamAppearanceVersion; } - if (contents.mAppearanceVersion >= 0) + else if (contents.mAppearanceVersion > 0) { appearance_version = contents.mAppearanceVersion; } - if (appearance_version < 0) // still not set, go with 0. + else // still not set, go with 1. { - appearance_version = 0; + appearance_version = 1; } //LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion // << " param: " << contents.mParamAppearanceVersion @@ -9707,16 +9631,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // we must prevent rolling this one backwards backwards or processing // stale versions. - LL_DEBUGS("Avatar") << "handling self appearance message #" << thisAppearanceVersion << + LL_DEBUGS("Avatar") << "handling self appearance message #" << thisAppearanceVersion << " (highest seen #" << mLastUpdateReceivedCOFVersion << ") (AISCOF=#" << LLAppearanceMgr::instance().getCOFVersion() << ")" << LL_ENDL; - if (mFirstTEMessageReceived && (appearance_version == 0)) - { - return; - } - - if ((appearance_version > 0) && mLastUpdateReceivedCOFVersion >= thisAppearanceVersion) + if (mLastUpdateReceivedCOFVersion >= thisAppearanceVersion) { LL_WARNS("Avatar") << "Stale appearance received #" << thisAppearanceVersion << " attempt to roll back from #" << mLastUpdateReceivedCOFVersion << @@ -9771,8 +9690,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // of the COF that should be considered canonical. mLastUpdateReceivedCOFVersion = thisAppearanceVersion; - - setIsUsingServerBakes(appearance_version > 0); mLastProcessedAppearance = contents; bool slam_params = false; @@ -9800,14 +9717,14 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT && baked_index != BAKED_LEFT_ARM && baked_index != BAKED_LEFT_LEG && baked_index != BAKED_AUX1 && baked_index != BAKED_AUX2 && baked_index != BAKED_AUX3) { - LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } #ifdef SHOW_DEBUG else { - LL_DEBUGS("Avatar") << avString() << "sb " << (S32) isUsingServerBakes() << " baked_index " << (S32) baked_index << " using texture id " + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id " << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL; } #endif @@ -9851,20 +9768,18 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte if(is_first_appearance_message || slam_params) { //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL; - param->setWeight(newWeight, false); + param->setWeight(newWeight); } else { interp_params = TRUE; - param->setAnimationTarget(newWeight, false); + param->setAnimationTarget(newWeight); } } } - #ifdef SHOW_DEBUG const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE) + getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TRANSMIT_NOT_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT - if (num_params != expected_tweakable_count) { LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL; @@ -9883,7 +9798,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte ESex new_sex = getSex(); if( old_sex != new_sex ) { - updateSexDependentLayerSets(FALSE); + updateSexDependentLayerSets(); } } @@ -9942,11 +9857,12 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte updateMeshTextures(); updateMeshVisibility(); + } LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te) { - if (te < 0 || te >= getNumBakes()) + if (te < 0 || te >= BAKED_NUM_INDICES) { return NULL; } @@ -10663,39 +10579,6 @@ void LLVOAvatar::startAppearanceAnimation() } } -// virtual -void LLVOAvatar::bodySizeChanged() -{ - if (isSelf() && !LLAppearanceMgr::instance().isInUpdateAppearanceFromCOF()) - { // notify simulator of change in size - // but not if we are in the middle of updating appearance - gAgent.sendAgentSetAppearance(); - } -} - -BOOL LLVOAvatar::isUsingServerBakes() const -{ - // Sanity check - visual param for appearance version should match mUseServerBakes - LLVisualParam* appearance_version_param = getVisualParam(11000); - llassert(appearance_version_param); - F32 wt = appearance_version_param->getWeight(); - F32 expect_wt = mUseServerBakes ? 1.f : 0.f; - if (!is_approx_equal(wt, expect_wt)) - { - LL_WARNS() << "wt " << wt << " differs from expected " << expect_wt << LL_ENDL; - } - - return mUseServerBakes; -} - -void LLVOAvatar::setIsUsingServerBakes(BOOL newval) -{ - mUseServerBakes = newval; - LLVisualParam* appearance_version_param = getVisualParam(11000); - llassert(appearance_version_param); - appearance_version_param->setWeight(newval ? 1.f : 0.f, false); -} - // virtual void LLVOAvatar::removeMissingBakedTextures() { @@ -11402,7 +11285,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() hud_complexity_list_t hud_complexity_list; object_complexity_list_t object_complexity_list; - for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++) + for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearance::getDictionary()->getBakedTexture((EBakedTextureIndex)baked_index); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 4e10fe1f221..2bd59ebd0ba 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -412,7 +412,6 @@ class LLVOAvatar : BOOL hasGray() const; S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded. void updateRezzedStatusTimers(S32 status); - S32 getNumBakes() const; S32 mLastRezzedStatus; @@ -623,7 +622,7 @@ class LLVOAvatar : // Global colors //-------------------------------------------------------------------- public: - /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color, bool upload_bake) override; + /*virtual*/void onGlobalColorChanged(const LLTexGlobalColor* global_color) override; //-------------------------------------------------------------------- // Visibility @@ -778,7 +777,7 @@ class LLVOAvatar : // Composites //-------------------------------------------------------------------- public: - void invalidateComposite(LLTexLayerSet* layerset, bool upload_result) override; + void invalidateComposite(LLTexLayerSet* layerset) override; virtual void invalidateAll(); virtual void setCompositeUpdatesEnabled(bool b) {} virtual void setCompositeUpdatesEnabled(U32 index, bool b) {} @@ -812,7 +811,7 @@ class LLVOAvatar : public: void debugColorizeSubMeshes(U32 i, const LLColor4& color); void updateMeshTextures() final override; - void updateSexDependentLayerSets(bool upload_bake); + void updateSexDependentLayerSets(); void dirtyMesh() final override; // Dirty the avatar mesh void updateMeshData(); void updateMeshVisibility(); @@ -880,7 +879,6 @@ class LLVOAvatar : void hideHair(); void hideSkirt(); void startAppearanceAnimation(); - /*virtual*/ void bodySizeChanged() override; //-------------------------------------------------------------------- // Appearance morphing @@ -893,9 +891,6 @@ class LLVOAvatar : // editing or when waiting for a subsequent server rebake. /*virtual*/ BOOL isUsingLocalAppearance() const override { return mUseLocalAppearance; } - BOOL isUsingServerBakes() const override; - void setIsUsingServerBakes(BOOL newval); - // True if we are currently in appearance editing mode. Often but // not always the same as isUsingLocalAppearance(). /*virtual*/ BOOL isEditingAppearance() const override { return mIsEditingAppearance; } @@ -908,7 +903,6 @@ class LLVOAvatar : F32 mLastAppearanceBlendTime; BOOL mIsEditingAppearance; // flag for if we're actively in appearance editing mode BOOL mUseLocalAppearance; // flag for if we're using a local composite - BOOL mUseServerBakes; // flag for if baked textures should be fetched from baking service (false if they're temporary uploads) //-------------------------------------------------------------------- // Visibility diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 481457d816f..2dbf03fbb6a 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -193,15 +193,6 @@ bool update_avatar_rez_metrics() return false; } -bool check_for_unsupported_baked_appearance() -{ - if (!isAgentAvatarValid()) - return true; - - gAgentAvatarp->checkForUnsupportedServerBakeAppearance(); - return false; -} - void LLVOAvatarSelf::initInstance() { BOOL status = TRUE; @@ -243,7 +234,6 @@ void LLVOAvatarSelf::initInstance() //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); - doPeriodically(check_for_unsupported_baked_appearance, 120.0); doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0); mInitFlags |= 1<<2; @@ -251,19 +241,14 @@ void LLVOAvatarSelf::initInstance() void LLVOAvatarSelf::setHoverIfRegionEnabled() { - LLViewerRegion* region = getRegion(); - if (region && region->simulatorFeaturesReceived()) + if (getRegion() && getRegion()->simulatorFeaturesReceived()) { - if (region->avatarHoverHeightEnabled()) + if (getRegion()->avatarHoverHeightEnabled()) { F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); setHoverOffset(LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z))); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << hover_z << LL_ENDL; } - else if (!isUsingServerBakes()) - { - computeBodySize(); - } else { setHoverOffset(LLVector3(0.0, 0.0, 0.0)); @@ -273,9 +258,9 @@ void LLVOAvatarSelf::setHoverIfRegionEnabled() else { LL_INFOS("Avatar") << avString() << " region or simulator features not known, no change on hover" << LL_ENDL; - if (region) + if (getRegion()) { - region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived, this, _1)); + getRegion()->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived,this,_1)); } } @@ -746,35 +731,35 @@ LLJoint *LLVOAvatarSelf::getJoint(const std::string &name) } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake) +BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight) { if (!which_param) { return FALSE; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(which_param->getID()); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake) +BOOL LLVOAvatarSelf::setVisualParamWeight(const char* param_name, F32 weight) { if (!param_name) { return FALSE; } LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(param_name); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight, bool upload_bake) +BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight) { LLViewerVisualParam *param = (LLViewerVisualParam*) LLCharacter::getVisualParam(index); - return setParamWeight(param,weight,upload_bake); + return setParamWeight(param,weight); } -BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight, bool upload_bake) +BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight) { if (!param) { @@ -790,12 +775,12 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight LLViewerWearable *wearable = gAgentWearables.getViewerWearable(type,count); if (wearable) { - wearable->setVisualParamWeight(param->getID(), weight, upload_bake); + wearable->setVisualParamWeight(param->getID(), weight); } } } - return LLCharacter::setVisualParamWeight(param,weight,upload_bake); + return LLCharacter::setVisualParamWeight(param,weight); } /*virtual*/ @@ -821,7 +806,7 @@ void LLVOAvatarSelf::writeWearablesToAvatar() void LLVOAvatarSelf::idleUpdateAppearanceAnimation() { // Animate all top-level wearable visual parameters - gAgentWearables.animateAllWearableParams(calcMorphAmount(), FALSE); + gAgentWearables.animateAllWearableParams(calcMorphAmount()); // Apply wearable visual params to avatar writeWearablesToAvatar(); @@ -915,33 +900,9 @@ void LLVOAvatarSelf::removeMissingBakedTextures() { LLViewerTexLayerSet *layerset = getTexLayerSet(i); layerset->setUpdatesEnabled(TRUE); - invalidateComposite(layerset, false); + invalidateComposite(layerset); } updateMeshTextures(); - if (getRegion() && !getRegion()->getCentralBakeVersion()) - { - requestLayerSetUploads(); - } - } -} - -void LLVOAvatarSelf::checkBOMRebakeRequired() -{ - if(getRegion()) - { - auto newBOMStatus = getRegion()->bakesOnMeshEnabled(); - static const LLCachedControl<bool> using_bom(gSavedSettings, "CurrentlyUsingBakesOnMesh", true); - if(using_bom != newBOMStatus) - { - // force a rebake when the last grid we were on (including previous login) had different BOM support - // This replicates forceAppearanceUpdate rather than pulling in the whole of llavatarself. - if(!LLGridManager::instance().isInSecondlife()) - { - doAfterInterval([](){ if (isAgentAvatarValid()) { gAgentAvatarp->forceBakeAllTextures(true); }}, 5.0); - } - // update the setting even if we are in SL so that switch SL to OS and back - gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", newBOMStatus); - } } } @@ -949,7 +910,6 @@ void LLVOAvatarSelf::onSimulatorFeaturesReceived(const LLUUID& region_id) { LL_INFOS("Avatar") << "simulator features received, setting hover based on region props" << LL_ENDL; setHoverIfRegionEnabled(); - checkBOMRebakeRequired(); // BOM we may have stale cache, rebake may be needed } //virtual @@ -976,7 +936,6 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) if (regionp->simulatorFeaturesReceived()) { setHoverIfRegionEnabled(); - checkBOMRebakeRequired(); } else { @@ -1144,7 +1103,7 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) // forces an update to any baked textures relevant to type. // will force an upload of the resulting bake if the second parameter is TRUE //----------------------------------------------------------------------------- -void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type, bool upload_result) +void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type) { for (const auto& baked_pair : sAvatarDictionary->getBakedTextures()) { @@ -1161,20 +1120,13 @@ void LLVOAvatarSelf::wearableUpdated(LLWearableType::EType type, bool upload_res if (layerset) { layerset->setUpdatesEnabled(true); - invalidateComposite(layerset, upload_result); + invalidateComposite(layerset); } break; } } } } - - // Physics type has no associated baked textures, but change of params needs to be sent to - // other avatars. - if (type == LLWearableType::WT_PHYSICS) - { - gAgent.sendAgentSetAppearance(); - } } //----------------------------------------------------------------------------- @@ -1625,15 +1577,6 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const return TRUE; } -BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const -{ - const LLViewerTexLayerSet *layerset = getLayerSet(index); - if (!layerset) return FALSE; - const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite(); - if (!layerset_buffer) return FALSE; - return !layerset_buffer->uploadNeeded(); -} - BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { LLUUID id; @@ -1699,48 +1642,12 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t } } -//----------------------------------------------------------------------------- -// requestLayerSetUploads() -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::requestLayerSetUploads() -{ - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - requestLayerSetUpload((EBakedTextureIndex)i); - } -} - -void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i) -{ - ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; - const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); - LLViewerTexLayerSet *layerset = getLayerSet(i); - if (!layer_baked && layerset) - { - layerset->requestUpload(); - } -} - bool LLVOAvatarSelf::areTexturesCurrent() const { - return !hasPendingBakedUploads() && gAgentWearables.areWearablesLoaded(); + return gAgentWearables.areWearablesLoaded(); } -// virtual -bool LLVOAvatarSelf::hasPendingBakedUploads() const -{ - for (U32 i = 0; i < getNumBakes(); i++) - { - LLViewerTexLayerSet* layerset = getTexLayerSet(i); - if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending()) - { - return true; - } - } - return false; -} - -void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, bool upload_result) +void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset) { LLViewerTexLayerSet *layer_set = dynamic_cast<LLViewerTexLayerSet*>(layerset); if( !layer_set || !layer_set->getUpdatesEnabled() ) @@ -1751,16 +1658,6 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, bool upload_r layer_set->requestUpdate(); layer_set->invalidateMorphMasks(); - - if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion())) - { - llassert(isSelf()); - - ETextureIndex baked_te = getBakedTE( layer_set ); - setTEImage( baked_te, LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR) ); - layer_set->requestUpload(); - updateMeshTextures(); - } } void LLVOAvatarSelf::invalidateAll() @@ -1768,7 +1665,7 @@ void LLVOAvatarSelf::invalidateAll() for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { LLViewerTexLayerSet *layerset = getTexLayerSet(i); - invalidateComposite(layerset, true); + invalidateComposite(layerset); } //mDebugSelfLoadTimer.reset(); } @@ -2525,49 +2422,6 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } } -void CheckAgentAppearanceService_httpSuccess( LLSD const &aData ) -{ - LL_DEBUGS("Avatar") << "OK" << LL_ENDL; -} - -void forceAppearanceUpdate() -{ - // Trying to rebake immediately after crossing region boundary - // seems to be failure prone; adding a delay factor. Yes, this - // fix is ad-hoc and not guaranteed to work in all cases. - doAfterInterval([](){ if (isAgentAvatarValid()) { gAgentAvatarp->forceBakeAllTextures(true); }}, 5.0); -} - -void CheckAgentAppearanceService_httpFailure( LLSD const &aData ) -{ - if (isAgentAvatarValid()) - { - LL_DEBUGS("Avatar") << "failed, will rebake " << aData << LL_ENDL; - forceAppearanceUpdate(); - } -} - -void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance() -{ - // Need to check only if we have a server baked appearance and are - // in a non-baking region. - if (!gAgentAvatarp->isUsingServerBakes()) - return; - if (!gAgent.getRegion() || gAgent.getRegion()->getCentralBakeVersion()!=0) - return; - - // if baked image service is unknown, need to refresh. - if (LLAppearanceMgr::instance().getAppearanceServiceURL().empty()) - { - forceAppearanceUpdate(); - } - // query baked image service to check status. - std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED, - getTE(TEX_HEAD_BAKED)->getID()); - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet( image_url, CheckAgentAppearanceService_httpSuccess, CheckAgentAppearanceService_httpFailure ); -} - const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { if (canGrabBakedTexture(baked_index)) @@ -2723,81 +2577,6 @@ ETextureIndex LLVOAvatarSelf::getBakedTE( const LLViewerTexLayerSet* layerset ) return TEX_HEAD_BAKED; } - -void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid) -{ - ETextureIndex index = LLAvatarAppearance::getDictionary()->bakedToLocalTextureIndex(i); - setNewBakedTexture(index, uuid); -} - - -//----------------------------------------------------------------------------- -// setNewBakedTexture() -// A new baked texture has been successfully uploaded and we can start using it now. -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) -{ - // Baked textures live on other sims. - LLHost target_host = getObjectHost(); - setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) ); - updateMeshTextures(); - dirtyMesh(); - - LLVOAvatar::cullAvatarsByPixelArea(); - - /* switch(te) - case TEX_HEAD_BAKED: - LL_INFOS() << "New baked texture: HEAD" << LL_ENDL; */ - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture(te); - if (texture_dict->mIsBakedTexture) - { - debugBakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish. - LL_INFOS() << "New baked texture: " << texture_dict->mName << " UUID: " << uuid <<LL_ENDL; - } - else - { - LL_WARNS() << "New baked texture: unknown te " << te << LL_ENDL; - } - - // dumpAvatarTEs( "setNewBakedTexture() send" ); - // RN: throttle uploads - if (!hasPendingBakedUploads()) - { - gAgent.sendAgentSetAppearance(); - - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32()); - if (isAllLocalTextureDataFinal()) - { - LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedDoneNotification" - << LL_ENDL; - } - else - { - args["STATUS"] = debugDumpAllLocalTextureDataInfo(); - LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() - << " Notification " << "AvatarRezSelfBakedUpdateNotification" - << LL_ENDL; - } - } - - outputRezDiagnostics(); - } -} // FIXME: This is not called consistently. Something may be broken. void LLVOAvatarSelf::outputRezDiagnostics() const { @@ -2840,7 +2619,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const } } LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << LL_ENDL; - for (U32 i = 0; i < getNumBakes(); ++i) + for (U32 i = 0; i < LLAvatarAppearanceDefines::BAKED_NUM_INDICES; ++i) { LL_DEBUGS("Avatar") << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << LL_ENDL; } @@ -2873,76 +2652,6 @@ void LLVOAvatarSelf::reportAvatarRezTime() const // TODO: report mDebugSelfLoadTimer.getElapsedTimeF32() somehow. } -//----------------------------------------------------------------------------- -// setCachedBakedTexture() -// A baked texture id was received from a cache query, make it active -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid ) -{ - setTETexture( te, uuid ); - - /* switch(te) - case TEX_HEAD_BAKED: - if( mHeadLayerSet ) - mHeadLayerSet->cancelUpload(); */ - for (U32 i = 0; i < mBakedTextureDatas.size(); i++) - { - LLViewerTexLayerSet *layerset = getTexLayerSet(i); - if ( mBakedTextureDatas[i].mTextureIndex == te && layerset) - { - layerset->cancelUpload(); - } - } -} - -// static -void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) -{ - LLUUID texture_id; - msg->getUUID("TextureData", "TextureID", texture_id); - if (!isAgentAvatarValid()) return; - - // If this is a texture corresponding to one of our baked entries, - // just rebake that layer set. - BOOL found = FALSE; - - /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] = - TEX_HEAD_BAKED, - TEX_UPPER_BAKED, */ - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearance::getDictionary()->getTextures().begin(); - iter != LLAvatarAppearance::getDictionary()->getTextures().end(); - ++iter) - { - const ETextureIndex index = iter->first; - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - if (texture_dict->mIsBakedTexture) - { - if (texture_id == gAgentAvatarp->getTEImage(index)->getID()) - { - LLViewerTexLayerSet* layer_set = gAgentAvatarp->getLayerSet(index); - if (layer_set) - { - LL_INFOS() << "TAT: rebake - matched entry " << (S32)index << LL_ENDL; - gAgentAvatarp->invalidateComposite(layer_set, true); - found = TRUE; - add(LLStatViewer::TEX_REBAKES, 1); - } - } - } - } - - // If texture not found, rebake all entries. - if (!found) - { - gAgentAvatarp->forceBakeAllTextures(); - } - else - { - // Not sure if this is necessary, but forceBakeAllTextures() does it. - gAgentAvatarp->updateMeshTextures(); - } -} - // SUNSHINE CLEANUP - not clear we need any of this, may be sufficient to request server appearance in llviewermenu.cpp:handle_rebake_textures() void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) { @@ -2957,10 +2666,9 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) if (slam_for_debug) { layer_set->setUpdatesEnabled(TRUE); - layer_set->cancelUpload(); } - invalidateComposite(layer_set, true); + invalidateComposite(layer_set); add(LLStatViewer::TEX_REBAKES, 1); } else @@ -3016,13 +2724,16 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) case TEX_HEAD_BAKED: case TEX_HEAD_BODYPAINT: return mHeadLayerSet; */ - if (baked_index >= 0 && baked_index < getNumBakes()) + if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES) { return getTexLayerSet(baked_index); } return NULL; } + + + // static void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) { @@ -3054,12 +2765,6 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) if (isAgentAvatarValid()) { gAgentAvatarp->mIsEditingAppearance = false; - if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion()) - { - // FIXME DRANO - move to sendAgentSetAppearance, make conditional on upload complete. - gAgentAvatarp->mUseLocalAppearance = false; - } - gAgentAvatarp->invalidateAll(); if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) @@ -3094,15 +2799,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { const ETextureIndex index = tex_pair.first; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_pair.second; - if( (index == TEX_SKIRT || index == TEX_SKIRT_TATTOO) && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT) ) - { - // TODO(BEQ): combine this with clause below once proven it works. - LL_DEBUGS("Avatar") << "Ignoring skirt related texture at index=" << index << LL_ENDL; - LLTextureEntry* entry = getTE((U8) index); - texture_id[index] = entry->getID(); - entry->setID(IMG_DEFAULT_AVATAR); - } - if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs()) + if (!texture_dict->mIsBakedTexture) { LLTextureEntry* entry = getTE((U8) index); texture_id[index] = entry->getID(); @@ -3117,7 +2814,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { const ETextureIndex index = tex_pair.first; const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_pair.second; - if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs()) + if (!texture_dict->mIsBakedTexture) { LLTextureEntry* entry = getTE((U8) index); entry->setID(texture_id[index]); @@ -3167,13 +2864,6 @@ void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_upd } } -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -F32 LLVOAvatarSelf::getAvatarOffset() /*const*/ -{ - return (isUsingServerBakes()) ? LLAvatarAppearance::getAvatarOffset() : gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); -} -// [/RLVa:KB] - //------------------------------------------------------------------------ // needsRenderBeam() //------------------------------------------------------------------------ diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index c99f450fd50..9e8f82a74b9 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -92,16 +92,16 @@ class LLVOAvatarSelf final : /*virtual*/ void requestStopMotion(LLMotion* motion) override; /*virtual*/ LLJoint* getJoint(const std::string &name) override; - /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight, bool upload_bake = false) override; - /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, bool upload_bake = false) override; - /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, bool upload_bake = false) override; + /*virtual*/ BOOL setVisualParamWeight(const LLVisualParam *which_param, F32 weight) override; + /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight) override; + /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight) override; /*virtual*/ void updateVisualParams() override; void writeWearablesToAvatar(); /*virtual*/ void idleUpdateAppearanceAnimation() override; private: // helper function. Passed in param is assumed to be in avatar's parameter list. - BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight, bool upload_bake = false); + BOOL setParamWeight(const LLViewerVisualParam *param, F32 weight); /******************************************************************************** ** ** @@ -175,12 +175,10 @@ class LLVOAvatarSelf final : // Loading status //-------------------------------------------------------------------- public: - bool hasPendingBakedUploads() const; S32 getLocalDiscardLevel(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const; bool areTexturesCurrent() const; BOOL isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const; BOOL isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const; - BOOL isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const; // If you want to check all textures of a given type, pass gAgentWearables.getWearableCount() for index /*virtual*/ BOOL isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const override; /*virtual*/ BOOL isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index = 0) const override; @@ -217,12 +215,6 @@ class LLVOAvatarSelf final : LLAvatarAppearanceDefines::ETextureIndex getBakedTE(const LLViewerTexLayerSet* layerset ) const; // SUNSHINE CLEANUP - dead? or update to just call request appearance update? void forceBakeAllTextures(bool slam_for_debug = false); - - void setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid); - void setNewBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid); - void setCachedBakedTexture(LLAvatarAppearanceDefines::ETextureIndex i, const LLUUID& uuid); - static void processRebakeAvatarTextures(LLMessageSystem* msg, void**); - protected: /*virtual*/ void removeMissingBakedTextures() override; @@ -230,8 +222,6 @@ class LLVOAvatarSelf final : // Layers //-------------------------------------------------------------------- public: - void requestLayerSetUploads(); - void requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i); void requestLayerSetUpdate(LLAvatarAppearanceDefines::ETextureIndex i); LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex baked_index) const; LLViewerTexLayerSet* getLayerSet(LLAvatarAppearanceDefines::ETextureIndex index) const; @@ -241,7 +231,7 @@ class LLVOAvatarSelf final : // Composites //-------------------------------------------------------------------- public: - /* virtual */ void invalidateComposite(LLTexLayerSet* layerset, bool upload_result) override; + /* virtual */ void invalidateComposite(LLTexLayerSet* layerset) override; /* virtual */ void invalidateAll() override; /* virtual */ void setCompositeUpdatesEnabled(bool b) override; // only works for self /* virtual */ void setCompositeUpdatesEnabled(U32 index, bool b) override; @@ -283,7 +273,7 @@ class LLVOAvatarSelf final : **/ public: - void wearableUpdated(LLWearableType::EType type, bool upload_result); + void wearableUpdated(LLWearableType::EType type); protected: U32 getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const; @@ -349,11 +339,6 @@ class LLVOAvatarSelf final : private: mutable LLVector3 mLastHoverOffsetSent; -// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) -protected: - /*virtual*/ F32 getAvatarOffset() /*const*/ override; -// [/RLVa:KB] - /** Appearance ** ** *******************************************************************************/ @@ -408,7 +393,6 @@ class LLVOAvatarSelf final : const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change. - void checkForUnsupportedServerBakeAppearance(); private: LLFrameTimer mDebugSelfLoadTimer; F32 mDebugTimeWearablesLoaded; @@ -417,8 +401,6 @@ class LLVOAvatarSelf final : F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); - void checkBOMRebakeRequired(); - void appearanceChangeMetricsCoro(std::string url); bool mInitialMetric; S32 mMetricSequence; diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 8bd2ec4c848..df3518f67aa 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -2785,7 +2785,7 @@ ERlvCmdRet RlvHandler::processForceCommand(const RlvCommand& rlvCmd) const { F32 nValue = (rlvCmdOption.m_nPelvisToFoot - gAgentAvatarp->getPelvisToFoot()) * rlvCmdOption.m_nPelvisToFootDeltaMult; nValue += rlvCmdOption.m_nPelvisToFootOffset; - if (gAgentAvatarp->getRegion()->avatarHoverHeightEnabled() || !gAgentAvatarp->isUsingServerBakes()) + if (gAgentAvatarp->getRegion()->avatarHoverHeightEnabled()) { LLVector3 avOffset(0.0f, 0.0f, llclamp<F32>(nValue, MIN_HOVER_Z, MAX_HOVER_Z)); gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", avOffset.mV[VZ]); -- GitLab