From 9acf7f5733063ff735ad37d456e740211c191cc9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 1 Sep 2016 19:11:44 +0300 Subject: MAINT-6221 If two animations have the same priority, it's arbitrary which one will take precedence --- indra/llcharacter/llpose.cpp | 13 ++++++++----- indra/llcharacter/llpose.h | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index b1a7ebb159..c430a73f6b 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -195,7 +195,7 @@ LLJointStateBlender::~LLJointStateBlender() //----------------------------------------------------------------------------- // addJointState() //----------------------------------------------------------------------------- -BOOL LLJointStateBlender::addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend) +BOOL LLJointStateBlender::addJointState(const LLPointer& joint_state, LLUUID source_id, S32 priority, BOOL additive_blend) { llassert(joint_state); @@ -210,23 +210,26 @@ BOOL LLJointStateBlender::addJointState(const LLPointer& joint_sta mJointStates[i] = joint_state; mPriorities[i] = priority; mAdditiveBlends[i] = additive_blend; + mMoutionIds[i] = source_id; return TRUE; } - else if (priority > mPriorities[i]) + else if (priority > mPriorities[i] || (priority == mPriorities[i] && source_id > mMoutionIds[i])) { // we're at a higher priority than the current joint state in this slot // so shift everyone over - // previous joint states (newer motions) with same priority should stay in place + // previous joint states (newer motions) with same priority and source motion should stay in place for (S32 j = JSB_NUM_JOINT_STATES - 1; j > i; j--) { mJointStates[j] = mJointStates[j - 1]; mPriorities[j] = mPriorities[j - 1]; mAdditiveBlends[j] = mAdditiveBlends[j - 1]; + mMoutionIds[j] = mMoutionIds[j - 1]; } // now store ourselves in this slot mJointStates[i] = joint_state; mPriorities[i] = priority; mAdditiveBlends[i] = additive_blend; + mMoutionIds[i] = source_id; return TRUE; } } @@ -489,11 +492,11 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) if (jsp->getPriority() == LLJoint::USE_MOTION_PRIORITY) { - joint_blender->addJointState(jsp, motion->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); + joint_blender->addJointState(jsp, motion->getID(), motion->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); } else { - joint_blender->addJointState(jsp, jsp->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); + joint_blender->addJointState(jsp, motion->getID(), jsp->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); } // add it to our list of active blenders diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index c004a0f3b7..28f560ed9f 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -85,12 +85,13 @@ class LLJointStateBlender protected: LLPointer mJointStates[JSB_NUM_JOINT_STATES]; S32 mPriorities[JSB_NUM_JOINT_STATES]; + LLUUID mMoutionIds[JSB_NUM_JOINT_STATES]; BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES]; public: LLJointStateBlender(); ~LLJointStateBlender(); void blendJointStates(BOOL apply_now = TRUE); - BOOL addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend); + BOOL addJointState(const LLPointer& joint_state, LLUUID source_id, S32 priority, BOOL additive_blend); void interpolate(F32 u); void clear(); void resetCachedJoint(); -- cgit v1.2.3 From ecd11724ca97a385bb04d2eb71eaf06c556791fa Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 5 Sep 2016 15:43:31 +0300 Subject: Backed out changeset: d3ffc46e9e92 --- indra/llcharacter/llpose.cpp | 13 +++++-------- indra/llcharacter/llpose.h | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index c430a73f6b..b1a7ebb159 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -195,7 +195,7 @@ LLJointStateBlender::~LLJointStateBlender() //----------------------------------------------------------------------------- // addJointState() //----------------------------------------------------------------------------- -BOOL LLJointStateBlender::addJointState(const LLPointer& joint_state, LLUUID source_id, S32 priority, BOOL additive_blend) +BOOL LLJointStateBlender::addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend) { llassert(joint_state); @@ -210,26 +210,23 @@ BOOL LLJointStateBlender::addJointState(const LLPointer& joint_sta mJointStates[i] = joint_state; mPriorities[i] = priority; mAdditiveBlends[i] = additive_blend; - mMoutionIds[i] = source_id; return TRUE; } - else if (priority > mPriorities[i] || (priority == mPriorities[i] && source_id > mMoutionIds[i])) + else if (priority > mPriorities[i]) { // we're at a higher priority than the current joint state in this slot // so shift everyone over - // previous joint states (newer motions) with same priority and source motion should stay in place + // previous joint states (newer motions) with same priority should stay in place for (S32 j = JSB_NUM_JOINT_STATES - 1; j > i; j--) { mJointStates[j] = mJointStates[j - 1]; mPriorities[j] = mPriorities[j - 1]; mAdditiveBlends[j] = mAdditiveBlends[j - 1]; - mMoutionIds[j] = mMoutionIds[j - 1]; } // now store ourselves in this slot mJointStates[i] = joint_state; mPriorities[i] = priority; mAdditiveBlends[i] = additive_blend; - mMoutionIds[i] = source_id; return TRUE; } } @@ -492,11 +489,11 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) if (jsp->getPriority() == LLJoint::USE_MOTION_PRIORITY) { - joint_blender->addJointState(jsp, motion->getID(), motion->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); + joint_blender->addJointState(jsp, motion->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); } else { - joint_blender->addJointState(jsp, motion->getID(), jsp->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); + joint_blender->addJointState(jsp, jsp->getPriority(), motion->getBlendType() == LLMotion::ADDITIVE_BLEND); } // add it to our list of active blenders diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index 28f560ed9f..c004a0f3b7 100644 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -85,13 +85,12 @@ class LLJointStateBlender protected: LLPointer mJointStates[JSB_NUM_JOINT_STATES]; S32 mPriorities[JSB_NUM_JOINT_STATES]; - LLUUID mMoutionIds[JSB_NUM_JOINT_STATES]; BOOL mAdditiveBlends[JSB_NUM_JOINT_STATES]; public: LLJointStateBlender(); ~LLJointStateBlender(); void blendJointStates(BOOL apply_now = TRUE); - BOOL addJointState(const LLPointer& joint_state, LLUUID source_id, S32 priority, BOOL additive_blend); + BOOL addJointState(const LLPointer& joint_state, S32 priority, BOOL additive_blend); void interpolate(F32 u); void clear(); void resetCachedJoint(); -- cgit v1.2.3 From 5b61515ca34dfb6bc84fea019f48a47be76c1b5f Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 22 Sep 2016 12:34:52 +0300 Subject: MAINT-6694 Gesture floater crash --- indra/llcharacter/llkeyframemotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcharacter') diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index cd201a65b4..e786dfff86 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -2149,7 +2149,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, LLCharacter* character = *char_iter; // look for an existing instance of this motion - LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->findMotion(asset_uuid); + LLKeyframeMotion* motionp = dynamic_cast (character->findMotion(asset_uuid)); if (motionp) { if (0 == status) -- cgit v1.2.3