diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-25 20:16:39 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-25 20:16:39 +0100 |
commit | 96bc66a55778d25fa36ca42092f0ce3ca57bb3ce (patch) | |
tree | 6365bca70016684fb18156ade07b0654fe9a59c2 | |
parent | 6b6807598fa265750571e8ec9fa1b87b949be1fe (diff) |
SL-779 - refactoring related to rigged-mesh determination. animated objects must contain some triangles even if not at the root
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 1 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 37 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 3 |
5 files changed, 35 insertions, 38 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 869e37e08c..b39b2cd6e5 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1681,13 +1681,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) continue; } - LLUUID mesh_id = volume->getParams().getSculptID(); - if (mesh_id.isNull()) - { - continue; - } - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); + const LLMeshSkinInfo* skin = vobj->getSkinInfo(); if (!skin) { continue; @@ -1901,13 +1895,7 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) continue; } - LLUUID mesh_id = volume->getParams().getSculptID(); - if (mesh_id.isNull()) - { - continue; - } - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(mesh_id, vobj); + const LLMeshSkinInfo* skin = vobj->getSkinInfo(); if (!skin) { continue; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index e72f623ee2..09b87e4a3a 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -232,6 +232,7 @@ public: virtual BOOL isFlexible() const { return FALSE; } virtual BOOL isSculpted() const { return FALSE; } virtual BOOL isMesh() const { return FALSE; } + virtual BOOL isRiggedMesh() const { return FALSE; } virtual BOOL hasLightTexture() const { return FALSE; } // This method returns true if the object is over land owned by diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d6051e7c63..1c4a6e4eb7 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5655,14 +5655,14 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) LLVOVolume* pVObj = pVO->mDrawable->getVOVolume(); if ( pVObj ) { - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj ); + const LLMeshSkinInfo* pSkinData = pVObj->getSkinInfo(); if (pSkinData && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig && pSkinData->mAlternateBindMatrix.size() > 0 ) - { - mesh_id = pSkinData->mMeshID; - return true; - } + { + mesh_id = pSkinData->mMeshID; + return true; + } } } return false; @@ -5709,8 +5709,7 @@ bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerOb return false; } - LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); + const LLMeshSkinInfo* pSkinData = vobj->getSkinInfo(); if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) { @@ -5814,8 +5813,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { return; } - LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); - const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); + const LLMeshSkinInfo* pSkinData = vobj->getSkinInfo(); if ( vobj && vobj->isMesh() && pSkinData ) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c020cb43d2..c9bf609940 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3314,6 +3314,24 @@ BOOL LLVOVolume::setIsFlexible(BOOL is_flexible) return res; } +const LLMeshSkinInfo* LLVOVolume::getSkinInfo() const +{ + if (getVolume()) + { + return gMeshRepo.getSkinInfo(getVolume()->getParams().getSculptID(), this); + } + else + { + return NULL; + } +} + +// virtual +BOOL LLVOVolume::isRiggedMesh() const +{ + return isMesh() && getSkinInfo(); +} + //---------------------------------------------------------------------------- // AXON - methods related to extended mesh flags @@ -3382,18 +3400,12 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags) bool LLVOVolume::canBeAnimatedObject() const { -#if 0 - // AXON: we used to enforce that root had to be mesh. Should we at - // least require that some element of the linkset is mesh? Only - // problem with this is failures while mesh header is still being - // loaded. F32 est_tris = recursiveGetEstTrianglesMax(); if (est_tris <= 0 || est_tris > getAnimatedObjectMaxTris()) { LL_INFOS() << "est_tris " << est_tris << " is outside limit of 1-" << getAnimatedObjectMaxTris() << LL_ENDL; return false; } -#endif return true; } @@ -3685,7 +3697,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const S32 size = gMeshRepo.getMeshSize(volume_params.getSculptID(), getLOD()); if ( size > 0) { - if (gMeshRepo.getSkinInfo(volume_params.getSculptID(), this)) + if (isRiggedMesh()) { // weighted attachment - 1 point for every 3 bytes weighted_mesh = 1; @@ -4393,9 +4405,7 @@ void LLVOVolume::updateRiggedVolume(bool force_update) } LLVolume* volume = getVolume(); - - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(volume->getParams().getSculptID(), this); - + const LLMeshSkinInfo* skin = getSkinInfo(); if (!skin) { clearRiggedVolume(); @@ -4403,7 +4413,6 @@ void LLVOVolume::updateRiggedVolume(bool force_update) } LLVOAvatar* avatar = getAvatar(); - if (!avatar) { clearRiggedVolume(); @@ -4418,7 +4427,6 @@ void LLVOVolume::updateRiggedVolume(bool force_update) } mRiggedVolume->update(skin, avatar, volume); - } static LLTrace::BlockTimerStatHandle FTM_SKIN_RIGGED("Skin"); @@ -5081,9 +5089,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); - bool rigged = vobj->isMesh() && - vobj->isAttachment() && - gMeshRepo.getSkinInfo(vobj->getVolume()->getParams().getSculptID(), vobj); + // AXON this includes attached animeshes but leaves out standalone ones. Fix. + bool rigged = vobj->isRiggedMesh() && vobj->isAttachment(); if (vobj->isAnimatedObject()) { diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index e664191185..0a11074a66 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -262,6 +262,7 @@ public: virtual BOOL isFlexible() const; virtual BOOL isSculpted() const; virtual BOOL isMesh() const; + virtual BOOL isRiggedMesh() const; virtual BOOL hasLightTexture() const; @@ -269,6 +270,8 @@ public: BOOL canBeFlexible() const; BOOL setIsFlexible(BOOL is_flexible); + const LLMeshSkinInfo* getSkinInfo() const; + // Extended Mesh Properties U32 getExtendedMeshFlags() const; void onSetExtendedMeshFlags(U32 flags); |