summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-07-17 23:17:29 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-07-17 23:17:29 +0300
commit07ff9a5d67cefdae1bc112b19947f7ba173c9dbb (patch)
tree97299a554b4a4ea2453d675abc8a2d40595566d3 /indra/llcharacter
parent834a8eeddeda035551ed4071273c26e806946147 (diff)
parentec4135da63a3f3877222fba4ecb59b15650371fe (diff)
Merge branch 'main' into DRTVWR-582-maint-U
# Conflicts: # doc/contributions.txt # indra/llcommon/llerrorthread.cpp
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 6720f902bd..3cef382bbf 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -1391,6 +1391,8 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
// get number of joint motions
//-------------------------------------------------------------------------
U32 num_motions = 0;
+ S32 rotation_dupplicates = 0;
+ S32 position_dupplicates = 0;
if (!dp.unpackU32(num_motions, "num_joints"))
{
LL_WARNS() << "can't read number of joints"
@@ -1621,6 +1623,12 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
rCurve->mKeys[time] = rot_key;
}
+ if (joint_motion->mRotationCurve.mNumKeys > joint_motion->mRotationCurve.mKeys.size())
+ {
+ rotation_dupplicates++;
+ LL_INFOS() << "Motion: " << asset_id << " had dupplicate rotation keys that were removed" << LL_ENDL;
+ }
+
//---------------------------------------------------------------------
// scan position curve header
//---------------------------------------------------------------------
@@ -1723,9 +1731,24 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo
}
}
+ if (joint_motion->mPositionCurve.mNumKeys > joint_motion->mPositionCurve.mKeys.size())
+ {
+ position_dupplicates++;
+ }
+
joint_motion->mUsage = joint_state->getUsage();
}
+ if (rotation_dupplicates > 0)
+ {
+ LL_INFOS() << "Motion: " << asset_id << " had " << rotation_dupplicates << " dupplicate rotation keys that were removed" << LL_ENDL;
+ }
+
+ if (position_dupplicates > 0)
+ {
+ LL_INFOS() << "Motion: " << asset_id << " had " << position_dupplicates << " dupplicate position keys that were removed" << LL_ENDL;
+ }
+
//-------------------------------------------------------------------------
// get number of constraints
//-------------------------------------------------------------------------
@@ -2005,10 +2028,13 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
JointMotion* joint_motionp = mJointMotionList->getJointMotion(i);
success &= dp.packString(joint_motionp->mJointName, "joint_name");
success &= dp.packS32(joint_motionp->mPriority, "joint_priority");
- success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys");
+ success &= dp.packS32(joint_motionp->mRotationCurve.mKeys.size(), "num_rot_keys");
- LL_DEBUGS("BVH") << "Joint " << joint_motionp->mJointName << LL_ENDL;
- for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys)
+ LL_DEBUGS("BVH") << "Joint " << i
+ << " name: " << joint_motionp->mJointName
+ << " Rotation keys: " << joint_motionp->mRotationCurve.mKeys.size()
+ << " Position keys: " << joint_motionp->mPositionCurve.mKeys.size() << LL_ENDL;
+ for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys)
{
RotationKey& rot_key = rot_pair.second;
U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration);
@@ -2028,7 +2054,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
LL_DEBUGS("BVH") << " rot: t " << rot_key.mTime << " angles " << rot_angles.mV[VX] <<","<< rot_angles.mV[VY] <<","<< rot_angles.mV[VZ] << LL_ENDL;
}
- success &= dp.packS32(joint_motionp->mPositionCurve.mNumKeys, "num_pos_keys");
+ success &= dp.packS32(joint_motionp->mPositionCurve.mKeys.size(), "num_pos_keys");
for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys)
{
PositionKey& pos_key = pos_pair.second;