From 6cdc6c236231a1f4b2ed545dc170dd52e6a9c31e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Dec 2017 16:18:32 +0000 Subject: [PATCH 01/13] SL-845 - viewer message for rez failure due to over-large animated objects --- indra/newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index f773ae6845..36efde1d54 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -10490,6 +10490,14 @@ You have been teleported by the object '[OBJECT_NAME]' owned by an unknown user. type="notify"> fail Unable to create requested object. The region is full. + + + + fail +Unable to create requested animated object because it exceeds the size limit. Date: Fri, 8 Dec 2017 15:20:28 +0000 Subject: [PATCH 02/13] 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(-) 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(); From ef264fd82e48a376db3c31323b3fcffe4d9c32b4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Dec 2017 15:42:29 +0000 Subject: [PATCH 03/13] 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(-) 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) From 6199cecd8bd40e9929f1863fcfa8220ccf9fdf3b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 11 Dec 2017 21:18:05 +0000 Subject: [PATCH 04/13] SL-704 - more comment review/cleanup, some avatar state handling updated for animated objects. --- indra/newview/llcontrolavatar.cpp | 7 +++++-- indra/newview/llvoavatar.cpp | 9 +++------ indra/newview/llvovolume.cpp | 9 ++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 0f4898e8d3..9b7118d9cb 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -113,7 +113,7 @@ void LLControlAvatar::setGlobalScale(F32 scale) { F32 adjust_scale = scale/mGlobalScale; LL_INFOS() << "scale " << scale << " adjustment " << adjust_scale << LL_ENDL; - // AXON - should we be scaling from the pelvis or the root? + // should we be scaling from the pelvis or the root? recursiveScaleJoint(mPelvisp,adjust_scale); mGlobalScale = scale; } @@ -167,7 +167,10 @@ void LLControlAvatar::updateVolumeGeom() matchVolumeTransform(); - // AXON testing scale + // Initial exploration of allowing scaling skeleton to match root + // prim bounding box. If enabled, would probably be controlled by + // an additional checkbox and default to off. Not enabled for + // initial release. // What should the scale be? What we really want is the ratio // between the scale at which the object was originally designed diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a5a9fbe0e6..53db1ffe32 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3975,7 +3975,6 @@ void LLVOAvatar::updateRootPositionAndRotation(LLAgent& agent, F32 speed, bool w root_pos = gAgent.getPosGlobalFromAgent(getRenderPosition()); root_pos.mdV[VZ] += getVisualParamWeight(AVATAR_HOVER); - // AXON need to review mInAir calcs for animated objects, if the value even matters. LLVector3 normal; resolveHeightGlobal(root_pos, ground_under_pelvis, normal); F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]); @@ -4024,9 +4023,8 @@ 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. + // Rotation fixups for avatars in motion. + // Skip for animated objects. updateOrientation(agent, speed, delta_time); } } @@ -6130,8 +6128,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) + if (isUIAvatar()) { outNorm.setVec(z_vec); out_pos_agent = in_pos_agent; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index cdab90d6cf..61844e064d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3357,12 +3357,11 @@ U32 LLVOVolume::getExtendedMeshFlags() const void LLVOVolume::onSetExtendedMeshFlags(U32 flags) { - // AXON - the check against isAnySelected() is "empirically - // derived": doing rebuildGeom() while in selection trashes the - // graphics state of animated objects. Skipping this update is OK - // because we get another one on deselect. - if (!getRootEdit()->isAnySelected() && mDrawable.notNull()) + // The isAnySelected() check was needed at one point to prevent + // graphics problems. These are now believed to be fixed so the + // check has been disabled. + if (/*!getRootEdit()->isAnySelected() &&*/ mDrawable.notNull()) { // Need to trigger rebuildGeom(), which is where control avatars get created/removed getRootEdit()->recursiveMarkForUpdate(TRUE); From 9f1482501348b36ef51b5eacfb6ddd62f83b814c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Dec 2017 14:04:23 +0000 Subject: [PATCH 05/13] SL-731 - diagnostic display cleanup for DebugAnimatedObjects --- indra/newview/llcontrolavatar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 9b7118d9cb..2df06caa23 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -287,6 +287,7 @@ void LLControlAvatar::updateDebugText() addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str())); addDebugText(llformat("tris %d verts %d", total_tris, total_verts)); addDebugText(llformat("pxarea %s", LLStringOps::getReadableNumber(getPixelArea()).c_str())); +#if 0 std::string region_name = "no region"; if (mRootVolp->getRegion()) { @@ -300,10 +301,7 @@ void LLControlAvatar::updateDebugText() addDebugText(llformat("region %x %s skel %x %s", mRootVolp->getRegion(), region_name.c_str(), getRegion(), skel_region_name.c_str())); - //addDebugText(llformat("anim time %.1f (step %f factor %f)", - // mMotionController.getAnimTime(), - // mMotionController.getTimeStep(), - // mMotionController.getTimeFactor())); +#endif } LLVOAvatar::updateDebugText(); From 49d924ae295190dbce999e5b8e31909c5fc4a22e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Dec 2017 16:04:10 +0000 Subject: [PATCH 06/13] MAINT-7528 - allow underscores to substitute for spaces in uploaded meshes - this allows rigging to some attachment points that will not otherwise work --- indra/llappearance/llavatarappearance.cpp | 27 ++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 94c431feb4..62273339f7 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -1723,7 +1723,7 @@ void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info) } mJointAliasMap[*i] = bone_name; } - + LLAvatarBoneInfo::child_list_t::const_iterator iter; for (iter = bone_info->mChildList.begin(); iter != bone_info->mChildList.end(); ++iter) { @@ -1738,13 +1738,34 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases { LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter; - for (iter = sAvatarSkeletonInfo->mBoneInfoList.begin(); iter != sAvatarSkeletonInfo->mBoneInfoList.end(); ++iter) + for (iter = sAvatarSkeletonInfo->mBoneInfoList.begin(); + iter != sAvatarSkeletonInfo->mBoneInfoList.end(); + ++iter) { //LLAvatarBoneInfo *bone_info = *iter; makeJointAliases( *iter ); } + + LLAvatarXmlInfo::attachment_info_list_t::iterator attach_iter; + for (attach_iter = sAvatarXmlInfo->mAttachmentInfoList.begin(); + attach_iter != sAvatarXmlInfo->mAttachmentInfoList.end(); + ++attach_iter) + { + LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *attach_iter; + std::string bone_name = info->mName; + + // Also accept the name with spaces substituted with + // underscores. This gives a mechanism for referencing such joints + // in daes, which don't allow spaces. + std::string sub_space_to_underscore = bone_name; + LLStringUtil::replaceChar(sub_space_to_underscore, ' ', '_'); + if (sub_space_to_underscore != bone_name) + { + mJointAliasMap[sub_space_to_underscore] = bone_name; + } + } } - + return mJointAliasMap; } From 9580e610f613b1de6dab5378e94d1fb4b67cbf50 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Dec 2017 20:22:38 +0000 Subject: [PATCH 07/13] MAINT-8088 - avoid excess object inventory queries when Animation Info display is enabled --- indra/newview/llvoavatar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 53db1ffe32..060e93ac9a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3494,7 +3494,10 @@ void LLVOAvatar::updateDebugText() LLVOVolume *volp = control_av->mRootVolp; if (volp) { - volp->requestInventory(); + if (volp->getInventorySerial()<=0) + { + volp->requestInventory(); + } LLViewerInventoryItem* item = volp->getInventoryItemByAsset(motionp->getID()); if (item) { From c508259f3c15401da1843af261c5a38e85fbfe80 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 14 Dec 2017 15:38:38 +0000 Subject: [PATCH 08/13] SL-731 - added est tris to animated object debug text --- indra/newview/llcontrolavatar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp index 2df06caa23..7270cad0da 100644 --- a/indra/newview/llcontrolavatar.cpp +++ b/indra/newview/llcontrolavatar.cpp @@ -242,6 +242,7 @@ void LLControlAvatar::updateDebugText() std::string lod_string; S32 total_tris = 0; S32 total_verts = 0; + S32 est_tris = 0; for (std::vector::iterator it = volumes.begin(); it != volumes.end(); ++it) { @@ -249,6 +250,7 @@ void LLControlAvatar::updateDebugText() S32 verts = 0; total_tris += volp->getTriangleCount(&verts); total_verts += verts; + est_tris += volp->getEstTrianglesMax(); lod_string += llformat("%d",volp->getLOD()); if (volp && volp->mDrawable) { @@ -285,7 +287,7 @@ void LLControlAvatar::updateDebugText() addDebugText(llformat("CAV obj %d anim %d active %s impost %d", total_linkset_count, animated_volume_count, active_string.c_str(), (S32) isImpostor())); addDebugText(llformat("types %s lods %s", type_string.c_str(), lod_string.c_str())); - addDebugText(llformat("tris %d verts %d", total_tris, total_verts)); + addDebugText(llformat("tris %d (est %d), verts %d", total_tris, est_tris, total_verts)); addDebugText(llformat("pxarea %s", LLStringOps::getReadableNumber(getPixelArea()).c_str())); #if 0 std::string region_name = "no region"; From d6007b2b41e34135f7fe579f9aa9c6b354657509 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 18 Dec 2017 13:40:30 +0000 Subject: [PATCH 09/13] MAINT-8104 - avoid redundant rigged volume updates when corresponding avatar is paused --- indra/newview/llvovolume.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 61844e064d..d31cd1e33f 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4407,6 +4407,15 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons { copyVolumeFaces(volume); } + else + { + bool is_paused = avatar && avatar->areAnimationsPaused(); + if (is_paused) + { + return; + } + } + //build matrix palette static const size_t kMaxJoints = LL_MAX_JOINTS_PER_MESH_OBJECT; From b0e47ec2c26a05a1aa98436ba092f1f01c3ac8aa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 19 Dec 2017 13:33:54 +0000 Subject: [PATCH 10/13] SL-713, MAINT-7709 - experimental setting to allow left-click interaction with animesh. Disabled by default. Still doesn't work in all cases and has significant performance impact --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/lltooldraganddrop.cpp | 2 +- indra/newview/lltoolpie.cpp | 20 +++++++++++++++----- indra/newview/lltoolselect.cpp | 4 +++- indra/newview/lltoolselectrect.cpp | 4 +++- indra/newview/llviewerwindow.cpp | 4 +++- 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2fe01ab22f..d155763053 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2204,6 +2204,17 @@ Value 0 + AnimatedObjectsAllowLeftClick + + Comment + Allow left-click interaction with animated objects. Uncertain how much performance impact this will have. + Persist + 1 + Type + Boolean + Value + 0 + DebugAvatarAppearanceMessage Comment diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index bd68d8c999..efbb8c856a 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -785,7 +785,7 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep mDrop = drop; if (mDrop) { - // don't allow drag and drop onto transparent objects + // don't allow drag and drop onto rigged or transparent objects pick(gViewerWindow->pickImmediate(x, y, FALSE, FALSE)); } else diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 0e169408ff..238e1d0306 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -111,9 +111,12 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) mMouseOutsideSlop = FALSE; mMouseDownX = x; mMouseDownY = y; - + LLTimer pick_timer; + // AXON experimental feature + BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); //left mouse down always picks transparent (but see handleMouseUp) - mPick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); + mPick = gViewerWindow->pickImmediate(x, y, TRUE, pick_rigged); + LL_INFOS() << "pick_rigged is " << (S32) pick_rigged << " pick time elapsed " << pick_timer.getElapsedTimeF32() << LL_ENDL; mPick.mKeyMask = mask; mMouseButtonDown = true; @@ -128,7 +131,10 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) { // don't pick transparent so users can't "pay" transparent objects - mPick = gViewerWindow->pickImmediate(x, y, /*BOOL pick_transparent*/ FALSE, /*BOOL pick_rigged*/ TRUE, /*BOOL pick_particle*/ TRUE); + mPick = gViewerWindow->pickImmediate(x, y, + /*BOOL pick_transparent*/ FALSE, + /*BOOL pick_rigged*/ TRUE, + /*BOOL pick_particle*/ TRUE); mPick.mKeyMask = mask; // claim not handled so UI focus stays same @@ -538,7 +544,9 @@ void LLToolPie::selectionPropertiesReceived() BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) { - mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE, FALSE); + // AXON experimental feature + BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + mHoverPick = gViewerWindow->pickImmediate(x, y, FALSE, pick_rigged); LLViewerObject *parent = NULL; LLViewerObject *object = mHoverPick.getObject(); LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); @@ -584,7 +592,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) else { // perform a separate pick that detects transparent objects since they respond to 1-click actions - LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); + LLPickInfo click_action_pick = gViewerWindow->pickImmediate(x, y, TRUE, pick_rigged); LLViewerObject* click_action_object = click_action_pick.getObject(); @@ -670,6 +678,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) LLPickInfo savedPick = mPick; mPick = gViewerWindow->pickImmediate(savedPick.mMousePt.mX, savedPick.mMousePt.mY, FALSE /* ignore transparent */, + FALSE /* ignore rigged */, FALSE /* ignore particles */); if (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick @@ -759,6 +768,7 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) LLPickInfo savedPick = mPick; mPick = gViewerWindow->pickImmediate(savedPick.mMousePt.mX, savedPick.mMousePt.mY, FALSE /* ignore transparent */, + FALSE /* ignore rigged */, FALSE /* ignore particles */); if(mPick.mPickType == LLPickInfo::PICK_OBJECT) diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 1fcc9a0711..aa0e9f5c09 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -63,7 +63,9 @@ LLToolSelect::LLToolSelect( LLToolComposite* composite ) BOOL LLToolSelect::handleMouseDown(S32 x, S32 y, MASK mask) { // do immediate pick query - mPick = gViewerWindow->pickImmediate(x, y, TRUE, FALSE); + // AXON experimental feature + BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + mPick = gViewerWindow->pickImmediate(x, y, TRUE, pick_rigged); // Pass mousedown to agent LLTool::handleMouseDown(x, y, mask); diff --git a/indra/newview/lltoolselectrect.cpp b/indra/newview/lltoolselectrect.cpp index 71dc8001d4..d655dd881e 100644 --- a/indra/newview/lltoolselectrect.cpp +++ b/indra/newview/lltoolselectrect.cpp @@ -71,7 +71,9 @@ void dialog_refresh_all(void); BOOL LLToolSelectRect::handleMouseDown(S32 x, S32 y, MASK mask) { - handlePick(gViewerWindow->pickImmediate(x, y, TRUE, FALSE)); + // AXON experimental feature + BOOL pick_rigged = gSavedSettings.getBOOL("AnimatedObjectsAllowLeftClick"); + handlePick(gViewerWindow->pickImmediate(x, y, TRUE /* pick_transparent */, pick_rigged)); LLTool::handleMouseDown(x, y, mask); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7b4895b862..7c3bfd1849 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1156,7 +1156,9 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi if (prim_media_dnd_enabled) { - LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, TRUE /*BOOL pick_transparent*/, FALSE ); + LLPickInfo pick_info = pickImmediate( pos.mX, pos.mY, + TRUE /* pick_transparent */, + FALSE /* pick_rigged */); LLUUID object_id = pick_info.getObjectID(); S32 object_face = pick_info.mObjectFace; From 2e6e6c434615b46b754b8198c867f77b0a6b92de Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 20 Dec 2017 16:26:17 +0000 Subject: [PATCH 11/13] MAINT-8104 - make pausing of wireframe updates a little smarter - waits for a couple of frames to make sure state is current before starting to skip LLRiggedVolume::update() --- indra/llcharacter/llmotioncontroller.cpp | 3 ++- indra/llcharacter/llmotioncontroller.h | 3 ++- indra/newview/llvovolume.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 4c3a676382..3116403616 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -135,7 +135,7 @@ LLMotionController::LLMotionController() mLastTime(0.0f), mHasRunOnce(FALSE), mPaused(FALSE), - mPauseTime(0.f), + mPausedFrame(0), mTimeStep(0.f), mTimeStepCount(0), mLastInterp(0.f), @@ -1129,6 +1129,7 @@ void LLMotionController::pauseAllMotions() { //LL_INFOS() << "Pausing animations..." << LL_ENDL; mPaused = TRUE; + mPausedFrame = LLFrameTimer::getFrameCount(); } } diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index bcd0bfc685..637ee4d2bb 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -148,6 +148,7 @@ public: void pauseAllMotions(); void unpauseAllMotions(); BOOL isPaused() const { return mPaused; } + S32 getPausedFrame() const { return mPausedFrame; } void setTimeStep(F32 step); F32 getTimeStep() const { return mTimeStep; } @@ -221,7 +222,7 @@ protected: F32 mLastTime; BOOL mHasRunOnce; BOOL mPaused; - F32 mPauseTime; + S32 mPausedFrame; F32 mTimeStep; S32 mTimeStepCount; F32 mLastInterp; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d31cd1e33f..e291416f92 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4409,11 +4409,17 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons } else { +#if 1 bool is_paused = avatar && avatar->areAnimationsPaused(); if (is_paused) { - return; + S32 frames_paused = LLFrameTimer::getFrameCount() - avatar->getMotionController().getPausedFrame(); + if (frames_paused > 2) + { + return; + } } +#endif } From b78354ac79385bcb28316aa3f43913393ad8c5ab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 20 Dec 2017 21:56:46 +0000 Subject: [PATCH 12/13] SL-731 - show est tris in metadata->triangle count display --- indra/newview/llvovolume.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e291416f92..ad72fa9480 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1308,16 +1308,12 @@ BOOL LLVOVolume::calcLOD() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TRIANGLE_COUNT) && mDrawable->getFace(0)) { - if (isRootEdit() && getChildren().size()>0) + if (isRootEdit()) { S32 total_tris = recursiveGetTriangleCount(); - setDebugText(llformat("TRIS %d TOTAL %d", getTriangleCount(), total_tris)); + S32 est_max_tris = recursiveGetEstTrianglesMax(); + setDebugText(llformat("TRIS SHOWN %d EST %d", total_tris, est_max_tris)); } - else - { - setDebugText(llformat("TRIS %d", getTriangleCount())); - } - } if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) && mDrawable->getFace(0)) From 095dd1b800d82a0fc97177a6fb668ddc72943613 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Dec 2017 20:03:56 +0000 Subject: [PATCH 13/13] SL-859 - create control avatar if needed when animation request received --- indra/newview/llviewermessage.cpp | 1 + indra/newview/llviewerobject.cpp | 28 +++++++++++++++++++++++++ indra/newview/llviewerobject.h | 2 ++ indra/newview/llvovolume.cpp | 35 +++++-------------------------- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bfaad30fc1..46dcf06ebd 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5103,6 +5103,7 @@ void process_object_animation(LLMessageSystem *mesgsys, void **user_data) return; } + volp->updateControlAvatar(); LLControlAvatar *avatarp = volp->getControlAvatar(); if (!avatarp) { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 915b4348b4..fdfc54b67e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2947,6 +2947,34 @@ LLControlAvatar *LLViewerObject::getControlAvatar() const return getRootEdit()->mControlAvatar.get(); } +void LLViewerObject::updateControlAvatar() +{ + LLViewerObject *root = getRootEdit(); + if (root->isAnimatedObject() && !root->getControlAvatar()) + { + bool any_mesh = root->isMesh(); + LLViewerObject::const_child_list_t& child_list = root->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + const LLViewerObject* child = *iter; + any_mesh = any_mesh || child->isMesh(); + } + if (any_mesh) + { + std::string vobj_name = llformat("Vol%u", (U32) root); + LL_DEBUGS("AnimatedObjects") << vobj_name << " calling linkControlAvatar()" << LL_ENDL; + root->linkControlAvatar(); + } + } + if (!root->isAnimatedObject() && root->getControlAvatar()) + { + std::string vobj_name = llformat("Vol%u", (U32) root); + LL_DEBUGS("AnimatedObjects") << vobj_name << " calling unlinkControlAvatar()" << LL_ENDL; + root->unlinkControlAvatar(); + } +} + void LLViewerObject::linkControlAvatar() { if (!getControlAvatar() && isRootEdit()) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 4a2ccd4e3a..237529f213 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -703,6 +703,8 @@ public: void linkControlAvatar(); // Remove any reference to control av for this prim void unlinkControlAvatar(); + // Link or unlink as needed + void updateControlAvatar(); virtual bool isAnimatedObject() const; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ad72fa9480..1725ae4c8a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5046,38 +5046,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) rigged = rigged || (vobj->isAnimatedObject() && vobj->isRiggedMesh() && vobj->getControlAvatar() && vobj->getControlAvatar()->mPlaying); - if (vobj->isAnimatedObject()) + vobj->updateControlAvatar(); + if (vobj->getControlAvatar()) { - if (!vobj->getControlAvatar()) - { - F32 tri_count = vobj->getRootEdit()->recursiveGetEstTrianglesMax(); - if (tri_count <= 0.f) - { - LL_DEBUGS("AnimatedObjects") << vobj_name << " not calling linkControlAvatar(), because no tris" << LL_ENDL; - } - else - { - LL_DEBUGS("AnimatedObjects") << vobj_name << " calling linkControlAvatar()" << LL_ENDL; - vobj->linkControlAvatar(); - } - } - if (vobj->getControlAvatar()) - { - rigged_av = vobj->getControlAvatar(); - rigged_av->rebuildAttachmentOverrides(); - } + rigged_av = vobj->getControlAvatar(); + rigged_av->rebuildAttachmentOverrides(); } - else - { - // Not animated but has a control avatar - probably - // the checkbox has changed since the last rebuild. - if (vobj->getControlAvatar()) - { - LL_DEBUGS("AnimatedObjects") << vobj_name << " calling unlinkControlAvatar()" << LL_ENDL; - vobj->unlinkControlAvatar(); - } - } - + bool bake_sunlight = LLPipeline::sBakeSunlight && drawablep->isStatic(); bool any_rigged_face = false;