diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-25 13:46:30 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-10-25 13:46:30 +0100 |
commit | 67710e51001e55aaa9aed0dc40d1db4192ed958d (patch) | |
tree | c0c198b6ec355264e1681b301fbbcb8ea3975279 /indra | |
parent | 299592e88e90d0942ba29e1edfa8b72691489e00 (diff) |
SL-779 - partial support for animesh objects with non-mesh roots
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llvovolume.cpp | 56 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 2 |
2 files changed, 26 insertions, 32 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 311945d3ee..508d99ca1f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1433,7 +1433,7 @@ BOOL LLVOVolume::setParent(LLViewerObject* parent) gPipeline.markMoved(mDrawable); gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); } - updateAnimatedObjectState(old_parent, parent); + updateAnimatedObjectStateOnReparent(old_parent, parent); } return ret ; @@ -3382,29 +3382,18 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags) bool LLVOVolume::canBeAnimatedObject() const { - if (!isMesh()) - { - return false; - } - if (!getVolume()) - { - return false; - } - if (!isRootEdit()) - { - return false; - } - const LLMeshSkinInfo* skin = gMeshRepo.getSkinInfo(getVolume()->getParams().getSculptID(), this); - if (!skin) - { - return false; - } +#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 > getAnimatedObjectMaxTris()) + if (est_tris <= 0 || est_tris > getAnimatedObjectMaxTris()) { - LL_INFOS() << "est_tris " << est_tris << " exceeds limit " << getAnimatedObjectMaxTris() << LL_ENDL; + LL_INFOS() << "est_tris " << est_tris << " is outside limit of 1-" << getAnimatedObjectMaxTris() << LL_ENDL; return false; } +#endif return true; } @@ -3466,7 +3455,7 @@ bool LLVOVolume::isAnimatedObjectStateConsistent() const // Called any time parenting changes for a volume. Update flags and // control av accordingly. This is called after parent has been // changed to new_parent. -void LLVOVolume::updateAnimatedObjectState(LLViewerObject *old_parent, LLViewerObject *new_parent) +void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, LLViewerObject *new_parent) { LLVOVolume *old_volp = dynamic_cast<LLVOVolume*>(old_parent); LLVOVolume *new_volp = dynamic_cast<LLVOVolume*>(new_parent); @@ -3880,7 +3869,7 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const F32 LLVOVolume::getEstTrianglesMax() const { - if (isMesh()) + if (isMesh() && getVolume()) { return gMeshRepo.getEstTrianglesMax(getVolume()->getParams().getSculptID()); } @@ -5038,7 +5027,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_FACE_LIST); //get all the faces into a list - for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter) + for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); + drawable_iter != group->getDataEnd(); ++drawable_iter) { LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable(); @@ -5054,13 +5044,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) LLVOVolume* vobj = drawablep->getVOVolume(); - std::string vobj_name = llformat("Vol%u", (U32) vobj); - if (!vobj) { continue; } + std::string vobj_name = llformat("Vol%u", (U32) vobj); + if (vobj->isMesh() && ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled())) { @@ -5074,13 +5064,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) group->mSurfaceArea += volume->getSurfaceArea() * llmax(llmax(scale.mV[0], scale.mV[1]), scale.mV[2]); } + bool is_mesh = vobj->isMesh(); + LL_DEBUGS("AXON") << vobj_name << " rebuilding, isAttachment: " << (U32) vobj->isAttachment() - << " is_animated " << vobj->isAnimatedObject() - << " can_animate " << vobj->canBeAnimatedObject() - << " cav " << vobj->getControlAvatar() - << " playing " << (U32) (vobj->getControlAvatar() ? vobj->getControlAvatar()->mPlaying : false) - << " frame " << LLFrameTimer::getFrameCount() - << LL_ENDL; + << " is_mesh " << is_mesh + << " is_animated " << vobj->isAnimatedObject() + << " can_animate " << vobj->canBeAnimatedObject() + << " cav " << vobj->getControlAvatar() + << " playing " << (U32) (vobj->getControlAvatar() ? vobj->getControlAvatar()->mPlaying : false) + << " frame " << LLFrameTimer::getFrameCount() + << LL_ENDL; llassert_always(vobj); vobj->updateTextureVirtualSize(true); @@ -5102,6 +5095,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (vobj->getControlAvatar()) { rigged_av = vobj->getControlAvatar(); + rigged_av->rebuildAttachmentOverrides(); } } else diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index ab940f6f62..e664191185 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -276,7 +276,7 @@ public: bool canBeAnimatedObject() const; bool isAnimatedObject() const; bool isAnimatedObjectStateConsistent() const; - void updateAnimatedObjectState(LLViewerObject *old_parent, LLViewerObject *new_parent); + void updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, LLViewerObject *new_parent); // AXON For animated objects, we need to track animations requested // per-object, then reconcile those to manage the control avatar |