From c9baf4c66157c601cc4d4e325c7843b3bf9a0cad Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 7 Jun 2017 14:23:49 +0100 Subject: SL-691,SL-694 - viewer can animate objects based on server messaging. First end-to-end demo for animated objects. --- indra/newview/lldrawpoolavatar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b221221f16..fa4fd7c533 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -467,7 +467,8 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) } LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); - if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) +// AXON fix + if (avatarp->isDead() || /*avatarp->mIsDummy ||*/ avatarp->mDrawable.isNull()) { return; } -- cgit v1.3 From c5dc0ee36e8d17fd0cf25f5a1fbdfb8609a64ee0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 9 Jun 2017 21:13:54 +0100 Subject: SL-704 - code cleanup --- indra/newview/llcontrolavatar.cpp | 5 +--- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llpanelvolume.cpp | 4 +-- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llvoavatar.cpp | 54 ++++++++++++++++++++------------------ indra/newview/llvograss.cpp | 2 +- indra/newview/llvovolume.cpp | 10 +++---- indra/newview/llvovolume.h | 4 +-- 8 files changed, 42 insertions(+), 41 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 1ecd3305ed..a8caba08af 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -92,14 +92,11 @@ void LLControlAvatar::updateGeom(LLVOVolume *obj) LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj) { - // TRIF Lifted from LLPreviewAnimation + // AXON Lifted from LLPreviewAnimation LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR); cav->createDrawable(&gPipeline); cav->mIsDummy = TRUE; cav->mSpecialRenderMode = 1; - //cav->setPositionAgent(obj->getRenderPosition()); - //cav->slamPosition(); - //cav->setRotation(obj->getRotation()); cav->updateJointLODs(); cav->updateGeometry(cav->mDrawable); cav->startMotion(ANIM_AGENT_STAND, 5.0f); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index fa4fd7c533..869e37e08c 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -468,7 +468,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); // AXON fix - if (avatarp->isDead() || /*avatarp->mIsDummy ||*/ avatarp->mDrawable.isNull()) + if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) { return; } diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 58cbede57b..f34194db19 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -355,8 +355,8 @@ void LLPanelVolume::getState( ) // AXON FIXME CHECK FOR SKIN INFO ALSO // WHAT ABOUT isPermanentEnforced? // What about linksets with some skinned objects? - BOOL can_be_animated_mesh = volobjp && volobjp->canBeAnimatedMesh() && editable; - getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(can_be_animated_mesh); + BOOL can_be_animated_object = volobjp && volobjp->canBeAnimatedObject() && editable; + getChildView("Animated Mesh Checkbox Ctrl")->setEnabled(can_be_animated_object); // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7fd87f99d3..db237d30ea 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5091,7 +5091,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) return; } - if (!volp->isAnimatedMesh()) + if (!volp->isAnimatedObject()) { LL_WARNS("Messaging") << "AXON Received animation state for non-animated object" << uuid << LL_ENDL; return; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7ba264f35a..1c9f79b200 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1944,7 +1944,9 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) //----------------------------------------------------------------------------- void LLVOAvatar::releaseMeshData() { - if (sInstances.size() < AVATAR_RELEASE_THRESHOLD)// || mIsDummy) + // AXON what should we be doing here for control avs? Why are + // dummies treated differently in the first place? + if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || mIsDummy) { return; } @@ -2740,7 +2742,7 @@ void LLVOAvatar::idleUpdateLoadingEffect() LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK | LLPartData::LL_PART_TARGET_POS_MASK ); - // TRIF skip cloud effects for dummy avs as well + // AXON skip cloud effects for dummy avs as well if (!mIsDummy && !isTooComplex()) // do not generate particles for overly-complex avatars { setParticleSource(particle_parameters, getID()); @@ -3533,7 +3535,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } // change animation time quanta based on avatar render load - if (!isSelf())// && !mIsDummy) + // AXON how should control avs be handled here? + bool is_pure_dummy = mIsDummy && !isControlAvatar(); + if (!isSelf() && !is_pure_dummy) { F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f); F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); @@ -3655,8 +3659,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) //-------------------------------------------------------------------- // Propagate viewer object rotation to root of avatar //-------------------------------------------------------------------- - // FIXME TRIF - just skipping this for now for all dummy avs - if (!mIsDummy && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS)) + // AXON - also skip for control avatars + if (!isControlAvatar() && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS)) { LLQuaternion iQ; LLVector3 upDir( 0.0f, 0.0f, 1.0f ); @@ -4356,11 +4360,12 @@ U32 LLVOAvatar::renderSkinned() } BOOL first_pass = TRUE; + bool is_pure_dummy = mIsDummy && !isControlAvatar(); if (!LLDrawPoolAvatar::sSkipOpaque) { if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED))// || mIsDummy) + if (isTextureVisible(TEX_HEAD_BAKED) || is_pure_dummy) { LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD); if (head_mesh) @@ -4370,7 +4375,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED))// || mIsDummy) + if (isTextureVisible(TEX_UPPER_BAKED) || is_pure_dummy) { LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY); if (upper_mesh) @@ -4380,7 +4385,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED))// || mIsDummy) + if (isTextureVisible(TEX_LOWER_BAKED) || is_pure_dummy) { LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY); if (lower_mesh) @@ -4437,20 +4442,14 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } first_pass = FALSE; } - // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) - // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if (!mIsDummy) + if (isTextureVisible(TEX_HAIR_BAKED)) { - if ( (getImage(TEX_HAIR_BAKED, 0) && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) - || LLDrawPoolAlpha::sShowDebugAlpha) - { - LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); - if (hair_mesh) - { - num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); - } - first_pass = FALSE; - } + LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); + if (hair_mesh) + { + num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); + } + first_pass = FALSE; } if (LLPipeline::sImpostorRender) { @@ -4491,7 +4490,9 @@ U32 LLVOAvatar::renderRigid() gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } - if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) + bool is_pure_dummy = mIsDummy && !isControlAvatar(); + + if (isTextureVisible(TEX_EYES_BAKED) || is_pure_dummy) { LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT); LLViewerJoint* eyeball_right = getViewerJoint(MESH_ID_EYEBALL_RIGHT); @@ -5529,7 +5530,7 @@ void LLVOAvatar::rebuildAttachmentOverrides() void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { bool non_attached_case = false; - // FIXME TRIF - will this work if vo has child objects? + // FIXME AXON - will this work if vo has child objects? if (vo->mControlAvatar) { non_attached_case = true; @@ -5759,7 +5760,7 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const //----------------------------------------------------------------------------- // resetJointsOnDetach //----------------------------------------------------------------------------- -// TRIF handle NPC case +// AXON handle NPC case void LLVOAvatar::resetJointsOnDetach(LLViewerObject *vo) { LLVOAvatar *av = vo->getAvatarAncestor(); @@ -5788,7 +5789,7 @@ void LLVOAvatar::resetJointsOnDetach(LLViewerObject *vo) //----------------------------------------------------------------------------- // resetJointsOnDetach //----------------------------------------------------------------------------- -// TRIF handle NPC case +// AXON handle NPC case void LLVOAvatar::resetJointsOnDetach(const LLUUID& mesh_id) { //Subsequent joints are relative to pelvis @@ -5867,6 +5868,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age LLVector3d z_vec(0.0f, 0.0f, 1.0f); LLVector3d p0_global, p1_global; + // AXON update for control avs? if (mIsDummy) { outNorm.setVec(z_vec); @@ -5896,6 +5898,7 @@ F32 LLVOAvatar::getTimeDilation() //----------------------------------------------------------------------------- F32 LLVOAvatar::getPixelArea() const { + // AXON update for control avatars if (mIsDummy) { return 100000.f; @@ -6827,6 +6830,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) BOOL LLVOAvatar::isVisible() const { + // AXON should we flag control avs as invisible? return mDrawable.notNull() && (!mOrphaned || isSelf()) && (mDrawable->isVisible() || mIsDummy); diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index e7e4e6f228..337f969f3d 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -92,7 +92,7 @@ LLVOGrass::~LLVOGrass() void LLVOGrass::updateSpecies() { - // TRIF is grass still even supported? This use of state seems odd. + // AXON is grass still even supported? This use of state seems odd. mSpecies = getAttachmentState(); if (!sSpeciesTable.count(mSpecies)) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a2f417a5cc..59e1895bc6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3308,7 +3308,7 @@ void LLVOVolume::setExtendedMeshFlags(U32 flags) } } -bool LLVOVolume::canBeAnimatedMesh() const +bool LLVOVolume::canBeAnimatedObject() const { if (!isMesh()) { @@ -3322,9 +3322,9 @@ bool LLVOVolume::canBeAnimatedMesh() const return true; } -bool LLVOVolume::isAnimatedMesh() const +bool LLVOVolume::isAnimatedObject() const { - return canBeAnimatedMesh() && (getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG); + return canBeAnimatedObject() && (getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG); } //---------------------------------------------------------------------------- @@ -4850,11 +4850,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic(); - // TRIF why this variable? Only different from rigged if + // AXON why this variable? Only different from rigged if // there are no LLFaces associated with the drawable. bool is_rigged = false; - // TRIF handle NPC case + // AXON handle NPC case if (rigged && pAvatarVO) { pAvatarVO->addAttachmentOverridesForObject(vobj); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 5918166aff..75dabd961a 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -269,8 +269,8 @@ public: // Extended Mesh Properties U32 getExtendedMeshFlags() const; void setExtendedMeshFlags(U32 flags); - bool canBeAnimatedMesh() const; - bool isAnimatedMesh() const; + bool canBeAnimatedObject() const; + bool isAnimatedObject() const; // Functions that deal with media, or media navigation -- cgit v1.3 From 96bc66a55778d25fa36ca42092f0ce3ca57bb3ce Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 25 Oct 2017 20:16:39 +0100 Subject: SL-779 - refactoring related to rigged-mesh determination. animated objects must contain some triangles even if not at the root --- indra/newview/lldrawpoolavatar.cpp | 16 ++-------------- indra/newview/llviewerobject.h | 1 + indra/newview/llvoavatar.cpp | 16 +++++++--------- indra/newview/llvovolume.cpp | 37 ++++++++++++++++++++++--------------- indra/newview/llvovolume.h | 3 +++ 5 files changed, 35 insertions(+), 38 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') 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); -- cgit v1.3 From c025939e42d4c26054ff4a6eeded4b7849c74070 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 27 Oct 2017 15:10:26 +0100 Subject: MAINT-7857 - shadow fix for animated objects. --- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llviewermessage.cpp | 33 +++++++++++++++++++++++++++++++++ indra/newview/llvovolume.cpp | 10 +++++++--- 3 files changed, 41 insertions(+), 4 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b39b2cd6e5..30560eeb7b 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -468,7 +468,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); // AXON fix - if (avatarp->isDead() || avatarp->mIsDummy || avatarp->mDrawable.isNull()) + if (avatarp->isDead() || (avatarp->mIsDummy && !avatarp->isControlAvatar()) || avatarp->mDrawable.isNull()) { return; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 70202e4bc6..fad59aadf4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5075,6 +5075,18 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) } } +// AXON Move to llviewerobject +void recursiveMarkForUpdate(LLViewerObject *vobj, BOOL priority) +{ + for (LLViewerObject::child_list_t::const_iterator iter = vobj->getChildren().begin(); + iter != vobj->getChildren().end(); iter++) + { + LLViewerObject* child = (LLViewerObject*)*iter; + child->markForUpdate(priority); + } + vobj->markForUpdate(priority); +} + void process_object_animation(LLMessageSystem *mesgsys, void **user_data) { LLUUID animation_id; @@ -5113,11 +5125,32 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_AnimationList); LL_DEBUGS("AXON") << "handle object animation here, num_blocks " << num_blocks << LL_ENDL; +#if 1 if (!avatarp->mPlaying) { avatarp->mPlaying = true; avatarp->updateVolumeGeom(); + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); } +#else + if (num_blocks > 0 && !avatarp->mPlaying) + { + avatarp->mPlaying = true; + avatarp->updateVolumeGeom(); + // AXON FIXME need to update all objects in the linkset, not just the one where animation is playing + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); + } + else if (num_blocks == 0 && avatarp->mPlaying) + { + // AXON this will cause meshes to go back to static when no + // animations are signalled. Probably don't want to leave this + // way but helpful for testing. + avatarp->mPlaying = false; + avatarp->updateVolumeGeom(); + // AXON FIXME need to update all objects in the linkset, not just the one where animation is playing + recursiveMarkForUpdate(avatarp->mRootVolp,TRUE); + } +#endif volp->mObjectSignaledAnimations.clear(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c9bf609940..d4a601d394 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5089,8 +5089,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) drawablep->clearState(LLDrawable::HAS_ALPHA); - // AXON this includes attached animeshes but leaves out standalone ones. Fix. - bool rigged = vobj->isRiggedMesh() && vobj->isAttachment(); + // Standard rigged mesh attachments: + bool rigged = !vobj->isAnimatedObject() && vobj->isRiggedMesh() && vobj->isAttachment(); + // Animated objects. Have to check for isRiggedMesh() to + // exclude static objects in animated object linksets. + rigged = rigged || (vobj->isAnimatedObject() && vobj->isRiggedMesh() && + vobj->getControlAvatar() && vobj->getControlAvatar()->mPlaying); if (vobj->isAnimatedObject()) { @@ -5149,7 +5153,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) //sum up face verts and indices drawablep->updateFaceSize(i); - if (rigged || (vobj->getControlAvatar() && vobj->getControlAvatar()->mPlaying && vobj->isMesh())) + if (rigged) { if (!facep->isState(LLFace::RIGGED)) { //completely reset vertex buffer -- cgit v1.3 From 2f1b75f03e8066b54d9dae16ab29095752c4ee8a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 16 Nov 2017 19:24:53 +0000 Subject: SL-704 - first pass cleaning up comments. Also added LLControlAvatar::initInstance() as a potential hook for optimizations. --- indra/newview/llcontrolavatar.cpp | 8 +++++++- indra/newview/llcontrolavatar.h | 1 + indra/newview/lldrawpoolavatar.cpp | 1 - indra/newview/llpanelobject.cpp | 3 ++- indra/newview/llpanelvolume.cpp | 3 --- indra/newview/llselectmgr.cpp | 6 +++--- indra/newview/llviewermessage.cpp | 13 +++++++------ indra/newview/llviewerobject.cpp | 2 +- indra/newview/llvoavatar.cpp | 22 +++++++++++----------- indra/newview/llvograss.cpp | 1 - indra/newview/llvovolume.cpp | 17 ++++------------- indra/newview/llvovolume.h | 3 --- indra/newview/pipeline.cpp | 1 - 13 files changed, 36 insertions(+), 45 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 848a8b0d40..afa6be188d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -49,6 +49,13 @@ LLControlAvatar::~LLControlAvatar() { } +// virtual +void LLControlAvatar::initInstance() +{ + // AXON - potential optimizations here - avoid creating system avatar mesh since it's not used. + LLVOAvatar::initInstance(); +} + void LLControlAvatar::matchVolumeTransform() { if (mRootVolp) @@ -173,7 +180,6 @@ void LLControlAvatar::updateVolumeGeom() LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj) { - // AXON Lifted from LLPreviewAnimation LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR); cav->mRootVolp = obj; diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index 308d431615..a0f7912d24 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -37,6 +37,7 @@ class LLControlAvatar: public: LLControlAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); + virtual void initInstance(); // Called after construction to initialize the class. virtual ~LLControlAvatar(); void matchVolumeTransform(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 30560eeb7b..206d4f4c7a 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -467,7 +467,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) } LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); -// AXON fix if (avatarp->isDead() || (avatarp->mIsDummy && !avatarp->isControlAvatar()) || avatarp->mDrawable.isNull()) { return; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 43d6245a63..8f2cf5bb89 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -343,7 +343,8 @@ void LLPanelObject::getState( ) // can move or rotate only linked group with move permissions, or sub-object with move and modify perms - // AXON it's not entirely clear what the motivation is to have 3 + // AXON REVIEW BEFORE RELEASE, behavior during edit is glitchy. + // it's not entirely clear what the motivation is to have 3 // different rules for enablement. At least the difference between // move and rotate looks like just a parens error, have updated accordingly. BOOL enable_move = objectp->permMove() && !objectp->isPermanentEnforced() && ((root_objectp == NULL) || !root_objectp->isPermanentEnforced()) && ((objectp->permModify() && !objectp->isAttachment()) || !gSavedSettings.getBOOL("EditLinkedParts")); diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 6a71da3918..5c4c430f83 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -361,9 +361,6 @@ void LLPanelVolume::getState( ) // Animated Mesh BOOL is_animated_mesh = single_root_volume && root_volobjp && root_volobjp->isAnimatedObject(); getChild("Animated Mesh Checkbox Ctrl")->setValue(is_animated_mesh); - // AXON FIXME CHECK FOR SKIN INFO ALSO - // WHAT ABOUT isPermanentEnforced? - // What about linksets with some skinned objects? BOOL enabled_animated_object_box = FALSE; if (root_volobjp && root_volobjp == volobjp) { diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f666f447cb..473d7e5b5f 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -664,9 +664,9 @@ void LLSelectMgr::confirmUnlinkObjects(const LLSD& notification, const LLSD& res // the selection and give an error message when the uer has a // reasonable expectation for the link to work, but it will fail. // -// AXON - additional check that if the selection includes at least one -// animated object, the total mesh triangle count cannot exceed the -// designated limit. +// For animated objects, there's additional check that if the +// selection includes at least one animated object, the total mesh +// triangle count cannot exceed the designated limit. bool LLSelectMgr::enableLinkObjects() { bool new_value = false; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0b2931886a..7260d7f928 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5106,7 +5106,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) LLControlAvatar *avatarp = volp->getControlAvatar(); if (!avatarp) { - LL_WARNS() << "AXON no control avatar, ignoring" << LL_ENDL; + LL_WARNS("Messaging") << "AXON no control avatar, ignoring" << LL_ENDL; return; } @@ -5120,17 +5120,19 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) if (!avatarp->mPlaying) { avatarp->mPlaying = true; - avatarp->updateVolumeGeom(); - avatarp->mRootVolp->recursiveMarkForUpdate(TRUE); + if (!avatarp->mRootVolp->isAnySelected()) + { + avatarp->updateVolumeGeom(); + avatarp->mRootVolp->recursiveMarkForUpdate(TRUE); + } } #else - // AXON + // AXON REMOVE BEFORE RELEASE? // In this block we switch back into static mode when no animations are // playing. This is mostly useful for debugging. if (num_blocks > 0 && !avatarp->mPlaying) { avatarp->mPlaying = true; - // AXON need to update all objects in the linkset, not just the one where animation is playing if (!avatarp->mRootVolp->isAnySelected()) { avatarp->updateVolumeGeom(); @@ -5140,7 +5142,6 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) else if (num_blocks == 0 && avatarp->mPlaying) { avatarp->mPlaying = false; - // AXON need to update all objects in the linkset, not just the one where animation is playing if (!avatarp->mRootVolp->isAnySelected()) { avatarp->updateVolumeGeom(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3435217fa4..7d370aff35 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3609,7 +3609,7 @@ F32 LLViewerObject::recursiveGetEstTrianglesMax() const S32 LLViewerObject::getAnimatedObjectMaxTris() const { S32 max_tris = 0; - // AXON remove after server testing done + // AXON REMOVE AFTER SERVER TESTING DONE if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) { max_tris = S32_MAX; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cdbe87de75..ea7214d937 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1108,7 +1108,7 @@ void LLVOAvatar::cleanupClass() } // virtual -void LLVOAvatar::initInstance(void) +void LLVOAvatar::initInstance() { //------------------------------------------------------------------------- // register motions @@ -3470,7 +3470,7 @@ void LLVOAvatar::updateDebugText() LLVOVolume *volp = control_av->mRootVolp; if (volp) { - volp->requestInventory(); // AXON should be a no-op if already requested or fetched? + volp->requestInventory(); LLViewerInventoryItem* item = volp->getInventoryItemByAsset(motionp->getID()); if (item) { @@ -3658,10 +3658,9 @@ void LLVOAvatar::updateFootstepSounds() void LLVOAvatar::computeUpdatePeriod() { bool visually_muted = isVisuallyMuted(); - // AXON FIXME this expression is a crawling horror if (mDrawable.notNull() && isVisible() - && (!isSelf() || visually_muted) // AXON would the self ever be visually muted? + && (!isSelf() || visually_muted) && !mIsDummy && sUseImpostors && !mNeedsAnimUpdate @@ -3881,7 +3880,8 @@ void LLVOAvatar::updateTimeStep() bool is_pure_dummy = mIsDummy && !isControlAvatar(); if (!isSelf() && !is_pure_dummy) // ie, non-self avatars, and animated objects will be affected. { - // AXON note that sInstances counts animated objects and standard avatars in the same bucket. Is this desirable? + // AXON note that sInstances counts animated objects and + // standard avatars in the same bucket. Is this desirable? F32 time_quantum = clamp_rescale((F32)sInstances.size(), 10.f, 35.f, 0.f, 0.25f); F32 pixel_area_scale = clamp_rescale(mPixelArea, 100, 5000, 1.f, 0.f); F32 time_step = time_quantum * pixel_area_scale; @@ -3999,7 +3999,9 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w //-------------------------------------------------------------------- if (!isControlAvatar() && !isAnyAnimationSignaled(AGENT_NO_ROTATE_ANIMS, NUM_AGENT_NO_ROTATE_ANIMS)) { - // AXON - should we always skip for control avatars? Rotation fixups for avatars in motion, some may be relevant. + // AXON - should we always skip for control avatars? + // Rotation fixups for avatars in motion, some may be + // relevant. updateOrientation(agent, speed, delta_time); } } @@ -5999,7 +6001,6 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const //----------------------------------------------------------------------------- // removeAttachmentOverridesForObject //----------------------------------------------------------------------------- -// AXON handle NPC case void LLVOAvatar::removeAttachmentOverridesForObject(LLViewerObject *vo) { if (vo->getAvatar() != this && vo->getAvatarAncestor() != this) @@ -6028,7 +6029,6 @@ void LLVOAvatar::removeAttachmentOverridesForObject(LLViewerObject *vo) //----------------------------------------------------------------------------- // removeAttachmentOverridesForObject //----------------------------------------------------------------------------- -// AXON handle NPC case void LLVOAvatar::removeAttachmentOverridesForObject(const LLUUID& mesh_id) { //Subsequent joints are relative to pelvis @@ -6107,7 +6107,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age LLVector3d z_vec(0.0f, 0.0f, 1.0f); LLVector3d p0_global, p1_global; - // AXON update for control avs? + // AXON UPDATE FOR CONTROL AVS? if (mIsDummy) { outNorm.setVec(z_vec); @@ -6137,7 +6137,7 @@ F32 LLVOAvatar::getTimeDilation() //----------------------------------------------------------------------------- F32 LLVOAvatar::getPixelArea() const { - // AXON update for control avatars + // AXON UPDATE FOR CONTROL AVATARS if (mIsDummy) { return 100000.f; @@ -6675,7 +6675,7 @@ U32 LLVOAvatar::getNumAnimatedObjectAttachments() const S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const { S32 max_attach = 0; - // AXON remove after server testing done + // AXON REMOVE AFTER SERVER TESTING DONE if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits")) { max_attach = MAX_AGENT_ATTACHMENTS; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 337f969f3d..5def0f0c0f 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -92,7 +92,6 @@ LLVOGrass::~LLVOGrass() void LLVOGrass::updateSpecies() { - // AXON is grass still even supported? This use of state seems odd. mSpecies = getAttachmentState(); if (!sSpeciesTable.count(mSpecies)) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 54029f75fd..96f2255265 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -91,7 +91,6 @@ U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG = 1; BOOL gAnimateTextures = TRUE; //extern BOOL gHideSelectedObjects; -// AXON TEMP S32 LLVOVolume::sForceLOD = -1; F32 LLVOVolume::sLODFactor = 1.f; F32 LLVOVolume::sLODSlopDistanceFactor = 0.5f; //Changing this to zero, effectively disables the LOD transition slop @@ -1234,7 +1233,7 @@ void LLVOVolume::sculpt() S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius) { S32 cur_detail; - // AXON TEMP + // AXON TEMP REMOVE if (LLVOVolume::sForceLOD>=0 && LLVOVolume::sForceLOD<=3) { cur_detail = LLVOVolume::sForceLOD; @@ -3341,8 +3340,6 @@ BOOL LLVOVolume::isRiggedMesh() const } //---------------------------------------------------------------------------- -// AXON - methods related to extended mesh flags - U32 LLVOVolume::getExtendedMeshFlags() const { const LLExtendedMeshParams *param_block = @@ -3412,7 +3409,6 @@ bool LLVOVolume::canBeAnimatedObject() const F32 est_tris = recursiveGetEstTrianglesMax(); if (est_tris < 0 || est_tris > getAnimatedObjectMaxTris()) { - LL_DEBUGS("AXON") << "est_tris " << est_tris << " is outside limit of 0-" << getAnimatedObjectMaxTris() << LL_ENDL; return false; } return true; @@ -3441,6 +3437,8 @@ bool LLVOVolume::isAnimatedObject() const // Only the root of a linkset can have the animated object flag set // Only the root of a linkset can have a control avatar (iff the animated object flag is set) // Only skinned mesh volumes can have the animated object flag set, or a control avatar +// +// AXON REVIEW BASED ON FINAL RULES bool LLVOVolume::isAnimatedObjectStateConsistent() const { if (!canBeAnimatedObject()) @@ -3486,16 +3484,9 @@ void LLVOVolume::updateAnimatedObjectStateOnReparent(LLViewerObject *old_parent, // AXON - depending on whether animated objects can be attached, // we may want to include or remove the isAvatar() check. + // BUG?? if (new_parent && !new_parent->isAvatar()) { -#if 0 // AXON - MAINT-7819 - // Object should inherit control avatar and animated mesh flag - // from parent, so clear them out from our own state - if (getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG) - { - setExtendedMeshFlags(getExtendedMeshFlags() & ~LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG); - } -#endif if (mControlAvatar.notNull()) { LLControlAvatar *av = mControlAvatar; diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index f12eb168f6..afeb1c852b 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -281,9 +281,6 @@ public: bool isAnimatedObjectStateConsistent() const; 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 - // animation state. std::map mObjectSignaledAnimations; // requested state of Animation name/value // Functions that deal with media, or media navigation diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 436c0cbf43..bab81f4294 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3352,7 +3352,6 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f { #if 1 // AXON debugging - LLVOVolume *vol_obj = drawablep->getVOVolume(); if (vol_obj && vol_obj->isAnimatedObject() && vol_obj->isRiggedMesh()) { -- cgit v1.3 From 4b439ff968a934c127cd685b54bcc206e467a948 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 4 Dec 2017 11:15:47 +0000 Subject: SL-704 - made avatar hierarchy more consistent by adding lluiavatar for viewer-local avs used in upload previews --- indra/llappearance/llavatarappearance.h | 2 +- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llcontrolavatar.cpp | 16 +++++---- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llfloaterbvhpreview.cpp | 8 +---- indra/newview/llfloaterimagepreview.cpp | 9 +---- indra/newview/llfloatermodelpreview.cpp | 7 +--- indra/newview/lluiavatar.cpp | 59 +++++++++++++++++++++++++++++++++ indra/newview/lluiavatar.h | 44 ++++++++++++++++++++++++ indra/newview/llviewerobject.cpp | 13 ++++++-- indra/newview/llviewerobject.h | 7 ++-- indra/newview/llvoavatar.cpp | 34 ++++++++----------- indra/newview/llvoavatar.h | 2 ++ indra/newview/llvovolume.cpp | 12 ------- 14 files changed, 149 insertions(+), 68 deletions(-) create mode 100644 indra/newview/lluiavatar.cpp create mode 100644 indra/newview/lluiavatar.h (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index ccd6323ed8..b6bdb652e8 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -227,7 +227,7 @@ protected: ** RENDERING **/ public: - BOOL mIsDummy; // for special views + BOOL mIsDummy; // for special views and animated object controllers; local to viewer //-------------------------------------------------------------------- // Morph masks diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3787a25a9b..131cb1a377 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -601,6 +601,7 @@ set(viewer_SOURCE_FILES lltransientfloatermgr.cpp lltranslate.cpp lltwitterconnect.cpp + lluiavatar.cpp lluilistener.cpp lluploaddialog.cpp llurl.cpp @@ -1216,6 +1217,7 @@ set(viewer_HEADER_FILES lltranslate.h lltwitterconnect.h lluiconstants.h + lluiavatar.h lluilistener.h lluploaddialog.h lluploadfloaterobservers.h diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 920b0fa151..39a8fd469d 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -40,6 +40,7 @@ LLControlAvatar::LLControlAvatar(const LLUUID& id, const LLPCode pcode, LLViewer mGlobalScale(1.0f), mMarkedForDeath(false) { + mIsDummy = TRUE; mIsControlAvatar = true; mEnableDefaultMotions = false; } @@ -56,6 +57,14 @@ void LLControlAvatar::initInstance() // avatar mesh content since it's not used. For now we just clean some // things up after the fact in releaseMeshData(). LLVOAvatar::initInstance(); + + // AXON mSpecialRenderMode here is probably wrong, need to review. + mSpecialRenderMode = 1; + + createDrawable(&gPipeline); + updateJointLODs(); + updateGeometry(mDrawable); + hideSkirt(); } void LLControlAvatar::matchVolumeTransform() @@ -185,13 +194,6 @@ LLControlAvatar *LLControlAvatar::createControlAvatar(LLVOVolume *obj) LLControlAvatar *cav = (LLControlAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), CO_FLAG_CONTROL_AVATAR); cav->mRootVolp = obj; - - cav->createDrawable(&gPipeline); - cav->mIsDummy = TRUE; - cav->mSpecialRenderMode = 1; - cav->updateJointLODs(); - cav->updateGeometry(cav->mDrawable); - cav->hideSkirt(); // Sync up position/rotation with object cav->matchVolumeTransform(); diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 0d8e302123..fe830419e0 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -467,7 +467,7 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) } LLVOAvatar *avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); - if (avatarp->isDead() || (avatarp->mIsDummy && !avatarp->isControlAvatar()) || avatarp->mDrawable.isNull()) + if (avatarp->isDead() || avatarp->isUIAvatar() || avatarp->mDrawable.isNull()) { return; } diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 5f606ec326..88c0d58081 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -1042,14 +1042,8 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLViewerDynamicT mCameraPitch = 0.f; mCameraZoom = 1.f; - mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion()); - mDummyAvatar->createDrawable(&gPipeline); - mDummyAvatar->mIsDummy = TRUE; + mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR); mDummyAvatar->mSpecialRenderMode = 1; - mDummyAvatar->setPositionAgent(LLVector3::zero); - mDummyAvatar->slamPosition(); - mDummyAvatar->updateJointLODs(); - mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); mDummyAvatar->startMotion(ANIM_AGENT_STAND, BASE_ANIM_TIME_OFFSET); mDummyAvatar->hideSkirt(); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index a9e4d752ac..fbe78475df 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -566,15 +566,8 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLViewerDyna mCameraPitch = 0.f; mCameraZoom = 1.f; - mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion()); - mDummyAvatar->createDrawable(&gPipeline); - mDummyAvatar->mIsDummy = TRUE; + mDummyAvatar = (LLVOAvatar*)gObjectList.createObjectViewer(LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR); mDummyAvatar->mSpecialRenderMode = 2; - mDummyAvatar->setPositionAgent(LLVector3::zero); - mDummyAvatar->slamPosition(); - mDummyAvatar->updateJointLODs(); - mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); - // gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); mTextureName = 0; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 3989adf8d4..168fb13d11 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -3451,16 +3451,11 @@ void LLModelPreview::update() //----------------------------------------------------------------------------- void LLModelPreview::createPreviewAvatar( void ) { - mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion() ); + mPreviewAvatar = (LLVOAvatar*)gObjectList.createObjectViewer( LL_PCODE_LEGACY_AVATAR, gAgent.getRegion(), LLViewerObject::CO_FLAG_UI_AVATAR ); if ( mPreviewAvatar ) { mPreviewAvatar->createDrawable( &gPipeline ); - mPreviewAvatar->mIsDummy = TRUE; mPreviewAvatar->mSpecialRenderMode = 1; - mPreviewAvatar->setPositionAgent( LLVector3::zero ); - mPreviewAvatar->slamPosition(); - mPreviewAvatar->updateJointLODs(); - mPreviewAvatar->updateGeometry( mPreviewAvatar->mDrawable ); mPreviewAvatar->startMotion( ANIM_AGENT_STAND ); mPreviewAvatar->hideSkirt(); } diff --git a/indra/newview/lluiavatar.cpp b/indra/newview/lluiavatar.cpp new file mode 100644 index 0000000000..6cc14fc49b --- /dev/null +++ b/indra/newview/lluiavatar.cpp @@ -0,0 +1,59 @@ +/** + * @file lluiavatar.cpp + * @brief Implementation for special dummy avatar used in some UI views + * + * $LicenseInfo:firstyear=2017&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, 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 "lluiavatar.h" +#include "llagent.h" // Get state values from here +#include "llviewerobjectlist.h" +#include "pipeline.h" +#include "llanimationstates.h" +#include "llviewercontrol.h" +#include "llmeshrepository.h" +#include "llviewerregion.h" + +LLUIAvatar::LLUIAvatar(const LLUUID& id, const LLPCode pcode, LLViewerRegion* regionp) : + LLVOAvatar(id, pcode, regionp) +{ + mIsDummy = TRUE; + mIsUIAvatar = true; +} + +// virtual +LLUIAvatar::~LLUIAvatar() +{ +} + +// virtual +void LLUIAvatar::initInstance() +{ + LLVOAvatar::initInstance(); + + createDrawable( &gPipeline ); + setPositionAgent(LLVector3::zero); + slamPosition(); + updateJointLODs(); + updateGeometry(mDrawable); +} diff --git a/indra/newview/lluiavatar.h b/indra/newview/lluiavatar.h new file mode 100644 index 0000000000..bcdffedef2 --- /dev/null +++ b/indra/newview/lluiavatar.h @@ -0,0 +1,44 @@ +/** + * @file lluiavatar.h + * @brief Special dummy avatar used in some UI views + * + * $LicenseInfo:firstyear=2017&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2017, 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_UIAVATAR_H +#define LL_UIAVATAR_H + +#include "llvoavatar.h" +#include "llvovolume.h" + +class LLUIAvatar: + public LLVOAvatar +{ + LOG_CLASS(LLUIAvatar); + +public: + LLUIAvatar(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); + virtual void initInstance(); // Called after construction to initialize the class. + virtual ~LLUIAvatar(); +}; + +#endif //LL_CONTROLAVATAR_H diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2e4c995be4..915b4348b4 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -70,6 +70,7 @@ #include "llselectmgr.h" #include "llrendersphere.h" #include "lltooldraganddrop.h" +#include "lluiavatar.h" #include "llviewercamera.h" #include "llviewertexturelist.h" #include "llviewerinventory.h" @@ -169,10 +170,16 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco } else if (flags & CO_FLAG_CONTROL_AVATAR) { - LLControlAvatar *avatar = new LLControlAvatar(id, pcode, regionp); - avatar->initInstance(); - res = avatar; + LLControlAvatar *control_avatar = new LLControlAvatar(id, pcode, regionp); + control_avatar->initInstance(); + res = control_avatar; } + else if (flags & CO_FLAG_UI_AVATAR) + { + LLUIAvatar *ui_avatar = new LLUIAvatar(id, pcode, regionp); + ui_avatar->initInstance(); + res = ui_avatar; + } else { LLVOAvatar *avatar = new LLVOAvatar(id, pcode, regionp); diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 0bfc513dc9..4a2ccd4e3a 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -706,6 +706,10 @@ public: virtual bool isAnimatedObject() const; + // Flags for createObject + static const S32 CO_FLAG_CONTROL_AVATAR = 1 << 0; + static const S32 CO_FLAG_UI_AVATAR = 1 << 1; + protected: LLPointer mControlAvatar; @@ -719,9 +723,6 @@ protected: // updateInventory. void doUpdateInventory(LLPointer& item, U8 key, bool is_new); - // Flags for createObject - static const S32 CO_FLAG_CONTROL_AVATAR = 1 << 1; - static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp, S32 flags = 0); BOOL setData(const U8 *datap, const U32 data_size); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a91e9ff53d..a5a9fbe0e6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -670,6 +670,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mCachedMuteListUpdateTime(0), mCachedInMuteList(false), mIsControlAvatar(false), + mIsUIAvatar(false), mEnableDefaultMotions(true) { LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; @@ -1975,8 +1976,7 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) //----------------------------------------------------------------------------- void LLVOAvatar::releaseMeshData() { - if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || - (mIsDummy && !isControlAvatar())) + if (sInstances.size() < AVATAR_RELEASE_THRESHOLD || isUIAvatar()) { return; } @@ -3685,7 +3685,7 @@ void LLVOAvatar::computeUpdatePeriod() if (mDrawable.notNull() && isVisible() && (!isSelf() || visually_muted) - && (!mIsDummy || isControlAvatar()) + && !isUIAvatar() && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) @@ -3901,8 +3901,7 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) // ------------------------------------------------------------------------ void LLVOAvatar::updateTimeStep() { - bool is_pure_dummy = mIsDummy && !isControlAvatar(); - if (!isSelf() && !is_pure_dummy) // ie, non-self avatars, and animated objects will be affected. + if (!isSelf() && !isUIAvatar()) // ie, non-self avatars, and animated objects will be affected. { // Note that sInstances counts animated objects and // standard avatars in the same bucket. Is this desirable? @@ -4059,10 +4058,10 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w // LLControlAvatar and mIsDummy is true. Avatar is a purely // viewer-side entity with no representation on the simulator. // -// 4) Avatar is a "dummy" avatar used in some areas of the UI, such as -// when previewing uploaded animations. Class is LLVOAvatar, and -// mIsDummy is true. Avatar is purely viewer-side with no -// representation on the simulator. +// 4) Avatar is a UI avatar used in some areas of the UI, such as when +// previewing uploaded animations. Class is LLUIAvatar, and mIsDummy +// is true. Avatar is purely viewer-side with no representation on the +// simulator. // //------------------------------------------------------------------------ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) @@ -4115,7 +4114,6 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) //-------------------------------------------------------------------- // change animation time quanta based on avatar render load - // AXON how should control avs be handled here? //-------------------------------------------------------------------- // SL-763 the time step quantization does not currently work. //updateTimeStep(); @@ -4623,12 +4621,11 @@ U32 LLVOAvatar::renderSkinned() } BOOL first_pass = TRUE; - bool is_pure_dummy = mIsDummy && !isControlAvatar(); if (!LLDrawPoolAvatar::sSkipOpaque) { if (!isSelf() || gAgent.needsRenderHead() || LLPipeline::sShadowRender) { - if (isTextureVisible(TEX_HEAD_BAKED) || is_pure_dummy) + if (isTextureVisible(TEX_HEAD_BAKED) || isUIAvatar()) { LLViewerJoint* head_mesh = getViewerJoint(MESH_ID_HEAD); if (head_mesh) @@ -4638,7 +4635,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } } - if (isTextureVisible(TEX_UPPER_BAKED) || is_pure_dummy) + if (isTextureVisible(TEX_UPPER_BAKED) || isUIAvatar()) { LLViewerJoint* upper_mesh = getViewerJoint(MESH_ID_UPPER_BODY); if (upper_mesh) @@ -4648,7 +4645,7 @@ U32 LLVOAvatar::renderSkinned() first_pass = FALSE; } - if (isTextureVisible(TEX_LOWER_BAKED) || is_pure_dummy) + if (isTextureVisible(TEX_LOWER_BAKED) || isUIAvatar()) { LLViewerJoint* lower_mesh = getViewerJoint(MESH_ID_LOWER_BODY); if (lower_mesh) @@ -4677,7 +4674,7 @@ U32 LLVOAvatar::renderSkinned() U32 LLVOAvatar::renderTransparent(BOOL first_pass) { U32 num_indices = 0; - if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (mIsDummy || isTextureVisible(TEX_SKIRT_BAKED)) ) + if( isWearingWearableType( LLWearableType::WT_SKIRT ) && (isUIAvatar() || isTextureVisible(TEX_SKIRT_BAKED)) ) { gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.25f); LLViewerJoint* skirt_mesh = getViewerJoint(MESH_ID_SKIRT); @@ -4753,9 +4750,7 @@ U32 LLVOAvatar::renderRigid() gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); } - bool is_pure_dummy = mIsDummy && !isControlAvatar(); - - if (isTextureVisible(TEX_EYES_BAKED) || is_pure_dummy) + if (isTextureVisible(TEX_EYES_BAKED) || isUIAvatar()) { LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT); LLViewerJoint* eyeball_right = getViewerJoint(MESH_ID_EYEBALL_RIGHT); @@ -6165,8 +6160,7 @@ F32 LLVOAvatar::getTimeDilation() //----------------------------------------------------------------------------- F32 LLVOAvatar::getPixelArea() const { - // AXON UPDATE FOR CONTROL AVATARS - if (mIsDummy && !isControlAvatar()) + if (isUIAvatar()) { return 100000.f; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 730373d79c..de8da4f7ca 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -237,6 +237,7 @@ public: virtual bool isSelf() const { return false; } // True if this avatar is for this viewer's agent virtual bool isControlAvatar() const { return mIsControlAvatar; } // True if this avatar is a control av (no associated user) + virtual bool isUIAvatar() const { return mIsUIAvatar; } // True if this avatar is a supplemental av used in some UI views (no associated user) private: //aligned members LL_ALIGN_16(LLVector4a mImpostorExtents[2]); @@ -461,6 +462,7 @@ public: //-------------------------------------------------------------------- public: bool mIsControlAvatar; + bool mIsUIAvatar; bool mEnableDefaultMotions; //-------------------------------------------------------------------- diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8c722bf106..fc03373cc1 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3419,18 +3419,6 @@ bool LLVOVolume::isAnimatedObject() const LLVOVolume *root_vol = (LLVOVolume*)getRootEdit(); bool root_is_animated_flag = root_vol->getExtendedMeshFlags() & LLExtendedMeshParams::ANIMATED_MESH_ENABLED_FLAG; return root_is_animated_flag; -#if 0 - if (root_is_animated_flag) - { - bool root_can_be_animated = root_vol->canBeAnimatedObject(); - bool this_can_be_animated = (root_vol == this) ? root_can_be_animated : canBeAnimatedObject(); - if (this_can_be_animated && root_can_be_animated) - { - return true; - } - } - return false; -#endif } // Called any time parenting changes for a volume. Update flags and -- cgit v1.3 From 5cbe0578800c8d9b9c497b08370f23ee1f2c109e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Dec 2017 15:20:28 +0000 Subject: SL-838 - prevent deletion of LLDrawPoolAvatar while it still has rigged faces --- indra/newview/lldrawpool.cpp | 2 +- indra/newview/lldrawpoolavatar.cpp | 26 ++++++++++++++++++++++++++ indra/newview/lldrawpoolavatar.h | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index f74164aea6..1ec8d97f36 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -140,7 +140,7 @@ LLViewerTexture *LLDrawPool::getDebugTexture() return NULL; } -//virtual +//virtuals void LLDrawPool::beginRenderPass( S32 pass ) { } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index fe830419e0..2830a9d686 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -109,6 +109,32 @@ LLDrawPoolAvatar::LLDrawPoolAvatar() : { } +LLDrawPoolAvatar::~LLDrawPoolAvatar() +{ + if (!isDead()) + { + LL_WARNS() << "Destroying avatar drawpool that still contains faces" << LL_ENDL; + } +} + +// virtual +BOOL LLDrawPoolAvatar::isDead() +{ + if (!LLFacePool::isDead()) + { + return FALSE; + } + + for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) + { + if (mRiggedFace[i].size() > 0) + { + return FALSE; + } + } + return TRUE; +} + //----------------------------------------------------------------------------- // instancePool() //----------------------------------------------------------------------------- diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index b9d2204052..45b6d71110 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -60,6 +60,8 @@ public: virtual S32 getVertexShaderLevel() const; LLDrawPoolAvatar(); + ~LLDrawPoolAvatar(); + /*virtual*/ BOOL isDead(); static LLMatrix4& getModelView(); -- cgit v1.3 From ef264fd82e48a376db3c31323b3fcffe4d9c32b4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Dec 2017 15:42:29 +0000 Subject: SL-838 - more checking of pool state when adding or removing rigged meshes --- indra/newview/lldrawpoolavatar.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 2830a9d686..375704adff 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -2068,11 +2068,16 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) { + llassert (facep->isState(LLFace::RIGGED)); + llassert(getType() == LLDrawPool::POOL_AVATAR); + if (facep->getPool() && facep->getPool() != this) + { + LL_ERRS() << "adding rigged face that's already in another pool" << LL_ENDL; + } if (type >= NUM_RIGGED_PASSES) { LL_ERRS() << "Invalid rigged face type." << LL_ENDL; } - if (facep->getRiggedIndex(type) != -1) { LL_ERRS() << "Tried to add a rigged face that's referenced elsewhere." << LL_ENDL; @@ -2085,6 +2090,12 @@ void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type) void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep) { + llassert (facep->isState(LLFace::RIGGED)); + llassert(getType() == LLDrawPool::POOL_AVATAR); + if (facep->getPool() != this) + { + LL_ERRS() << "Tried to remove a rigged face from the wrong pool" << LL_ENDL; + } facep->setPool(NULL); for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) -- cgit v1.3 From aacb7eb25fd4caceaafb145ed550e14cebeef665 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 1 Oct 2018 16:11:09 +0100 Subject: SL-9773 - treat animated object attachments the same as other rigged attachments for purposes of visibility in mouselook. --- indra/newview/llcontrolavatar.cpp | 14 ++++++++++++++ indra/newview/llcontrolavatar.h | 2 ++ indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/llvoavatar.cpp | 6 ++++++ indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 6 ++++++ indra/newview/llvoavatarself.h | 3 +++ 7 files changed, 33 insertions(+), 1 deletion(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index a620f2abe9..28c02b0434 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -574,3 +574,17 @@ std::string LLControlAvatar::getFullname() const return "AO_no_root_vol"; } } + +// virtual +bool LLControlAvatar::shouldRenderRigged() const +{ + if (mRootVolp && mRootVolp->isAttachment()) + { + LLVOAvatar *attached_av = mRootVolp->getAvatarAncestor(); + if (attached_av) + { + return attached_av->shouldRenderRigged(); + } + } + return true; +} diff --git a/indra/newview/llcontrolavatar.h b/indra/newview/llcontrolavatar.h index 9924697938..f7f8db2717 100644 --- a/indra/newview/llcontrolavatar.h +++ b/indra/newview/llcontrolavatar.h @@ -73,6 +73,8 @@ public: virtual std::string getFullname() const; + /* virtual */ bool shouldRenderRigged() const; + bool mPlaying; F32 mGlobalScale; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 905428b090..d5e86143f1 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1709,7 +1709,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer( void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { - if (avatar->isSelf() && !gAgent.needsRenderAvatar()) + if (!avatar->shouldRenderRigged()) { return; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1f72aed5b4..93885a4472 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7464,6 +7464,12 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) updateMeshTextures(); } +// virtual +bool LLVOAvatar::shouldRenderRigged() const +{ + return true; +} + // FIXME: We have an mVisible member, set in updateVisibility(), but this // function doesn't return it! isVisible() and mVisible are used // different places for different purposes. mVisible seems to be more diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 25c89f96d7..985559f2d6 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -756,6 +756,7 @@ private: //-------------------------------------------------------------------- public: BOOL isVisible() const; + virtual bool shouldRenderRigged() const; void setVisibilityRank(U32 rank); U32 getVisibilityRank() const { return mVisibilityRank; } static S32 sNumVisibleAvatars; // Number of instances of this class diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b3a2d7951c..dcaade55a6 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2701,6 +2701,12 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) } } +// virtual +bool LLVOAvatarSelf::shouldRenderRigged() const +{ + return gAgent.needsRenderAvatar(); +} + // HACK: this will null out the avatar's local texture IDs before the TE message is sent // to ensure local texture IDs are not sent to other clients in the area. // this is a short-term solution. The long term solution will be to not set the texture diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index f9f90bb323..b0fdae9bf0 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -312,6 +312,9 @@ public: //-------------------------------------------------------------------- // Visibility //-------------------------------------------------------------------- + + /* virtual */ bool shouldRenderRigged() const; + public: bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; -- cgit v1.3