diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 9f9f564ba6457c6ec381700b16bfbf6dc4fee9db..da087786c9adf6d7d4948cb8e492bbb7d6660107 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -4076,7 +4076,7 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo static LLFastTimer::DeclareTimer FTM_MESH_FETCH_GET_SKIN_INFO("Get Skin Info"); static LLFastTimer::DeclareTimer FTM_MESH_FETCH_GET_SKIN_INFO_FETCH("Get Skin Info Fetch"); -LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj) +const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj) { LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH); LL_RECORD_BLOCK_TIME(FTM_MESH_FETCH_GET_SKIN_INFO); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 8e9f37afc1c985bb21dfd7330dba2eec88e2f912..77f02fcf918e6623164afcde1ad2341a7240da66 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -597,7 +597,7 @@ public: S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); static S32 getActualMeshLOD(LLSD& header, S32 lod); - LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj); + const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj); LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id); void fetchPhysicsShape(const LLUUID& mesh_id); bool hasPhysicsShape(const LLUUID& mesh_id); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0948199385204e4fddafda5576b0b23271d2a88f..a162f48374fd3676fac81acb6d67d000aa457bbf 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6362,7 +6362,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL LLViewerObject *root_object = (LLViewerObject*)vobj->getRoot(); LL_DEBUGS("AnimatedObjects") << "trying to add attachment overrides for root object " << root_object->getID() << " prim is " << vobj << LL_ENDL; - if (vobj->isRiggedMesh() && + if (vobj->isMesh() && ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled())) { LL_DEBUGS("AnimatedObjects") << "failed to add attachment overrides for root object " << root_object->getID() << " mesh asset not loaded" << LL_ENDL; @@ -6370,7 +6370,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL } const LLMeshSkinInfo* pSkinData = nullptr; - if ( vobj && vobj->isMesh() && (pSkinData = vobj->getSkinInfo()) ) + if ( vobj && vobj->isMesh() && (pSkinData = vobj->getSkinInfo()) && vobj->getVolume() && vobj->getVolume()->isMeshAssetLoaded() && gMeshRepo.meshRezEnabled()) { const size_t bindCnt = pSkinData->mAlternateBindMatrix.size(); const size_t jointCnt = pSkinData->mJointNames.size(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 14dd17912bdd87b4ea523e929b59068870f72744..9b7280c8e26be860d77b299ffdd910f3e82913b0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -237,7 +237,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mSculptChanged = FALSE; mSpotLightPriority = 0.f; - mSkinInfoReceived = false; mSkinInfoFailed = false; mSkinInfo = NULL; @@ -1064,7 +1063,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID()) { mSkinInfo = NULL; - mSkinInfoReceived = false; mSkinInfoFailed = false; } @@ -1078,7 +1076,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams ¶ms_in, const S32 detail, bo } } - if (!mSkinInfo && !isSkinInfoLoaded() && !hasSkinInfoFailed()) + if (!mSkinInfo && !hasSkinInfoFailed()) { mSkinInfo = gMeshRepo.getSkinInfo(volume_params.getSculptID(), this); if (mSkinInfo) @@ -1119,6 +1117,7 @@ void LLVOVolume::updateSculptTexture() mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); } + mSkinInfoFailed = false; mSkinInfo = NULL; } else @@ -1170,29 +1169,17 @@ void LLVOVolume::notifyMeshLoaded() updateVisualComplexity(); } -void LLVOVolume::notifySkinInfoLoaded(LLMeshSkinInfo* skin) +void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin) { mSkinInfoFailed = false; - mSkinInfoReceived = true; mSkinInfo = skin; - mSculptChanged = TRUE; - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_RIGGED, TRUE); - - if (getAvatar() && !isAnimatedObject()) - { - getAvatar()->addAttachmentOverridesForObject(this); - } - if (getControlAvatar() && isAnimatedObject()) - { - getControlAvatar()->addAttachmentOverridesForObject(this); - } + notifyMeshLoaded(); } void LLVOVolume::notifySkinInfoUnavailable() { mSkinInfoFailed = true; - mSkinInfoReceived = false; mSkinInfo = nullptr; } diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index b45be1823a792f7237324e09921ee84f95763a34..11dbf8ecd5b67d2d58e5064f9718aa737e7b6dd8 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -334,7 +334,7 @@ public: void updateVisualComplexity(); void notifyMeshLoaded(); - void notifySkinInfoLoaded(LLMeshSkinInfo* skin); + void notifySkinInfoLoaded(const LLMeshSkinInfo* skin); void notifySkinInfoUnavailable(); // Returns 'true' iff the media data for this object is in flight @@ -414,12 +414,10 @@ private: LLPointer<LLRiggedVolume> mRiggedVolume; - bool isSkinInfoLoaded() { return mSkinInfoReceived; } - bool hasSkinInfoFailed() { return mSkinInfoFailed; } + bool hasSkinInfoFailed() const { return mSkinInfoFailed; } - bool mSkinInfoReceived; bool mSkinInfoFailed; - LLMeshSkinInfo *mSkinInfo; + const LLMeshSkinInfo *mSkinInfo; // statics public: