From e8a196f5fff37a9f2aa2bd5b3a7500682aeb8ce7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 16 May 2015 08:18:19 -0400 Subject: SL-111 WIP - animation dumping/logging --- indra/llcharacter/llmotioncontroller.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/llcharacter/llmotioncontroller.cpp') diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index e02b139608..c134b316fc 100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -377,6 +377,14 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) case LLMotion::STATUS_SUCCESS: // add motion to our list mLoadedMotions.insert(motion); + // FIXME SO MUCH DUMP + { + LLKeyframeMotion *km = dynamic_cast(motion); + if (km) + { + km->dumpToFile(""); + } + } break; default: LL_ERRS() << "Invalid initialization status" << LL_ENDL; @@ -780,6 +788,14 @@ void LLMotionController::updateLoadingMotions() mLoadingMotions.erase(curiter); // add motion to our loaded motion list mLoadedMotions.insert(motionp); + // FIXME SO MUCH DUMP + { + LLKeyframeMotion *km = dynamic_cast(motionp); + if (km) + { + km->dumpToFile(""); + } + } // this motion should be playing if (!motionp->isStopped()) { -- cgit v1.3 From b27492de06d0f5cbd45a892618ecb2d561a7181b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 May 2015 17:28:49 -0400 Subject: SL-117 WIP - initial placeholders for wing, tail joints. Updated max joints to 48 and added some debugging. --- indra/llappearance/llavatarappearance.cpp | 11 ++- indra/llcharacter/lljoint.h | 8 +- indra/llcharacter/llmotion.cpp | 11 ++- indra/llcharacter/llmotioncontroller.cpp | 1 + indra/newview/character/avatar_lad.xml | 110 ++++++++++++++++++++++++++++ indra/newview/character/avatar_skeleton.xml | 24 +++++- 6 files changed, 156 insertions(+), 9 deletions(-) (limited to 'indra/llcharacter/llmotioncontroller.cpp') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index d1eb389013..f73a46be8d 100755 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -552,6 +552,12 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent { LLJoint* joint = NULL; + LL_DEBUGS("BVH") << "bone info: name " << info->mName + << " isJoint " << info->mIsJoint + << " volume_num " << volume_num + << " joint_num " << joint_num + << LL_ENDL; + if (info->mIsJoint) { joint = getCharacterJoint(joint_num); @@ -629,6 +635,7 @@ BOOL LLAvatarAppearance::allocateCharacterJoints( U32 num ) //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) { + LL_DEBUGS("BVH") << "numBones " << info->mNumBones << " numCollisionVolumes " << info->mNumCollisionVolumes << LL_ENDL; //------------------------------------------------------------------------- // allocate joints //------------------------------------------------------------------------- @@ -655,8 +662,8 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) LLAvatarSkeletonInfo::bone_info_list_t::const_iterator iter; for (iter = info->mBoneInfoList.begin(); iter != info->mBoneInfoList.end(); ++iter) { - LLAvatarBoneInfo *info = *iter; - if (!setupBone(info, NULL, current_volume_num, current_joint_num)) + LLAvatarBoneInfo *bone_info = *iter; + if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num)) { LL_ERRS() << "Error parsing bone in skeleton file" << LL_ENDL; return FALSE; diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 2abe1d6db1..523cb0b5e6 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -40,9 +40,11 @@ #include "xform.h" const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; -const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4! -const U32 LL_HAND_JOINT_NUM = 31; -const U32 LL_FACE_JOINT_NUM = 30; +const U32 LL_CHARACTER_MAX_JOINTS = 48; // must be divisible by 4! +// FIXME BENTO - these should be higher than the joint_num of any +// other joint, to avoid conflicts in updateMotionsByType() +const U32 LL_HAND_JOINT_NUM = (LL_CHARACTER_MAX_JOINTS-1); +const U32 LL_FACE_JOINT_NUM = (LL_CHARACTER_MAX_JOINTS-2); const S32 LL_CHARACTER_MAX_PRIORITY = 7; const F32 LL_MAX_PELVIS_OFFSET = 5.f; diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index 4803f855de..2d646b4ed2 100755 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -111,9 +111,14 @@ void LLMotion::addJointState(const LLPointer& jointState) U32 usage = jointState->getUsage(); // for now, usage is everything - mJointSignature[0][jointState->getJoint()->getJointNum()] = (usage & LLJointState::POS) ? (0xff >> (7 - priority)) : 0; - mJointSignature[1][jointState->getJoint()->getJointNum()] = (usage & LLJointState::ROT) ? (0xff >> (7 - priority)) : 0; - mJointSignature[2][jointState->getJoint()->getJointNum()] = (usage & LLJointState::SCALE) ? (0xff >> (7 - priority)) : 0; + S32 joint_num = jointState->getJoint()->getJointNum(); + if ((joint_num >= (S32)LL_CHARACTER_MAX_JOINTS) || (joint_num < 0)) + { + LL_WARNS() << "joint_num " << joint_num << " is outside of legal range [0-" << LL_CHARACTER_MAX_JOINTS << ")" << LL_ENDL; + } + mJointSignature[0][joint_num] = (usage & LLJointState::POS) ? (0xff >> (7 - priority)) : 0; + mJointSignature[1][joint_num] = (usage & LLJointState::ROT) ? (0xff >> (7 - priority)) : 0; + mJointSignature[2][joint_num] = (usage & LLJointState::SCALE) ? (0xff >> (7 - priority)) : 0; } void LLMotion::setDeactivateCallback( void (*cb)(void *), void* userdata ) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index c134b316fc..0ad34a0965 100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -585,6 +585,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty else { // NUM_JOINT_SIGNATURE_STRIDES should be multiple of 4 + // FIXME BENTO - think it's just the number of joints that needs to be a multiple of 4, not the number of strides. for (S32 i = 0; i < NUM_JOINT_SIGNATURE_STRIDES; i++) { U32 *current_signature = (U32*)&(mJointSignature[0][i * 4]); diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index 9ec6428ee6..ac0b8b5704 100755 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -413,6 +413,116 @@ rotation="0 0 0" visible_in_first_person="true" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -27,6 +33,14 @@ + + + + + + + + @@ -39,6 +53,14 @@ + + + + + + + + @@ -78,4 +100,4 @@ - \ No newline at end of file + -- cgit v1.3 From 932412e1dbc2d684970a1398e140f7d2757e0440 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 12 Aug 2015 11:17:23 -0400 Subject: SL-109 WIP - code cleanup --- indra/llcharacter/llbvhloader.cpp | 2 +- indra/llcharacter/llkeyframemotion.cpp | 2 +- indra/llcharacter/llmotioncontroller.cpp | 4 ++-- indra/newview/app_settings/logcontrol.xml | 1 - indra/newview/llpreviewanim.cpp | 5 +++-- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/llcharacter/llmotioncontroller.cpp') diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index c3346091b8..4dedeeab52 100755 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -903,7 +903,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & return E_ST_NO_CHANNELS; } - // FIXME do we want to open up motion of non-hip joints or + // FIXME BENTO do we want to open up motion of non-hip joints or // not? Already effectively allowed via .anim upload. int res = sscanf(line.c_str(), " CHANNELS %d", &joint->mNumChannels); if ( res != 1 ) diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index d3af4d79e1..c227c3f8e9 100755 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -2253,7 +2253,7 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs, { motionp->mAssetStatus = ASSET_LOADED; // FIXME BENTO TEMP - motionp->dumpToFile(""); + //motionp->dumpToFile(""); } else diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 0ad34a0965..a3532f9f9c 100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -377,12 +377,12 @@ LLMotion* LLMotionController::createMotion( const LLUUID &id ) case LLMotion::STATUS_SUCCESS: // add motion to our list mLoadedMotions.insert(motion); - // FIXME SO MUCH DUMP + // BENTO TEMP { LLKeyframeMotion *km = dynamic_cast(motion); if (km) { - km->dumpToFile(""); + //km->dumpToFile(""); } } break; diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 51d6799d71..de3732f339 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -43,7 +43,6 @@ tags